Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratischenko2015-10-23 10:18:29 -0400
committerGerrit Code Review @ Eclipse.org2015-10-27 06:25:21 -0400
commit308666baced83ced2447c2cdf7cce54b6b7192e3 (patch)
tree5a596788fb47e8fd665c401de718a339e84cf917 /plugins
parentaffc638f030129e887837f8594f43a5edb540807 (diff)
downloadorg.eclipse.papyrus-308666baced83ced2447c2cdf7cce54b6b7192e3.tar.gz
org.eclipse.papyrus-308666baced83ced2447c2cdf7cce54b6b7192e3.tar.xz
org.eclipse.papyrus-308666baced83ced2447c2cdf7cce54b6b7192e3.zip
Bug 478772 - There should be no @generated NOT code
move out @generated NOT code from - CentralBefferNodeSelectionEditPart - DataStoreSelectionEditPart - DecisionInputEditPart Change-Id: I635518b1855c423e89ff486d3893a8b5f8234311 Signed-off-by: atischenko <tischenko@montages.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomCentralBufferNodeSelectionEditPart.java141
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomDataStoreSelectionEditPart.java168
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomDecisionInputEditPart.java199
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomUMLEditPartFactory.java9
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/LinkAndCornerBentWithTextFigure.java122
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/plugin.xml168
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CentralBufferNodeSelectionEditPart.java284
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DataStoreSelectionEditPart.java280
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DecisionInputEditPart.java305
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/UMLEditPartFactory.java3
11 files changed, 1001 insertions, 693 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomCentralBufferNodeSelectionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomCentralBufferNodeSelectionEditPart.java
new file mode 100644
index 00000000000..d315fc48c4f
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomCentralBufferNodeSelectionEditPart.java
@@ -0,0 +1,141 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.activity.edit.part;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.Request;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.CentralBufferNodeSelectionEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.figures.LinkAndCornerBentWithTextFigure;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.ObjectNode;
+
+
+public class CustomCentralBufferNodeSelectionEditPart extends CentralBufferNodeSelectionEditPart {
+
+ public CustomCentralBufferNodeSelectionEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected void performDirectEdit() {
+ // do not edit label if hidden
+ if (isSetSelection()) {
+ super.performDirectEdit();
+ }
+ }
+
+ @Override
+ protected void performDirectEdit(Point eventLocation) {
+ // do not edit label if hidden
+ if (isSetSelection()) {
+ super.performDirectEdit(eventLocation);
+ }
+ }
+
+ @Override
+ protected void performDirectEdit(char initialCharacter) {
+ // do not edit label if hidden
+ if (isSetSelection()) {
+ super.performDirectEdit(initialCharacter);;
+ } else {
+ super.performDirectEdit();
+ }
+ }
+
+ protected String getLabelText() {
+ // do not edit label if hidden
+ if (isSetSelection()) {
+ return super.getLabelText();
+ }
+ return "";
+ }
+
+ private boolean isSetSelection() {
+ return ((ObjectNode) resolveSemanticElement()).getSelection() != null;
+ }
+
+ @Override
+ protected String getLabelTextHelper(IFigure figure) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getText();
+ }
+ return super.getLabelTextHelper(figure);
+ }
+
+ @Override
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setText(text);
+ } else {
+ super.setLabelTextHelper(figure, text);
+ }
+ }
+
+ @Override
+ protected Image getLabelIconHelper(IFigure figure) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getIcon();
+ }
+ return super.getLabelIcon();
+ }
+
+ @Override
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setIcon(icon);
+ } else {
+ super.setLabelIconHelper(figure, icon);
+ }
+ }
+
+ @Override
+ protected void setVisibility(boolean vis) {
+ EObject element = resolveSemanticElement();
+ if (element instanceof ObjectNode) {
+ Behavior selection = ((ObjectNode) element).getSelection();
+ if (selection == null) {
+ vis = false;
+ }
+ }
+ super.setVisibility(vis);
+ }
+
+ @Override
+ public String getEditText() {
+ // do not edit label if hidden
+ if (!isSetSelection()) {
+ return ""; //$NON-NLS-1$
+ }
+ return super.getEditText();
+ }
+
+ @Override
+ protected void performDirectEditRequest(Request request) {
+ // do not edit label if hidden
+ if (isSetSelection()) {
+ return;
+ }
+ super.performDirectEditRequest(request);
+ }
+
+ @Override
+ protected void refreshLabel() {
+ super.refreshLabel();
+ refreshVisibility();
+ }
+} \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomDataStoreSelectionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomDataStoreSelectionEditPart.java
new file mode 100644
index 00000000000..90fdc7e4b03
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomDataStoreSelectionEditPart.java
@@ -0,0 +1,168 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.activity.edit.part;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.Request;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.DataStoreSelectionEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.figures.LinkAndCornerBentWithTextFigure;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.ObjectNode;
+
+
+public class CustomDataStoreSelectionEditPart extends DataStoreSelectionEditPart {
+
+ public CustomDataStoreSelectionEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * handle LinkAndCornerBentWithTextFigure
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getText();
+ }
+ return super.getLabelTextHelper(figure);
+ }
+
+ /**
+ * handle LinkAndCornerBentWithTextFigure
+ */
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setText(text);
+ } else {
+ super.setLabelTextHelper(figure, text);
+ }
+ }
+
+ /**
+ * handle LinkAndCornerBentWithTextFigure
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getIcon();
+ }
+ return getLabelIconHelper(figure);
+ }
+
+ /**
+ * handle LinkAndCornerBentWithTextFigure
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setIcon(icon);
+ } else {
+ setLabelIconHelper(figure, icon);
+ }
+ }
+
+ /**
+ * do not edit label if hidden
+ */
+ protected String getLabelText() {
+ if (isSelectionSet()) {
+ return super.getLabelText();
+ }
+ return "";
+ }
+
+ private boolean isSelectionSet() {
+ return ((ObjectNode) resolveSemanticElement()).getSelection() != null;
+ }
+
+ /**
+ * do not edit label if hidden
+ */
+ @Override
+ public String getEditText() {
+ if (!isSelectionSet()) {
+ return ""; //$NON-NLS-1$
+ }
+ return super.getEditText();
+ }
+
+ /**
+ * do not edit label if hidden
+ */
+ protected void performDirectEdit() {
+ if (isSelectionSet()) {
+ super.performDirectEdit();
+ }
+ }
+
+ /**
+ * do not edit label if hidden
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if (isSelectionSet()) {
+ super.performDirectEdit(eventLocation);
+ }
+ }
+
+ /**
+ * do not edit label if hidden
+ */
+ protected void performDirectEdit(char initialCharacter) {
+ if (isSelectionSet()) {
+ super.performDirectEdit(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * do not edit label if hidden
+ */
+ @Override
+ protected void performDirectEditRequest(Request request) {
+ if (!isSelectionSet()) {
+ return;
+ }
+ super.performDirectEditRequest(request);
+ }
+
+ /**
+ * sets the visibility of this edit part
+ *
+ * @param vis
+ * the new value of the visibility
+ */
+ @Override
+ protected void setVisibility(boolean vis) {
+ EObject element = resolveSemanticElement();
+ if (element instanceof ObjectNode) {
+ Behavior selection = ((ObjectNode) element).getSelection();
+ if (selection == null) {
+ vis = false;
+ }
+ }
+ super.setVisibility(vis);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.activity.edit.parts.DataStoreSelectionEditPart#refreshLabel()
+ * refresh the visibility in case the selection assignment changed -- refreshLabel
+ */
+ @Override
+ protected void refreshLabel() {
+ super.refreshLabel();
+ refreshVisibility();
+ }
+} \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomDecisionInputEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomDecisionInputEditPart.java
new file mode 100644
index 00000000000..1501affb5e9
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomDecisionInputEditPart.java
@@ -0,0 +1,199 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.activity.edit.part;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.tooling.runtime.directedit.locator.TextCellEditorLocator;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.DecisionInputEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.figures.LinkAndCornerBentWithTextFigure;
+import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.DecisionNode;
+
+
+public class CustomDecisionInputEditPart extends DecisionInputEditPart {
+
+ private DirectEditManager manager;
+
+ public CustomDecisionInputEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * handle LinkAndCornerBentWithTextFigure
+ */
+ @Override
+ protected String getLabelTextHelper(IFigure figure) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getText();
+ }
+ return super.getLabelTextHelper(figure);
+ }
+
+ /**
+ * handle LinkAndCornerBentWithTextFigure
+ */
+ @Override
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setText(text);
+ } else {
+ super.setLabelTextHelper(figure, text);
+ }
+ }
+
+ /**
+ * handle LinkAndCornerBentWithTextFigure
+ */
+ @Override
+ protected Image getLabelIconHelper(IFigure figure) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getIcon();
+ }
+ return getLabelIconHelper(figure);
+ }
+
+ /**
+ * handle LinkAndCornerBentWithTextFigure
+ */
+ @Override
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if (figure instanceof LinkAndCornerBentWithTextFigure) {
+ ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setIcon(icon);
+ } else {
+ super.setLabelIconHelper(figure, icon);
+ }
+ }
+
+ /**
+ * do not edit label if hidden
+ */
+ @Override
+ protected String getLabelText() {
+ if (isDecisionInputSet()) {
+ return super.getLabelText();
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * do not edit label if hidden
+ */
+ @Override
+ public String getEditText() {
+ if (!isDecisionInputSet()) {
+ return ""; //$NON-NLS-1$
+ }
+ return super.getEditText();
+ }
+
+ /**
+ * @generated do not edit label if hidden
+ */
+ @Override
+ protected void performDirectEdit() {
+ if (isDecisionInputSet()) {
+ getManager().show();
+ }
+ }
+
+ /**
+ * @generated do not edit label if hidden
+ */
+ @Override
+ protected void performDirectEdit(Point eventLocation) {
+ if (isDecisionInputSet()) {
+ super.performDirectEdit(eventLocation);
+ }
+ }
+
+ /**
+ * @generated do not edit label if hidden
+ */
+ @Override
+ protected void performDirectEdit(char initialCharacter) {
+ if (isDecisionInputSet()) {
+ super.performDirectEdit(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * do not edit label if hidden
+ */
+ @Override
+ protected void performDirectEditRequest(Request request) {
+ if (!isDecisionInputSet()) {
+ return;
+ }
+ super.performDirectEditRequest(request);
+ }
+
+ private boolean isDecisionInputSet() {
+ return ((DecisionNode) resolveSemanticElement()).getDecisionInput() != null;
+ }
+
+ /**
+ * sets the visibility of this edit part
+ *
+ * @param vis
+ * the new value of the visibility
+ */
+ @Override
+ protected void setVisibility(boolean vis) {
+ EObject element = resolveSemanticElement();
+ if (element instanceof DecisionNode) {
+ Behavior decisionInput = ((DecisionNode) element).getDecisionInput();
+ if (decisionInput == null) {
+ vis = false;
+ }
+ }
+ super.setVisibility(vis);
+ }
+
+ /**
+ * visibility should be refreshed with label
+ */
+ @Override
+ protected void refreshLabel() {
+ refreshVisibility();
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.activity.edit.parts.DecisionInputEditPart#getManager()
+ * Use custom locator
+ */
+ @Override
+ protected DirectEditManager getManager() {
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ new TextCellEditorLocator(((LinkAndCornerBentWithTextFigure) this.getFigure()).getCornerBentContent()))
+ );
+ }
+ return manager;
+ }
+
+ @Override
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+} \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomUMLEditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomUMLEditPartFactory.java
index 682cb09e659..1d3a08696eb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomUMLEditPartFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/edit/part/CustomUMLEditPartFactory.java
@@ -41,12 +41,15 @@ import org.eclipse.papyrus.uml.diagram.activity.edit.parts.BroadcastSignalAction
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.CallBehaviorActionEditPart;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.CallOperationActionEditPart;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.CentralBufferNodeEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.CentralBufferNodeSelectionEditPart;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ConditionalNodeEditPart;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ConditionalNodeStructuredActivityNodeContentCompartmentEditPart;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ControlFlowEditPart;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ControlFlowInterruptibleIconEditPart;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.CreateObjectActionEditPart;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.DataStoreNodeEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.DataStoreSelectionEditPart;
+import org.eclipse.papyrus.uml.diagram.activity.edit.parts.DecisionInputEditPart;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.DecisionNodeEditPart;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.DestroyObjectActionEditPart;
import org.eclipse.papyrus.uml.diagram.activity.edit.parts.ExceptionHandlerIconEditPart;
@@ -215,8 +218,12 @@ public class CustomUMLEditPartFactory extends UMLEditPartFactory {
return new CustomValueSpecificationActionEditPart(view);
case CentralBufferNodeEditPart.VISUAL_ID:
return new CustomCentralBufferNodeEditPart(view);
+ case CentralBufferNodeSelectionEditPart.VISUAL_ID:
+ return new CustomCentralBufferNodeSelectionEditPart(view);
case DataStoreNodeEditPart.VISUAL_ID:
return new CustomDataStoreNodeEditPart(view);
+ case DataStoreSelectionEditPart.VISUAL_ID:
+ return new CustomDataStoreSelectionEditPart(view);
case ActivityParameterNodeEditPart.VISUAL_ID:
return new CustomActivityParameterNodeEditPart(view);
case ActivityEditPart.VISUAL_ID:
@@ -229,6 +236,8 @@ public class CustomUMLEditPartFactory extends UMLEditPartFactory {
return new CustomActivityFinalNodeEditPart(view);
case DecisionNodeEditPart.VISUAL_ID:
return new CustomDecisionNodeEditPart(view);
+ case DecisionInputEditPart.VISUAL_ID:
+ return new CustomDecisionInputEditPart(view);
case InitialNodeEditPart.VISUAL_ID:
return new CustomInitialNodeEditPart(view);
case FlowFinalNodeEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/LinkAndCornerBentWithTextFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/LinkAndCornerBentWithTextFigure.java
new file mode 100644
index 00000000000..bbe29db3afb
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/LinkAndCornerBentWithTextFigure.java
@@ -0,0 +1,122 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.activity.figures;
+
+import org.eclipse.draw2d.FigureListener;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PolylineShape;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.papyrus.uml.diagram.activity.edit.policies.BehaviorPropertyNodeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.activity.locator.LinkedBehaviorLocator;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.CornerBentFigure;
+import org.eclipse.swt.graphics.Color;
+
+
+public class LinkAndCornerBentWithTextFigure extends CornerBentFigure {
+
+ private static final Color THIS_BACK = new Color(null, 248, 249, 214);
+
+ private WrappedLabel fCornerBentContent;
+
+ private PolylineShape fLinkToBehaviorProperty;
+
+ public LinkAndCornerBentWithTextFigure() {
+
+
+ this.setBackgroundColor(THIS_BACK);
+ createContents();
+ }
+
+ private void createContents() {
+ fCornerBentContent = new WrappedLabel();
+ this.add(fCornerBentContent);
+ fLinkToBehaviorProperty = new PolylineShape();
+ fLinkToBehaviorProperty.setLineWidth(1);
+ fLinkToBehaviorProperty.setLineStyle(Graphics.LINE_DASH);
+ this.add(fLinkToBehaviorProperty);
+ // do not add link in this figure but refresh it when figure moves
+ addFigureListener(new FigureListener() {
+
+ @Override
+ public void figureMoved(IFigure source) {
+ refreshLinkToBehaviorProperty();
+ }
+ });
+ }
+
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = this.getParent();
+ if (parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(this);
+ return (IBorderItemLocator) constraint;
+ }
+ return null;
+ }
+
+ /**
+ * Refresh the link between parent figure and this one
+ */
+ private void refreshLinkToBehaviorProperty() {
+ if (getLinkToBehaviorProperty().getParent() == null) {
+ // add in appropriate figure
+ getParent().add(getLinkToBehaviorProperty());
+ }
+ if (false == getBorderItemLocator() instanceof LinkedBehaviorLocator) {
+ return;
+ }
+ if (getParent() != null && getParent().getParent() instanceof BorderedNodeFigure) {
+ BorderedNodeFigure gParent = (BorderedNodeFigure) getParent().getParent();
+ Rectangle parentBounds = gParent.getHandleBounds().getCopy();
+ Point parentCenter = parentBounds.getCenter();
+ IFigure rect = gParent.getMainFigure();
+ LinkedBehaviorLocator linkedBehaviorLocator = (LinkedBehaviorLocator) getBorderItemLocator();
+ Rectangle currentBounds = linkedBehaviorLocator.getCorrectItemLocation(this);
+ Point end = BehaviorPropertyNodeEditPolicy.getAppropriateBorderPoint(parentCenter, currentBounds);
+ PointList polygonalBounds = new PointList(4);
+ polygonalBounds.addPoint(rect.getBounds().getTopLeft());
+ polygonalBounds.addPoint(rect.getBounds().getTopRight());
+ polygonalBounds.addPoint(rect.getBounds().getBottomRight());
+ polygonalBounds.addPoint(rect.getBounds().getBottomLeft());
+ Point start = BehaviorPropertyNodeEditPolicy.getIntersectionPoint(polygonalBounds, parentCenter, end);
+ if (start == null) {
+ // in case start computation fails
+ start = parentCenter;
+ }
+ // adapt ends to bounds
+ Rectangle linkBounds = new Rectangle(start, end);
+ getLinkToBehaviorProperty().setStart(start.translate(linkBounds.getLocation().getNegated()));
+ getLinkToBehaviorProperty().setEnd(end.translate(linkBounds.getLocation().getNegated()));
+ getLinkToBehaviorProperty().setBounds(linkBounds);
+ }
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ getLinkToBehaviorProperty().setVisible(visible);
+ }
+
+ public WrappedLabel getCornerBentContent() {
+ return fCornerBentContent;
+ }
+
+ public PolylineShape getLinkToBehaviorProperty() {
+ return fLinkToBehaviorProperty;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen
index fa18229f22d..77dc5d544d6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen
@@ -4341,9 +4341,8 @@
<diagramRunTimeClass
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="LinkAndCornerBentWithTextFigure"
- classBody="&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class LinkAndCornerBentWithTextFigure extends org.eclipse.papyrus.uml.diagram.common.figure.node.CornerBentFigure {&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel fCornerBentContent; &#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.PolylineShape fLinkToBehaviorProperty; &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public LinkAndCornerBentWithTextFigure() {&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;this.setBackgroundColor(THIS_BACK&#xD;&#xA;);&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;fCornerBentContent = new org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;this.add(fCornerBentContent);&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;fLinkToBehaviorProperty = new org.eclipse.draw2d.PolylineShape();&#xD;&#xA;fLinkToBehaviorProperty.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xD;&#xA;&#xD;&#xA;this.add(fLinkToBehaviorProperty);&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel getCornerBentContent() {&#xD;&#xA;&#x9;&#x9;return fCornerBentContent;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.PolylineShape getLinkToBehaviorProperty() {&#xD;&#xA;&#x9;&#x9;return fLinkToBehaviorProperty;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;static final org.eclipse.swt.graphics.Color THIS_BACK = new org.eclipse.swt.graphics.Color(null, 248, 249, 214);&#xD;&#xA;&#xD;&#xA;"/>
+ xsi:type="gmfgen:FigureViewmap"
+ figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.LinkAndCornerBentWithTextFigure"/>
<behaviour
xsi:type="gmfgen:CustomBehaviour"
key="org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE"
@@ -4734,9 +4733,8 @@
<diagramRunTimeClass
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="LinkAndCornerBentWithTextFigure"
- classBody="&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class LinkAndCornerBentWithTextFigure extends org.eclipse.papyrus.uml.diagram.common.figure.node.CornerBentFigure {&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel fCornerBentContent; &#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.PolylineShape fLinkToBehaviorProperty; &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public LinkAndCornerBentWithTextFigure() {&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;this.setBackgroundColor(THIS_BACK&#xD;&#xA;);&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;fCornerBentContent = new org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;this.add(fCornerBentContent);&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;fLinkToBehaviorProperty = new org.eclipse.draw2d.PolylineShape();&#xD;&#xA;fLinkToBehaviorProperty.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xD;&#xA;&#xD;&#xA;this.add(fLinkToBehaviorProperty);&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel getCornerBentContent() {&#xD;&#xA;&#x9;&#x9;return fCornerBentContent;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.PolylineShape getLinkToBehaviorProperty() {&#xD;&#xA;&#x9;&#x9;return fLinkToBehaviorProperty;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;static final org.eclipse.swt.graphics.Color THIS_BACK = new org.eclipse.swt.graphics.Color(null, 248, 249, 214);&#xD;&#xA;&#xD;&#xA;"/>
+ xsi:type="gmfgen:FigureViewmap"
+ figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.LinkAndCornerBentWithTextFigure"/>
<behaviour
xsi:type="gmfgen:CustomBehaviour"
key="org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE"
@@ -12224,9 +12222,8 @@
<diagramRunTimeClass
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="LinkAndCornerBentWithTextFigure"
- classBody="&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class LinkAndCornerBentWithTextFigure extends org.eclipse.papyrus.uml.diagram.common.figure.node.CornerBentFigure {&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel fCornerBentContent; &#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.PolylineShape fLinkToBehaviorProperty; &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public LinkAndCornerBentWithTextFigure() {&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;this.setBackgroundColor(THIS_BACK&#xD;&#xA;);&#xD;&#xA;&#x9;&#x9;createContents();&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private void createContents(){&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;fCornerBentContent = new org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;this.add(fCornerBentContent);&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;fLinkToBehaviorProperty = new org.eclipse.draw2d.PolylineShape();&#xD;&#xA;fLinkToBehaviorProperty.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);&#xD;&#xA;&#xD;&#xA;this.add(fLinkToBehaviorProperty);&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel getCornerBentContent() {&#xD;&#xA;&#x9;&#x9;return fCornerBentContent;&#xD;&#xA;&#x9;}&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.PolylineShape getLinkToBehaviorProperty() {&#xD;&#xA;&#x9;&#x9;return fLinkToBehaviorProperty;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;}&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;static final org.eclipse.swt.graphics.Color THIS_BACK = new org.eclipse.swt.graphics.Color(null, 248, 249, 214);&#xD;&#xA;&#xD;&#xA;"/>
+ xsi:type="gmfgen:FigureViewmap"
+ figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.activity.figures.LinkAndCornerBentWithTextFigure"/>
<modelFacet
parser="/0/@labelParsers/@implementations.21"/>
</labels>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/plugin.xml
index fc2634ab56b..c224d608779 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/plugin.xml
@@ -3000,42 +3000,130 @@ self.structuralFeature.oclAsType(Property).opposite.type = self.object.type]]>
type="6034">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5080">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6033">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5081">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6035">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5082">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6028">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5083">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5084">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5085">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5086">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6029">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5087">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5088">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5089">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5090">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6020">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5091">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5092">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5093">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5094">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5095">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5096">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5097">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6036">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5098">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6037">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5099">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6038">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5100">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6039">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5101">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6031">
</mapping>
@@ -3044,18 +3132,78 @@ self.structuralFeature.oclAsType(Property).opposite.type = self.object.type]]>
type="6027">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5102">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5103">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5104">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5105">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5106">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5107">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6032">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5108">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5109">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5110">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5111">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5112">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5113">
+ </mapping>
+ <mapping
+ humanReadableType="Stereotype"
+ type="5115">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6040">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5114">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6026">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5125">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6016">
</mapping>
@@ -3064,14 +3212,30 @@ self.structuralFeature.oclAsType(Property).opposite.type = self.object.type]]>
type="6025">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5145">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6024">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5147">
+ </mapping>
+ <mapping
+ humanReadableType="Name"
+ type="5129">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6023">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5150">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6019">
</mapping>
@@ -3084,6 +3248,10 @@ self.structuralFeature.oclAsType(Property).opposite.type = self.object.type]]>
type="6021">
</mapping>
<mapping
+ humanReadableType="Stereotype"
+ type="5165">
+ </mapping>
+ <mapping
humanReadableType="Floating Label"
type="6018">
</mapping>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CentralBufferNodeSelectionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CentralBufferNodeSelectionEditPart.java
index d599f76d32b..7684870171c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CentralBufferNodeSelectionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/CentralBufferNodeSelectionEditPart.java
@@ -3,13 +3,9 @@ package org.eclipse.papyrus.uml.diagram.activity.edit.parts;
import java.util.Collections;
import java.util.List;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.PolylineShape;
import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
@@ -28,7 +24,6 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
@@ -57,16 +52,13 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.edit.policies.BehaviorPropertyNodeEditPolicy;
import org.eclipse.papyrus.uml.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel;
-import org.eclipse.papyrus.uml.diagram.activity.locator.LinkedBehaviorLocator;
+import org.eclipse.papyrus.uml.diagram.activity.figures.LinkAndCornerBentWithTextFigure;
import org.eclipse.papyrus.uml.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.uml.diagram.activity.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.activity.providers.UMLParserProvider;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.CornerBentFigure;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleEvent;
@@ -76,9 +68,7 @@ import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Behavior;
import org.eclipse.uml2.uml.Feature;
-import org.eclipse.uml2.uml.ObjectNode;
/**
* @generated
@@ -175,60 +165,52 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
} else if (figure instanceof ILabelFigure) {
return ((ILabelFigure) figure).getText();
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getText();
} else {
return ((Label) figure).getText();
}
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
} else if (figure instanceof ILabelFigure) {
((ILabelFigure) figure).setText(text);
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setText(text);
} else {
((Label) figure).setText(text);
}
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
} else if (figure instanceof ILabelFigure) {
return ((ILabelFigure) figure).getIcon();
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getIcon();
} else {
return ((Label) figure).getIcon();
}
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
} else if (figure instanceof ILabelFigure) {
((ILabelFigure) figure).setIcon(icon);
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setIcon(icon);
} else {
((Label) figure).setIcon(icon);
}
@@ -283,24 +265,20 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected String getLabelText() {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (selectionSet) {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- } else {
- return "";
+ String text = null;
+ EObject parserElement = getParserElement();
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
}
+ if (text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
}
/**
@@ -320,16 +298,16 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
@Override
public String getEditText() {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (getParserElement() == null || getParser() == null || !selectionSet) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -422,34 +400,32 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected void performDirectEdit() {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (selectionSet) {
- getManager().show();
- }
+ BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
+
+ @Override
+ public void run() {
+ getManager().show();
+ }
+ });
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected void performDirectEdit(Point eventLocation) {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (getManager() instanceof TextDirectEditManager && selectionSet) {
+ if (getManager() instanceof TextDirectEditManager) {
((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected void performDirectEdit(char initialCharacter) {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (getManager() instanceof TextDirectEditManager && selectionSet) {
+ if (getManager() instanceof TextDirectEditManager) {
((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
@@ -457,16 +433,13 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
@Override
protected void performDirectEditRequest(Request request) {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (!selectionSet) {
- return;
- }
+
final Request theRequest = request;
+
if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
@@ -477,11 +450,19 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
if (configuration == null || configuration.getLanguage() == null) {
+ // Create default edit manager
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if (configuration instanceof IPopupEditorConfiguration) {
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
+ initializeDirectEditManager(theRequest);
+ return;
+ } else if (configuration instanceof IPopupEditorConfiguration) {
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
@@ -493,6 +474,7 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
return;
}
final Dialog finalDialog = dialog;
+
if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@@ -500,6 +482,7 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
@Override
protected void doExecute() {
configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -507,28 +490,7 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
}
break;
case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @Override
- public void run() {
- if (isActive() && isEditable()) {
- if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ initializeDirectEditManager(theRequest);
break;
default:
break;
@@ -582,14 +544,8 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
@@ -816,8 +772,7 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
}
/**
- * @generated NOT refresh the visibility in case the selection assignment
- * changed
+ * @generated
*/
@Override
protected void handleNotificationEvent(Notification event) {
@@ -829,8 +784,10 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
refreshUnderline();
} else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
- || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
+ NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
+ NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
+ NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
@@ -844,9 +801,6 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
addSemanticListeners();
}
refreshLabel();
- // refresh the visibility in case the selection assignment
- // changed
- refreshVisibility();
}
}
}
@@ -854,25 +808,6 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
}
/**
- * sets the visibility of this edit part
- *
- * @param vis
- * the new value of the visibility
- * @generated NOT
- */
- @Override
- protected void setVisibility(boolean vis) {
- EObject element = resolveSemanticElement();
- if (element instanceof ObjectNode) {
- Behavior selection = ((ObjectNode) element).getSelection();
- if (selection == null) {
- vis = false;
- }
- }
- super.setVisibility(vis);
- }
-
- /**
* @generated
*/
@Override
@@ -888,113 +823,4 @@ public class CentralBufferNodeSelectionEditPart extends PapyrusLabelEditPart imp
protected IFigure createFigurePrim() {
return new LinkAndCornerBentWithTextFigure();
}
-
- /**
- * @generated
- */
- public class LinkAndCornerBentWithTextFigure extends CornerBentFigure {
-
- /**
- * @generated
- */
- private WrappedLabel fCornerBentContent;
-
- /**
- * @generated
- */
- private PolylineShape fLinkToBehaviorProperty;
-
- /**
- * @generated
- */
- public LinkAndCornerBentWithTextFigure() {
-
-
- this.setBackgroundColor(THIS_BACK);
- createContents();
- }
-
- /**
- * @generated NOT do not add link in this figure
- */
- private void createContents() {
- fCornerBentContent = new WrappedLabel();
- this.add(fCornerBentContent);
- fLinkToBehaviorProperty = new PolylineShape();
- fLinkToBehaviorProperty.setLineStyle(Graphics.LINE_DASH);
- this.add(fLinkToBehaviorProperty);
- // do not add link in this figure but refresh it when figure moves
- addFigureListener(new FigureListener() {
-
- @Override
- public void figureMoved(IFigure source) {
- refreshLinkToBehaviorProperty();
- }
- });
- }
-
- /**
- * Refresh the link between parent figure and this one
- *
- * @generated NOT
- */
- private void refreshLinkToBehaviorProperty() {
- if (getLinkToBehaviorProperty().getParent() == null) {
- // add in appropriate figure
- getParent().add(getLinkToBehaviorProperty());
- }
- if (getParent() != null && getParent().getParent() instanceof BorderedNodeFigure) {
- BorderedNodeFigure gParent = (BorderedNodeFigure) getParent().getParent();
- Rectangle parentBounds = gParent.getHandleBounds().getCopy();
- Point parentCenter = parentBounds.getCenter();
- IFigure rect = gParent.getMainFigure();
- Rectangle currentBounds = ((LinkedBehaviorLocator) getBorderItemLocator()).getCorrectItemLocation(this);
- Point end = BehaviorPropertyNodeEditPolicy.getAppropriateBorderPoint(parentCenter, currentBounds);
- PointList polygonalBounds = new PointList(4);
- polygonalBounds.addPoint(rect.getBounds().getTopLeft());
- polygonalBounds.addPoint(rect.getBounds().getTopRight());
- polygonalBounds.addPoint(rect.getBounds().getBottomRight());
- polygonalBounds.addPoint(rect.getBounds().getBottomLeft());
- Point start = BehaviorPropertyNodeEditPolicy.getIntersectionPoint(polygonalBounds, parentCenter, end);
- if (start == null) {
- // in case start computation fails
- start = parentCenter;
- }
- // adapt ends to bounds
- Rectangle linkBounds = new Rectangle(start, end);
- getLinkToBehaviorProperty().setStart(start.translate(linkBounds.getLocation().getNegated()));
- getLinkToBehaviorProperty().setEnd(end.translate(linkBounds.getLocation().getNegated()));
- getLinkToBehaviorProperty().setBounds(linkBounds);
- }
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#setVisible(boolean)
- * @generated NOT report visibility on the link
- */
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- getLinkToBehaviorProperty().setVisible(visible);
- }
-
- /**
- * @generated
- */
- public WrappedLabel getCornerBentContent() {
- return fCornerBentContent;
- }
-
- /**
- * @generated
- */
- public PolylineShape getLinkToBehaviorProperty() {
- return fLinkToBehaviorProperty;
- }
- }
-
- /**
- * @generated
- */
- static final Color THIS_BACK = new Color(null, 248, 249, 214);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DataStoreSelectionEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DataStoreSelectionEditPart.java
index 4eb6d7100bd..d6be666d5e7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DataStoreSelectionEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DataStoreSelectionEditPart.java
@@ -16,13 +16,9 @@ package org.eclipse.papyrus.uml.diagram.activity.edit.parts;
import java.util.Collections;
import java.util.List;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.PolylineShape;
import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
@@ -41,7 +37,6 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
@@ -72,14 +67,12 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEd
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.activity.edit.policies.BehaviorPropertyNodeEditPolicy;
import org.eclipse.papyrus.uml.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel;
-import org.eclipse.papyrus.uml.diagram.activity.locator.LinkedBehaviorLocator;
+import org.eclipse.papyrus.uml.diagram.activity.figures.LinkAndCornerBentWithTextFigure;
import org.eclipse.papyrus.uml.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.uml.diagram.activity.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.activity.providers.UMLParserProvider;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.CornerBentFigure;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleEvent;
@@ -189,60 +182,52 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
} else if (figure instanceof ILabelFigure) {
return ((ILabelFigure) figure).getText();
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getText();
} else {
return ((Label) figure).getText();
}
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
} else if (figure instanceof ILabelFigure) {
((ILabelFigure) figure).setText(text);
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setText(text);
} else {
((Label) figure).setText(text);
}
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
} else if (figure instanceof ILabelFigure) {
return ((ILabelFigure) figure).getIcon();
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getIcon();
} else {
return ((Label) figure).getIcon();
}
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
} else if (figure instanceof ILabelFigure) {
((ILabelFigure) figure).setIcon(icon);
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setIcon(icon);
} else {
((Label) figure).setIcon(icon);
}
@@ -263,7 +248,6 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
* @generated
*/
@Override
- @SuppressWarnings("rawtypes")
protected List<?> getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -298,24 +282,20 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected String getLabelText() {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (selectionSet) {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- } else {
- return "";
+ String text = null;
+ EObject parserElement = getParserElement();
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
+ }
+ if (text == null || text.length() == 0) {
+ text = defaultText;
}
+ return text;
}
/**
@@ -335,16 +315,16 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
@Override
public String getEditText() {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (getParserElement() == null || getParser() == null || !selectionSet) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -437,34 +417,32 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected void performDirectEdit() {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (selectionSet) {
- getManager().show();
- }
+ BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
+
+ @Override
+ public void run() {
+ getManager().show();
+ }
+ });
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected void performDirectEdit(Point eventLocation) {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (getManager() instanceof TextDirectEditManager && selectionSet) {
+ if (getManager() instanceof TextDirectEditManager) {
((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected void performDirectEdit(char initialCharacter) {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (getManager() instanceof TextDirectEditManager && selectionSet) {
+ if (getManager() instanceof TextDirectEditManager) {
((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
@@ -472,16 +450,13 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
@Override
protected void performDirectEditRequest(Request request) {
- // do not edit label if hidden
- boolean selectionSet = ((ObjectNode) resolveSemanticElement()).getSelection() != null;
- if (!selectionSet) {
- return;
- }
+
final Request theRequest = request;
+
if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
@@ -492,11 +467,19 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
if (configuration == null || configuration.getLanguage() == null) {
+ // Create default edit manager
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if (configuration instanceof IPopupEditorConfiguration) {
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
+ initializeDirectEditManager(theRequest);
+ return;
+ } else if (configuration instanceof IPopupEditorConfiguration) {
IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
helper.showEditor();
return;
@@ -508,6 +491,7 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
return;
}
final Dialog finalDialog = dialog;
+
if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@@ -515,6 +499,7 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
@Override
protected void doExecute() {
configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -522,28 +507,7 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
}
break;
case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @Override
- public void run() {
- if (isActive() && isEditable()) {
- if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ initializeDirectEditManager(theRequest);
break;
default:
break;
@@ -589,25 +553,6 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
}
/**
- * sets the visibility of this edit part
- *
- * @param vis
- * the new value of the visibility
- * @generated NOT
- */
- @Override
- protected void setVisibility(boolean vis) {
- EObject element = resolveSemanticElement();
- if (element instanceof ObjectNode) {
- Behavior selection = ((ObjectNode) element).getSelection();
- if (selection == null) {
- vis = false;
- }
- }
- super.setVisibility(vis);
- }
-
- /**
* @generated
*/
protected void refreshLabel() {
@@ -616,14 +561,8 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
@@ -849,7 +788,7 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
}
/**
- * @generated NOT refresh the visibility in case the selection assignment changed
+ * @generated
*/
@Override
protected void handleNotificationEvent(Notification event) {
@@ -861,8 +800,10 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
refreshUnderline();
} else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
- || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
+ NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
+ NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
+ NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
@@ -876,8 +817,6 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
addSemanticListeners();
}
refreshLabel();
- // refresh the visibility in case the selection assignment changed
- refreshVisibility();
}
}
}
@@ -900,113 +839,4 @@ public class DataStoreSelectionEditPart extends PapyrusLabelEditPart implements
protected IFigure createFigurePrim() {
return new LinkAndCornerBentWithTextFigure();
}
-
- /**
- * @generated
- */
- public class LinkAndCornerBentWithTextFigure extends CornerBentFigure {
-
- /**
- * @generated
- */
- private WrappedLabel fCornerBentContent;
-
- /**
- * @generated
- */
- private PolylineShape fLinkToBehaviorProperty;
-
- /**
- * @generated
- */
- public LinkAndCornerBentWithTextFigure() {
-
-
- this.setBackgroundColor(THIS_BACK);
- createContents();
- }
-
- /**
- * @generated NOT do not add link in this figure
- */
- private void createContents() {
- fCornerBentContent = new WrappedLabel();
- this.add(fCornerBentContent);
- fLinkToBehaviorProperty = new PolylineShape();
- fLinkToBehaviorProperty.setLineWidth(1);
- fLinkToBehaviorProperty.setLineStyle(Graphics.LINE_DASH);
- // do not add link in this figure but refresh it when figure moves
- addFigureListener(new FigureListener() {
-
- @Override
- public void figureMoved(IFigure source) {
- refreshLinkToBehaviorProperty();
- }
- });
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#setVisible(boolean)
- * @generated NOT report visibility on the link
- */
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- getLinkToBehaviorProperty().setVisible(visible);
- }
-
- /**
- * Refresh the link between parent figure and this one
- *
- * @generated NOT
- */
- private void refreshLinkToBehaviorProperty() {
- if (getLinkToBehaviorProperty().getParent() == null) {
- // add in appropriate figure
- getParent().add(getLinkToBehaviorProperty());
- }
- if (getParent() != null && getParent().getParent() instanceof BorderedNodeFigure) {
- BorderedNodeFigure gParent = (BorderedNodeFigure) getParent().getParent();
- Rectangle parentBounds = gParent.getHandleBounds().getCopy();
- Point parentCenter = parentBounds.getCenter();
- IFigure rect = gParent.getMainFigure();
- Rectangle currentBounds = ((LinkedBehaviorLocator) getBorderItemLocator()).getCorrectItemLocation(this);
- Point end = BehaviorPropertyNodeEditPolicy.getAppropriateBorderPoint(parentCenter, currentBounds);
- PointList polygonalBounds = new PointList(4);
- polygonalBounds.addPoint(rect.getBounds().getTopLeft());
- polygonalBounds.addPoint(rect.getBounds().getTopRight());
- polygonalBounds.addPoint(rect.getBounds().getBottomRight());
- polygonalBounds.addPoint(rect.getBounds().getBottomLeft());
- Point start = BehaviorPropertyNodeEditPolicy.getIntersectionPoint(polygonalBounds, parentCenter, end);
- if (start == null) {
- // in case start computation fails
- start = parentCenter;
- }
- // adapt ends to bounds
- Rectangle linkBounds = new Rectangle(start, end);
- getLinkToBehaviorProperty().setStart(start.translate(linkBounds.getLocation().getNegated()));
- getLinkToBehaviorProperty().setEnd(end.translate(linkBounds.getLocation().getNegated()));
- getLinkToBehaviorProperty().setBounds(linkBounds);
- }
- }
-
- /**
- * @generated
- */
- public WrappedLabel getCornerBentContent() {
- return fCornerBentContent;
- }
-
- /**
- * @generated
- */
- public PolylineShape getLinkToBehaviorProperty() {
- return fLinkToBehaviorProperty;
- }
- }
-
- /**
- * @generated
- */
- static final Color THIS_BACK = new Color(null, 248, 249, 214);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DecisionInputEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DecisionInputEditPart.java
index 9c2eee2f9ea..1ca7a096cb6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DecisionInputEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/DecisionInputEditPart.java
@@ -16,11 +16,8 @@ package org.eclipse.papyrus.uml.diagram.activity.edit.parts;
import java.util.Collections;
import java.util.List;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.PolylineShape;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.common.notify.Notification;
@@ -40,7 +37,6 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
@@ -69,17 +65,14 @@ import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.ExternalLabelPrimaryDragRoleEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SVGNodePlateFigure;
import org.eclipse.papyrus.uml.diagram.activity.edit.policies.BehaviorPropertyNodeEditPolicy;
import org.eclipse.papyrus.uml.diagram.activity.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.figures.WrappedLabel;
-import org.eclipse.papyrus.uml.diagram.activity.locator.LinkedBehaviorLocator;
+import org.eclipse.papyrus.uml.diagram.activity.figures.LinkAndCornerBentWithTextFigure;
import org.eclipse.papyrus.uml.diagram.activity.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.uml.diagram.activity.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.activity.providers.UMLParserProvider;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.CornerBentFigure;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleEvent;
@@ -123,10 +116,18 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
*/
private String defaultText;
- /** direct edition mode (default, undefined, registered editor, etc.) */
+ /**
+ * direct edition mode (default, undefined, registered editor, etc.)
+ *
+ * @generated
+ */
protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
- /** configuration from a registered edit dialog */
+ /**
+ * configuration from a registered edit dialog
+ *
+ * @generated
+ */
protected IDirectEditorConfiguration configuration;
/**
@@ -181,60 +182,52 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
} else if (figure instanceof ILabelFigure) {
return ((ILabelFigure) figure).getText();
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getText();
} else {
return ((Label) figure).getText();
}
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
} else if (figure instanceof ILabelFigure) {
((ILabelFigure) figure).setText(text);
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setText(text);
} else {
((Label) figure).setText(text);
}
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
} else if (figure instanceof ILabelFigure) {
return ((ILabelFigure) figure).getIcon();
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- return ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().getIcon();
} else {
return ((Label) figure).getIcon();
}
}
/**
- * @generated NOT handle LinkAndCornerBentWithTextFigure
+ * @generated
*/
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
} else if (figure instanceof ILabelFigure) {
((ILabelFigure) figure).setIcon(icon);
- } else if (figure instanceof LinkAndCornerBentWithTextFigure) {
- ((LinkAndCornerBentWithTextFigure) figure).getCornerBentContent().setIcon(icon);
} else {
((Label) figure).setIcon(icon);
}
@@ -255,7 +248,6 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
* @generated
*/
@Override
- @SuppressWarnings("rawtypes")
protected List<?> getModelChildren() {
return Collections.EMPTY_LIST;
}
@@ -290,24 +282,20 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected String getLabelText() {
- // do not edit label if hidden
- boolean decisionSet = ((DecisionNode) resolveSemanticElement()).getDecisionInput() != null;
- if (decisionSet) {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- } else {
- return "";
+ String text = null;
+ EObject parserElement = getParserElement();
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ new EObjectAdapter(parserElement),
+ getParserOptions().intValue());
+ }
+ if (text == null || text.length() == 0) {
+ text = defaultText;
}
+ return text;
}
/**
@@ -327,16 +315,16 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
@Override
public String getEditText() {
- // do not edit label if hidden
- boolean decisionSet = ((DecisionNode) resolveSemanticElement()).getDecisionInput() != null;
- if (getParserElement() == null || getParser() == null || !decisionSet) {
+ if (getParserElement() == null || getParser() == null) {
return ""; //$NON-NLS-1$
}
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ return getParser().getEditString(
+ new EObjectAdapter(getParserElement()),
+ getParserOptions().intValue());
}
/**
@@ -429,34 +417,32 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected void performDirectEdit() {
- // do not edit label if hidden
- boolean decisionSet = ((DecisionNode) resolveSemanticElement()).getDecisionInput() != null;
- if (decisionSet) {
- getManager().show();
- }
+ BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
+
+ @Override
+ public void run() {
+ getManager().show();
+ }
+ });
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected void performDirectEdit(Point eventLocation) {
- // do not edit label if hidden
- boolean decisionSet = ((DecisionNode) resolveSemanticElement()).getDecisionInput() != null;
- if (getManager() instanceof TextDirectEditManager && decisionSet) {
+ if (getManager() instanceof TextDirectEditManager) {
((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
protected void performDirectEdit(char initialCharacter) {
- // do not edit label if hidden
- boolean decisionSet = ((DecisionNode) resolveSemanticElement()).getDecisionInput() != null;
- if (getManager() instanceof TextDirectEditManager && decisionSet) {
+ if (getManager() instanceof TextDirectEditManager) {
((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
@@ -464,16 +450,13 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
}
/**
- * @generated NOT do not edit label if hidden
+ * @generated
*/
@Override
protected void performDirectEditRequest(Request request) {
- // do not edit label if hidden
- boolean decisionSet = ((DecisionNode) resolveSemanticElement()).getDecisionInput() != null;
- if (!decisionSet) {
- return;
- }
+
final Request theRequest = request;
+
if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
@@ -484,11 +467,23 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
case IDirectEdition.EXTENDED_DIRECT_EDITOR:
updateExtendedEditorConfiguration();
if (configuration == null || configuration.getLanguage() == null) {
+ // Create default edit manager
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
performDefaultDirectEditorEdit(theRequest);
} else {
configuration.preEditAction(resolveSemanticElement());
Dialog dialog = null;
- if (configuration instanceof IAdvancedEditorConfiguration) {
+ if (configuration instanceof ICustomDirectEditorConfiguration) {
+ setManager(((ICustomDirectEditorConfiguration) configuration).createDirectEditManager(this));
+ initializeDirectEditManager(theRequest);
+ return;
+ } else if (configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration) configuration).createPopupEditorHelper(this);
+ helper.showEditor();
+ return;
+ } else if (configuration instanceof IAdvancedEditorConfiguration) {
dialog = ((IAdvancedEditorConfiguration) configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
} else if (configuration instanceof IDirectEditorConfiguration) {
dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
@@ -496,6 +491,7 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
return;
}
final Dialog finalDialog = dialog;
+
if (Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@@ -503,6 +499,7 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
@Override
protected void doExecute() {
configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
}
};
domain.getCommandStack().execute(command);
@@ -510,28 +507,7 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
}
break;
case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- @Override
- public void run() {
- if (isActive() && isEditable()) {
- if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ initializeDirectEditManager(theRequest);
break;
default:
break;
@@ -577,25 +553,6 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
}
/**
- * sets the visibility of this edit part
- *
- * @param vis
- * the new value of the visibility
- * @generated NOT
- */
- @Override
- protected void setVisibility(boolean vis) {
- EObject element = resolveSemanticElement();
- if (element instanceof DecisionNode) {
- Behavior decisionInput = ((DecisionNode) element).getDecisionInput();
- if (decisionInput == null) {
- vis = false;
- }
- }
- super.setVisibility(vis);
- }
-
- /**
* @generated
*/
protected void refreshLabel() {
@@ -604,14 +561,8 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
}
if (maskLabelPolicy == null) {
- View view = (View) getModel();
- if (view.isVisible()) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- } else {
- setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
- setLabelIconHelper(getFigure(), null);
- }
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
@@ -790,11 +741,14 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
/**
* Updates the preference configuration
+ *
+ * @generated
*/
protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if (languagePreferred != null && !languagePreferred.equals("") && languagePreferred != configuration.getLanguage()) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
+ String languagePreferred = Activator.getDefault().getPreferenceStore().getString(
+ IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("") && !languagePreferred.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
} else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
configuration = null;
}
@@ -805,6 +759,7 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
*
* @param theRequest
* the direct edit request that starts the direct edit system
+ * @generated
*/
protected void performDefaultDirectEditorEdit(final Request theRequest) {
// initialize the direct edit manager
@@ -815,7 +770,8 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
public void run() {
if (isActive() && isEditable()) {
if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ Character initialChar = (Character) theRequest.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
performDirectEdit(initialChar.charValue());
} else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
DirectEditRequest editRequest = (DirectEditRequest) theRequest;
@@ -832,7 +788,7 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
}
/**
- * @generated NOT refresh the visibility in case the decision input assignment changed
+ * @generated
*/
@Override
protected void handleNotificationEvent(Notification event) {
@@ -844,8 +800,10 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
refreshUnderline();
} else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
- || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
+ } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) ||
+ NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) ||
+ NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) ||
+ NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
refreshFont();
} else {
if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
@@ -859,8 +817,6 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
addSemanticListeners();
}
refreshLabel();
- // refresh the visibility in case the decision input assignment changed
- refreshVisibility();
}
}
}
@@ -883,109 +839,4 @@ public class DecisionInputEditPart extends PapyrusLabelEditPart implements IText
protected IFigure createFigurePrim() {
return new LinkAndCornerBentWithTextFigure();
}
-
- /**
- * @generated
- */
- public class LinkAndCornerBentWithTextFigure extends CornerBentFigure {
-
- /**
- * @generated
- */
- private WrappedLabel fCornerBentContent;
-
- /**
- * @generated
- */
- private PolylineShape fLinkToBehaviorProperty;
-
- /**
- * @generated
- */
- public LinkAndCornerBentWithTextFigure() {
-
-
- this.setBackgroundColor(THIS_BACK);
- createContents();
- }
-
- /**
- * @generated NOT do not add link in this figure
- */
- private void createContents() {
- fCornerBentContent = new WrappedLabel();
- this.add(fCornerBentContent);
- fLinkToBehaviorProperty = new PolylineShape();
- fLinkToBehaviorProperty.setLineWidth(1);
- fLinkToBehaviorProperty.setLineStyle(Graphics.LINE_DASH);
- // do not add link in this figure but refresh it when figure moves
- addFigureListener(new FigureListener() {
-
- @Override
- public void figureMoved(IFigure source) {
- refreshLinkToBehaviorProperty();
- }
- });
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#setVisible(boolean)
- * @generated NOT report visibility on the link
- */
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- getLinkToBehaviorProperty().setVisible(visible);
- }
-
- /**
- * Refresh the link between parent figure and this one
- *
- * @generated NOT
- */
- private void refreshLinkToBehaviorProperty() {
- if (getLinkToBehaviorProperty().getParent() == null) {
- // add in appropriate figure
- getParent().add(getLinkToBehaviorProperty());
- }
- if (getParent() != null && getParent().getParent() instanceof BorderedNodeFigure) {
- BorderedNodeFigure gParent = (BorderedNodeFigure) getParent().getParent();
- Rectangle parentBounds = gParent.getHandleBounds().getCopy();
- Point parentCenter = parentBounds.getCenter();
- // DiamondFigure diamond = (DiamondFigure) gParent.getMainFigure();
- SVGNodePlateFigure diamond = (SVGNodePlateFigure) gParent.getMainFigure();
- Rectangle currentBounds = ((LinkedBehaviorLocator) getBorderItemLocator()).getCorrectItemLocation(this);
- Point end = BehaviorPropertyNodeEditPolicy.getAppropriateBorderPoint(parentCenter, currentBounds);
- Point start = BehaviorPropertyNodeEditPolicy.getIntersectionPoint(diamond.getPolygonPoints(), parentCenter, end);
- if (start == null) {
- // in case start computation fails
- start = parentCenter;
- }
- // adapt ends to bounds
- Rectangle linkBounds = new Rectangle(start, end);
- getLinkToBehaviorProperty().setStart(start.translate(linkBounds.getLocation().getNegated()));
- getLinkToBehaviorProperty().setEnd(end.translate(linkBounds.getLocation().getNegated()));
- getLinkToBehaviorProperty().setBounds(linkBounds);
- }
- }
-
- /**
- * @generated
- */
- public WrappedLabel getCornerBentContent() {
- return fCornerBentContent;
- }
-
- /**
- * @generated
- */
- public PolylineShape getLinkToBehaviorProperty() {
- return fLinkToBehaviorProperty;
- }
- }
-
- /**
- * @generated
- */
- static final Color THIS_BACK = new Color(null, 248, 249, 214);
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/UMLEditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/UMLEditPartFactory.java
index d1a444301d6..78790bb6492 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/UMLEditPartFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/src/org/eclipse/papyrus/uml/diagram/activity/edit/parts/UMLEditPartFactory.java
@@ -22,7 +22,6 @@ import org.eclipse.gef.tools.CellEditorLocator;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.gmf.tooling.runtime.directedit.locator.CellEditorLocatorAccess;
import org.eclipse.gmf.tooling.runtime.directedit.locator.LabelCellEditorLocator;
import org.eclipse.gmf.tooling.runtime.directedit.locator.TextCellEditorLocator;
import org.eclipse.jface.viewers.CellEditor;
@@ -1968,8 +1967,6 @@ public class UMLEditPartFactory implements EditPartFactory {
return new MultilineCellEditorLocator((IMultilineEditableFigure) source.getFigure());
} else if (source.getFigure() instanceof WrappingLabel) {
return new TextCellEditorLocator((WrappingLabel) source.getFigure());
- } else if (source.getFigure() instanceof DecisionInputEditPart.LinkAndCornerBentWithTextFigure) {
- return new TextCellEditorLocator(((DecisionInputEditPart.LinkAndCornerBentWithTextFigure) source.getFigure()).getCornerBentContent());
} else if (source.getFigure() instanceof ObjectFlowSelectionEditPart.LinkAndCornerBentWithTextFigure) {
return new TextCellEditorLocator(((ObjectFlowSelectionEditPart.LinkAndCornerBentWithTextFigure) source.getFigure()).getCornerBentContent());
} else if (source.getFigure() instanceof ObjectFlowTransformationEditPart.LinkAndCornerBentWithTextFigure) {

Back to the top