Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/model/ComponentDiagram.gmfgen8
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src-gen/org/eclipse/papyrus/uml/diagram/component/edit/parts/PortEditPart.java2
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen4
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src-gen/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortEditPart.java2
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml18
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/ShowHideLabelsAction.java30
6 files changed, 41 insertions, 23 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/model/ComponentDiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/model/ComponentDiagram.gmfgen
index 28f5829025d..28bb0764afb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/model/ComponentDiagram.gmfgen
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/model/ComponentDiagram.gmfgen
@@ -84,6 +84,10 @@
editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy"/>
<behaviour
xsi:type="gmfgen:CustomBehaviour"
+ key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy.SHOW_HIDE_LABEL_ROLE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
key="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY"
editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.MaskManagedNodeEditPolicy"/>
<modelFacet>
@@ -118,12 +122,12 @@
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<viewmap
xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel">
+ figureQualifiedClassName="org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel">
<attributes
xsi:type="gmfgen:LabelOffsetAttributes"
x="25"
y="3"/>
- </viewmap>
+ </viewmap>
<behaviour
xsi:type="gmfgen:CustomBehaviour"
key="org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL"
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src-gen/org/eclipse/papyrus/uml/diagram/component/edit/parts/PortEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src-gen/org/eclipse/papyrus/uml/diagram/component/edit/parts/PortEditPart.java
index 16a6c85e5c8..9ef953dc153 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src-gen/org/eclipse/papyrus/uml/diagram/component/edit/parts/PortEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src-gen/org/eclipse/papyrus/uml/diagram/component/edit/parts/PortEditPart.java
@@ -44,6 +44,7 @@ import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedBorderNamedElemen
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.MaskManagedNodeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator;
import org.eclipse.papyrus.uml.diagram.component.custom.edit.policies.CustomDiagramDragDropEditPolicy;
import org.eclipse.papyrus.uml.diagram.component.custom.edit.policies.PortLayoutEditPolicy;
@@ -93,6 +94,7 @@ public class PortEditPart extends RoundedBorderNamedElementEditPart {
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeIconlDisplayEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new PortLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
+ installEditPolicy(ShowHideLabelEditPolicy.SHOW_HIDE_LABEL_ROLE, new ShowHideLabelEditPolicy());
installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new MaskManagedNodeEditPolicy());
// XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen
index 78e21bf1021..93225f078fc 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen
@@ -163,6 +163,10 @@
editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies.CustomDiagramDragDropEditPolicy"/>
<behaviour
xsi:type="gmfgen:CustomBehaviour"
+ key="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy.SHOW_HIDE_LABEL_ROLE"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
key="org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies.BehaviorPortEditPolicy.BEHAVIOR_PORT"
editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies.BehaviorPortEditPolicy"/>
<behaviour
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src-gen/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src-gen/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortEditPart.java
index 852452cc02e..e5351d7de6e 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src-gen/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src-gen/org/eclipse/papyrus/uml/diagram/composite/edit/parts/PortEditPart.java
@@ -45,6 +45,7 @@ import org.eclipse.papyrus.uml.diagram.common.editparts.RoundedBorderNamedElemen
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.MaskManagedNodeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator;
import org.eclipse.papyrus.uml.diagram.common.locator.RoundedRectangleLabelPositionLocator;
import org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies.BehaviorPortEditPolicy;
@@ -96,6 +97,7 @@ public class PortEditPart extends RoundedBorderNamedElementEditPart {
installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeIconlDisplayEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new PortLayoutEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
+ installEditPolicy(ShowHideLabelEditPolicy.SHOW_HIDE_LABEL_ROLE, new ShowHideLabelEditPolicy());
installEditPolicy(BehaviorPortEditPolicy.BEHAVIOR_PORT, new BehaviorPortEditPolicy());
installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new MaskManagedNodeEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new GetChildLayoutEditPolicy());
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
index 33843ee2b33..f5322b31ed9 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/plugin.xml
@@ -680,7 +680,7 @@
commandId="org.eclipse.papyrus.uml.diagram.menu.commands.link.label.show.all"
icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui.actions/icons/elcl16/showconnector.gif"
id="org.eclipse.papyrus.menu.showhide.toolbar.all.connector.label"
- label="&amp;All Connector Labels"
+ label="Show All Labels"
style="push"
tooltip="Display all labels on the selected connectors">
</command>
@@ -688,7 +688,7 @@
commandId="org.eclipse.papyrus.uml.diagram.menu.commands.link.label.hide.all"
icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui.actions/icons/elcl16/hideconnector.gif"
id="org.eclipse.papyrus.menu.showhide.toolbar.no.connector.label"
- label="N&amp;o Connector Labels"
+ label="Hide All Labels"
style="push"
tooltip="Hide all labels on the selected Connections">
</command>
@@ -696,7 +696,7 @@
commandId="org.eclipse.papyrus.uml.diagram.menu.commands.link.label.manager"
icon="icons/manage_connector_label.gif"
id="org.eclipse.papyrus.menu.showhide.toolbar.manage.connector.label"
- label="&amp;Manage Connector Labels"
+ label="Show/Hide Labels"
style="push"
tooltip="Manage the labels to display for the selected connections">
</command>
@@ -1405,7 +1405,7 @@
commandId="org.eclipse.papyrus.uml.diagram.menu.commands.link.label.show.all"
icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui.actions/icons/elcl16/showconnector.gif"
id="org.eclipse.papyrus.uml.diagram.ui.menu.filtersMenu.all.connector.label"
- label="&amp;All Connector Labels"
+ label="Show All Labels"
style="push"
tooltip="Display all labels on the selected connectors">
</command>
@@ -1413,7 +1413,7 @@
commandId="org.eclipse.papyrus.uml.diagram.menu.commands.link.label.hide.all"
icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui.actions/icons/elcl16/hideconnector.gif"
id="org.eclipse.papyrus.uml.diagram.ui.menu.filtersMenu.no.connector.label"
- label="N&amp;o Connector Labels"
+ label="Hide All Labels"
style="push"
tooltip="Hide all labels on the selected Connections">
</command>
@@ -1421,7 +1421,7 @@
commandId="org.eclipse.papyrus.uml.diagram.menu.commands.link.label.manager"
icon="icons/manage_connector_label.gif"
id="org.eclipse.papyrus.uml.diagram.ui.menu.filtersMenu.manage.connector.label"
- label="&amp;Manage Connector Labels"
+ label="Show/Hide Labels"
style="push"
tooltip="Manage the labels to display for the selected connections">
</command>
@@ -2162,7 +2162,7 @@
commandId="org.eclipse.papyrus.uml.diagram.menu.commands.link.label.show.all"
icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui.actions/icons/elcl16/showconnector.gif"
id="org.eclipse.papyrus.uml.diagram.ui.popupmenu.filters.all.connector.label"
- label="&amp;All Connector Labels"
+ label="Show All Labels"
style="push"
tooltip="Display all labels on the selected connectors">
</command>
@@ -2170,7 +2170,7 @@
commandId="org.eclipse.papyrus.uml.diagram.menu.commands.link.label.hide.all"
icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui.actions/icons/elcl16/hideconnector.gif"
id="org.eclipse.papyrus.uml.diagram.ui.popupmenu.filters.no.connector.label"
- label="N&amp;o Connector Labels"
+ label="Hide All Labels"
style="push"
tooltip="Hide all labels on the selected Connections">
</command>
@@ -2178,7 +2178,7 @@
commandId="org.eclipse.papyrus.uml.diagram.menu.commands.link.label.manager"
icon="icons/manage_connector_label.gif"
id="org.eclipse.papyrus.uml.diagram.ui.popupmenu.filters.manage.connector.label"
- label="&amp;Manage Connector Labels"
+ label="Show/Hide Labels"
style="push"
tooltip="Manage the labels to display for the selected connections">
</command>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/ShowHideLabelsAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/ShowHideLabelsAction.java
index 2f9adc30aa1..fe489382a19 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/ShowHideLabelsAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.menu/src/org/eclipse/papyrus/uml/diagram/menu/actions/ShowHideLabelsAction.java
@@ -10,7 +10,8 @@
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
* Sebastien Gabel (Esterel Technologies) - Fix access to the diagram edit part when called outside of the diagram
- * Vincent Lorenzo (CEA LIST) - Bug 520807
+ * Vincent Lorenzo (CEA LIST) - Bug 520807, 506074
+ * Benoit Maggi (CEA LIST) - Bug 506074
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.menu.actions;
@@ -22,6 +23,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.commands.Command;
@@ -64,6 +66,7 @@ import org.eclipse.papyrus.uml.diagram.menu.messages.Messages;
* </ul>
*
*/
+@SuppressWarnings("restriction")
public class ShowHideLabelsAction extends AbstractGraphicalParametricAction {
/**
@@ -162,8 +165,9 @@ public class ShowHideLabelsAction extends AbstractGraphicalParametricAction {
* Returns the selected connections for the actions
*
* @return
- * the selected connections for the actions
+ * the selected connections for the actions
*/
+ @SuppressWarnings("unchecked")
protected List<ConnectionEditPart> getConnections() {
List<ConnectionEditPart> connections = new ArrayList<ConnectionEditPart>();
for (IGraphicalEditPart current : getSelection()) {
@@ -266,7 +270,7 @@ public class ShowHideLabelsAction extends AbstractGraphicalParametricAction {
* Returns the command for this action
*
* @return
- * the command for this action
+ * the command for this action
*/
protected Command getActionCommand() {
CompoundCommand cmd = new CompoundCommand("Manage Conection Labels "); //$NON-NLS-1$
@@ -300,14 +304,16 @@ public class ShowHideLabelsAction extends AbstractGraphicalParametricAction {
// do nothing
} else {
ShowHideLabelsRequest request = new ShowHideLabelsRequest(newStatus, view);
- // EditPart ep = DiagramEditPartsUtil.getEditPartFromView(view, getConnections().get(0));
- EditPart ep = DiagramEditPartsUtil.getEditPartFromView(view, getSelection().get(0));
-
- // EditPart ep = DiagramEditPartsUtil.getEditPartFromView(view, diagramEP);
- // Command command = ep.getParent().getCommand(request);
- Command command = ep.getParent().getCommand(request);
- if (command != null) {
- cmd.add(command);
+ EObject parentView = view.eContainer();
+ EditPart parentEditPart = null;
+ if (parentView instanceof View && ((View)parentView).getElement()==view.getElement()) {
+ parentEditPart = DiagramEditPartsUtil.getEditPartFromView((View) parentView, getSelection().get(0));
+ }
+ if (null != parentEditPart) {
+ Command command = parentEditPart.getCommand(request);
+ if (command != null) {
+ cmd.add(command);
+ }
}
}
}
@@ -321,7 +327,7 @@ public class ShowHideLabelsAction extends AbstractGraphicalParametricAction {
* Returns the initial selection
*
* @return
- * the initial selection : the view that are currently displayed
+ * the initial selection : the view that are currently displayed
*/
public List<View> getInitialSelection() {
List<View> selection = new ArrayList<View>();

Back to the top