Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 473263

Summary: Table/Tree editor are not able to resolve their proxy input after reload
Product: [Modeling] Sirius Reporter: Maxime Porhel <maxime.porhel>
Component: CoreAssignee: Maxime Porhel <maxime.porhel>
Status: CLOSED FIXED QA Contact: Laurent Redor <laurent.redor>
Severity: normal    
Priority: P3 CC: laurent.redor
Version: 2.0.5Keywords: triaged
Target Milestone: 2.0.7   
Hardware: PC   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/52836
https://git.eclipse.org/r/52843
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=10506d12ada09a5177f746a02b902e7b80970499
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=f42f1c6154a4d682635140fbd5e37c151ea3ad0b
https://git.eclipse.org/r/53135
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=7decff7276c865bf5d53401704f4380df9bcfc2b
Whiteboard: report
Bug Depends on:    
Bug Blocks: 473943, 473944    

Description Maxime Porhel CLA 2015-07-22 04:30:39 EDT
Steps to reproduce: 
 . Open a DTree/DTable
 . Open the aird a text editor, modify it (add a space) and save
 . The aird is reloaded
 . Set the focus to the DTable/DTree editor
 . Popup "The root element has been deleted, the editor will close." > KO



The main issue seems to be the aird reload with an open Table or Tree editor: our Tree and Table editors are not able to resolve their proxy Viewpoint/Sirius element, see: 
 . AbstractDTableEditor.table
 . DTreeEditor.treeModel
 . DDiagramEditor.setFocus: getDiagramGraphicalViewer().getRootEditPart().getChildren().get(0): DDiagramEditPart.resolveSemanticElement is able to resolve the proxy.

Fast working DRAFT:
> private void checkSemanticAssociation() {
>   if (tableModel != null && tableModel.eIsProxy()) {
>     URI uri = ((InternalEObject) tableModel).eProxyURI();
>     tableModel = (DTable)
session.getTransactionalEditingDomain().getResourceSet().getEObject(uri, false);
>   }
>   if (tableModel == null || tableModel.eResource() == null || tableModel.getTarget() == null || tableModel.getTarget().eResource() == null) {
>  ...


Look for resolve/resolveSemanticeElement methods into GrapicalEditPart/ViewUiil/EMFCoreUtile/Util/EcoreUtil
Comment 1 Eclipse Genie CLA 2015-07-30 03:34:12 EDT
New Gerrit change created: https://git.eclipse.org/r/52836
Comment 2 Eclipse Genie CLA 2015-07-30 06:09:22 EDT
New Gerrit change created: https://git.eclipse.org/r/52843
Comment 3 Eclipse Genie CLA 2015-07-30 12:20:35 EDT
New Gerrit change created: https://git.eclipse.org/r/52878
Comment 4 Eclipse Genie CLA 2015-07-30 12:20:36 EDT
New Gerrit change created: https://git.eclipse.org/r/52877
Comment 7 Maxime Porhel CLA 2015-08-04 05:57:58 EDT
Corrected on 2.0.x branch
Comment 8 Eclipse Genie CLA 2015-08-04 06:22:06 EDT
New Gerrit change created: https://git.eclipse.org/r/53135
Comment 10 Laurent Redor CLA 2017-01-04 03:06:12 EST
Validated with Sirius 2.0.7 (2.0.7.201611241521)
Comment 11 Pierre-Charles David CLA 2017-01-31 08:49:39 EST
Available in Sirius 2.0.7, see https://wiki.eclipse.org/Sirius/2.0.7.