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

Bug 447696

Summary: RepresentationNavigationDescription.label should be used in displayed menus instead of its name/id
Product: [Modeling] Sirius Reporter: Maxime Porhel <maxime.porhel>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: belqassim.djafer, esteban.dugueperoux, laurent.redor, pierre-charles.david
Version: 1.0.1Keywords: triaged
Target Milestone: 3.0.0M5   
Hardware: PC   
OS: Mac OS X   
Whiteboard: trivial, flash, newbie
Bug Depends on:    
Bug Blocks: 456341    
Attachments:
Description Flags
Contextual menu on a sample metamodel none

Description Maxime Porhel CLA 2014-10-17 08:47:01 EDT
. Create or open a VSM with one table, one tree and one table descriptions. 
. Add and complete one instance of each Table/Tree/DiagramNavigationDescription
. Create a diagram with an element on which you can see the navigation menu

The name/id is used to build the menu: the label should be used isntead. 

See org.eclipse.sirius.diagram.ui.tools.internal.menu.OpenMenuContribution.buildOpenRepresentationActions(IMenuManager, IInterpreter, RepresentationNavigationDescription, DRepresentationElement, Session, EditPart, TransactionalEditingDomain) on master and NavigateToMenuContribution on v1.0.x branch.
Comment 1 Maxime Porhel CLA 2014-10-17 08:52:13 EDT
Created attachment 247973 [details]
Contextual menu on a sample metamodel
Comment 2 Belqassim Djafer CLA 2014-10-27 06:55:29 EDT
fixed on master (for sirius2.0) with the commit 07589cd5e092ac9b4c9ad7b47528777a0e465b66
Comment 3 Maxime Porhel CLA 2014-11-06 11:35:22 EST
(In reply to Belqassim Djafer from comment #2)
> fixed on master (for sirius2.0) with the commit
> 07589cd5e092ac9b4c9ad7b47528777a0e465b66

The bug is still there, it is present if there is no navigation name expression. 

The bug exists in Diagram, Table and Tree dialects

org.eclipse.sirius.business.api.query.IdentifiedElementQuery.getLabel() should be used instead of navDesc.getName(): 
 . line 236 of OpenMenuContribution.buildOpenRepresentationActions(IMenuManager, IInterpreter, RepresentationNavigationDescription, DRepresentationElement, Session, EditPart, TransactionalEditingDomain)
 . line 413 of DTableMenuListener.buildOpenRepresentationActions(IMenuManager, IInterpreter, RepresentationNavigationDescription, DRepresentationElement, Session) 
 . line 333 of DTreeMenuListener.buildOpenRepresentationActions(IMenuManager, IInterpreter, RepresentationNavigationDescription, DRepresentationElement, Session) 

Note that for Diagram/Table/Tree creation description menu, the label is already used (org.eclipse.sirius.ui.tools.api.actions.AbstractCreateRepresentationFromRepresentationCreationDescription.getText()).
Comment 4 Belqassim Djafer CLA 2014-11-12 03:56:57 EST
(In reply to Maxime Porhel from comment #3)
> (In reply to Belqassim Djafer from comment #2)
> > fixed on master (for sirius2.0) with the commit
> > 07589cd5e092ac9b4c9ad7b47528777a0e465b66
> 
> The bug is still there, it is present if there is no navigation name
> expression. 
> 
> The bug exists in Diagram, Table and Tree dialects
> 
> org.eclipse.sirius.business.api.query.IdentifiedElementQuery.getLabel()
> should be used instead of navDesc.getName(): 
>  . line 236 of
> OpenMenuContribution.buildOpenRepresentationActions(IMenuManager,
> IInterpreter, RepresentationNavigationDescription, DRepresentationElement,
> Session, EditPart, TransactionalEditingDomain)
>  . line 413 of
> DTableMenuListener.buildOpenRepresentationActions(IMenuManager,
> IInterpreter, RepresentationNavigationDescription, DRepresentationElement,
> Session) 
>  . line 333 of
> DTreeMenuListener.buildOpenRepresentationActions(IMenuManager, IInterpreter,
> RepresentationNavigationDescription, DRepresentationElement, Session) 
> 
> Note that for Diagram/Table/Tree creation description menu, the label is
> already used
> (org.eclipse.sirius.ui.tools.api.actions.
> AbstractCreateRepresentationFromRepresentationCreationDescription.getText()).

Thank you Maxime and in reply to your comment I propose the fix : https://git.eclipse.org/r/#/c/36102/
Comment 5 Pierre-Charles David CLA 2014-12-30 08:19:05 EST
Cloned as bug #456341 to backport into Sirius 2.0.x.
Comment 6 Esteban DUGUEPEROUX CLA 2015-01-15 04:05:34 EST
Merged as ed220ddbafbef8da7f87dc9d7d35634ee303e234
Comment 7 Belqassim Djafer CLA 2015-04-09 09:57:18 EDT
Verified on Sirius 3.0.0M6
Comment 8 Pierre-Charles David CLA 2015-06-24 11:17:29 EDT
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.