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

Bug 473943

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: Pierre-Charles David <pierre-charles.david>
Severity: normal    
Priority: P3 CC: pierre-charles.david
Version: 2.0.5Keywords: triaged
Target Milestone: 3.0.1   
Hardware: PC   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/52877
https://git.eclipse.org/r/52878
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=814bb278e6aa174611e2f183643f80bf6f434890
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=b55fd604e38ef864d8cb7676ca6b68526382a1fe
https://git.eclipse.org/r/53137
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=f7cfdc68fe504a604b371bed5e21267dcdccf719
Whiteboard:
Bug Depends on: 473263, 473944    
Bug Blocks:    

Description Maxime Porhel CLA 2015-07-30 11:50:06 EDT
+++ This bug was initially created as a clone of Bug #473263 +++

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-08-03 09:49:25 EDT
New Gerrit change created: https://git.eclipse.org/r/53072
Comment 4 Eclipse Genie CLA 2015-08-04 06:25:39 EDT
New Gerrit change created: https://git.eclipse.org/r/53137
Comment 6 Maxime Porhel CLA 2015-08-04 09:57:11 EDT
Corrected on 3.0.x branch.
Comment 7 Pierre-Charles David CLA 2015-09-07 03:56:11 EDT
Verified in 3.0.1.201509020834 (part of Mars.1 RC2 modeling package).
Comment 8 Pierre-Charles David CLA 2015-12-15 05:22:10 EST
Available in Sirius 3.0.1 released on 2015-09-10.