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

Bug 439140

Summary: Issues in Representation creation/navigation menus computation
Product: [Modeling] Sirius Reporter: Maxime Porhel <maxime.porhel>
Component: CoreAssignee: Maxime Porhel <maxime.porhel>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: triaged
Version: 1.0.0   
Target Milestone: 2.0.0   
Hardware: PC   
OS: Windows NT   
Whiteboard:
Bug Depends on:    
Bug Blocks: 439237, 441965    
Attachments:
Description Flags
Representation creation/navigation tools use case. none

Description Maxime Porhel CLA 2014-07-08 11:18:57 EDT
Several issues have been found in Representation creation/navigation tools. 

From an edge, you can only create Diagrams, see org.eclipse.sirius.diagram.ui.tools.internal.menu.SubDiagramMenu.createDetailsActions(DEdge, IMenuManager, TransactionalEditingDomain, IGraphicalEditPart): there is an unwanted instanceof DiagramCreationDescription.

The other issues concern Tree and Table: when we compute the navigation menus (representations on the element + navigation tools), we do not check that the representations to open are defined in one of the activated Viewpoint. And a last point: in Diagram we check this after the navigation tool precondition evaluation whereas it would be more efficient to do it before the evaluation as we know the description)
Comment 1 Maxime Porhel CLA 2014-07-08 11:41:28 EDT
See:
 . https://git.eclipse.org/r/29614 > Enable all kind ofrepresentation creation tools from Edges.
 . https://git.eclipse.org/r/29615 > Remove duplication and do not compute creation menus for representation not described in an active Viewpoint
 . https://git.eclipse.org/r/29616 > Improve perf, remove duplication and do not compute navigation menus for representation not described in an active Viewpoint
Comment 2 Maxime Porhel CLA 2014-07-08 12:49:55 EDT
Created attachment 244893 [details]
Representation creation/navigation tools use case.

Step to reproduce - Expected result: 
 . Open the my.aird session.
 
 . Enable the three 439140 - x  viewpoints

 . Open the diagram1 representation
 . On the diagram, right clic on the edge and look into the navigate menu: you shoudl see three new details menu (diag, table, tree)
 . on the p1 container, right clic > Navigate : 3 new details menu and 6 open menus
 . on the diagram, right clic > Navigate : 5 open menu, the current diag is not in the list

 . Open the tree1 representation
 . on the tree, right clic > Navigate : 5 open menu, the current tree is not in the list
 . on the p1 element, right clic > Navigate : 3 new details menu and 6 open menus

 . Open the table1 representation
 . on the tree, right clic > Navigate : 5 open menu, the current table is not in the list
 . on the p1 line, right clic > Navigate : 3 new details menu and 6 open menus

 . Close all representations

 . Select only the 439140 - 1  viewpoint
 . Open diagram1
 . check that on all elements, no table/tree navigation or creation is proposed

 . Close all representations

 . Select only the 439140 - 2  viewpoint
 . Open table1
 . check that on all elements, no diagram/tree navigation or creation is proposed

 . Close all representations

 . Select only the 439140 - 3  viewpoint
 . Open tree1
 . check that on all elements, no diagram/tablenavigation or creation is proposed
Comment 3 Maxime Porhel CLA 2014-07-08 12:52:28 EDT
https://git.eclipse.org/r/29620 is an additional issue discovered during tests of the previous patch sets. Table and Tree navigation tools are currently created with a variable without name, it is not required so the validation does not detect it and if the specifier does not see this it produce a NPE during the computation of the subdiagramDecorator and menus (if the specifier put a precondition)
Comment 4 Maxime Porhel CLA 2014-07-08 12:58:53 EDT
https://git.eclipse.org/r/29621 corrects the SubDiagramDecorator computation to handle only the selected Viewpoints.
Comment 5 Maxime Porhel CLA 2014-07-09 04:03:25 EDT
Note that without the 6 current corrections, 5 of the 10 assertions of "Step to reproduce - Expected result" are KO.
Comment 6 Maxime Porhel CLA 2014-07-09 09:34:40 EDT
Corrected by commits
 . 15d1d19e3de11a97a1a5c7f7aa89a2424d1819b0
 . 3dfb1824d4b65a50c8876c3fe6129bca533859d6
 . 3e30d45cefac2389df1619b2ce06bce331fa78fe
 . c6b7151a193e20ee63d48326a90f060c6d6edf87
 . ac2f92dc002f7a655398fd31e24b8dbb4c8b051c
Comment 7 Pierre-Charles David CLA 2014-10-27 06:53:08 EDT
Available in Sirius 2.0.0.