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

Bug 320319

Summary: Redundant actions are displayed in context menu of diagrams
Product: [Technology] Tigerstripe Reporter: Navid Mehregani <nmehrega>
Component: UIAssignee: Navid Mehregani <nmehrega>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2 CC: erdillon
Version: unspecified   
Target Milestone: 0.5M0   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Screenshot
none
Another screenshot
none
Patch none

Description Navid Mehregani CLA 2010-07-19 16:07:27 EDT
Build Identifier: 

When multiple artifacts are selected in a class diagram the context contains the following actions:
- Delete from diagram
- Delete from model
- Remove from diagram
- Remove from model

See attached screenshot for more details.


Reproducible: Always

Steps to Reproduce:
Create a new class diagaram > Add two Entity artifacts > Add an association between the artifacts > select all the artifacts in the diagram > right click > see the redundant actions.
Comment 1 Navid Mehregani CLA 2010-07-19 16:07:53 EDT
Created attachment 174670 [details]
Screenshot
Comment 2 Eric Dillon CLA 2010-07-19 16:27:44 EDT
Interestingly enough... the association is the one triggering this!
"Delete xxx" are the default actions contributed by GMF which don't work properly in our context as our model is not just the "Diagram mode" but the TS model contained in the Artifact Mgr. The others ("Remove...") are the Tigerstripe specific which work properly.

I remember we edited the plugin.xml in the diagram plugin to explicitly avoid the "Delete..." flavors. It looks like something still remains when both shapes and edges are selected in a diagram?
Comment 3 Navid Mehregani CLA 2010-07-29 16:48:08 EDT
Created attachment 175528 [details]
Another screenshot

I was able to reproduce this problem without an association.  Actually selecting ANY artifact along with an Entity artifact will cause this problem.
Comment 4 Navid Mehregani CLA 2010-08-10 01:16:56 EDT
Also, if you add a Note to your diagram, select all element, you don't get 'Remove from Model' and 'Remove from diagram' actions in the context menu.
Comment 5 Navid Mehregani CLA 2010-08-15 13:12:50 EDT
Created attachment 176635 [details]
Patch
Comment 6 Navid Mehregani CLA 2010-08-16 01:24:06 EDT
The attached patch takes into account objects that are not of the same kind in the selection.  We were filtering out the GMF actions using the 'object class' criteria, but didn't take into account the case where selection could contain different object classes.
Comment 7 Navid Mehregani CLA 2010-08-24 11:41:21 EDT
Committed Patch.  Modified Files:

AssociationClassConnectionEditPart
AbstractLabelEditPart
AbstractArtifactReferencesEditPart
Association2EditPart
AssociationZEndNameEditPart
AssociationClassAEndNameEditPart
AssociationClass2EditPart
AdaptableTigerstripeConnectionNodeEditPart
ManagedEntityArtifactNamePackageEditPart
AssociationClassClassStereotypesEditPart
AbstractNamePackageEditPart
AssociationClassAEndMultiplicityEditPart
DatatypeArtifactNamePackageEditPart
AssociationClassZEndNameEditPart
AssociationClassZEndMultiplicityEditPart
AssociationClassClassNamePackageEditPart
AttributeNameTypeEditPart
AssociationClassAssociatedClassEditPart
AssociationClassClassMethodCompartmentEditPart
AssociationAEndMultiplicityEditPart
AssociationAEndMultiplicityEditPart
DatatypeArtifactEditPart
AssociationStereotypesEditPart
DatatypeArtifactAttributeCompartmentEditPart
AssociationAEndNameEditPart
AssociationNamePackageEditPart
AssociationZEndMultiplicityEditPart
AssociationClassClassAttributeCompartmentEditPart
DatatypeArtifactMethodCompartmentEditPart
org.eclipse.tigerstripe.workbench.ui.visualeditor.diagram/plugin.xml