Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320319 - Redundant actions are displayed in context menu of diagrams
Summary: Redundant actions are displayed in context menu of diagrams
Status: RESOLVED FIXED
Alias: None
Product: Tigerstripe
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P2 major with 1 vote (vote)
Target Milestone: 0.5M0   Edit
Assignee: Navid Mehregani CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-19 16:07 EDT by Navid Mehregani CLA
Modified: 2010-08-24 11:41 EDT (History)
1 user (show)

See Also:


Attachments
Screenshot (43.16 KB, image/png)
2010-07-19 16:07 EDT, Navid Mehregani CLA
no flags Details
Another screenshot (66.25 KB, image/png)
2010-07-29 16:48 EDT, Navid Mehregani CLA
no flags Details
Patch (70.30 KB, patch)
2010-08-15 13:12 EDT, Navid Mehregani CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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