Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Marques2015-05-27 04:06:38 -0400
committerPatrick Tessier2015-05-27 07:38:37 -0400
commitce8984c97478bee899fb3fe281745622a88cf0c4 (patch)
tree27ec1f05b491db839c325e0d9e00835b9d5fbb19
parent2ffc9e0cc0f75d63f0fa1c0260f15e7bf6a97ab2 (diff)
downloadorg.eclipse.papyrus-ce8984c97478bee899fb3fe281745622a88cf0c4.tar.gz
org.eclipse.papyrus-ce8984c97478bee899fb3fe281745622a88cf0c4.tar.xz
org.eclipse.papyrus-ce8984c97478bee899fb3fe281745622a88cf0c4.zip
Bug 463290 - Papyrus diagram shall be expanded with new visual graphical
Adding support of the Parser provider Change-Id: If611c261b50ccc3bb7b3b1673c07617c8259e924 Signed-off-by: Bruno Marques <bruno.marques@cea.fr> Reviewed-on: https://git.eclipse.org/r/48722 Tested-by: Hudson CI Reviewed-by: Patrick Tessier <Patrick.Tessier@cea.fr>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/UMLRepresentationKind.xmi2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderItemNameEditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/EditableLabelForNodeEditPart.java9
3 files changed, 15 insertions, 4 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/UMLRepresentationKind.xmi b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/UMLRepresentationKind.xmi
index d65b25989b5..09578dd05c6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/UMLRepresentationKind.xmi
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/UMLRepresentationKind.xmi
@@ -29,10 +29,12 @@
name="NameLabel for BorderItem"
viewFactory="org.eclipse.gmf.runtime.diagram.ui.view.factories.optimal.ShapeViewFactory"/>
<representationkinds
+ xmi:id="_dG-hoN0HEeSfTfTnKh2G1P"
editPartQualifiedName="org.eclipse.papyrus.uml.diagram.common.editparts.ContainerNodeEditPart"
name="Container as a Node"
viewFactory="org.eclipse.papyrus.gmf.diagram.common.factory.ShapeViewFactory"/>
<representationkinds
+ xmi:id="_dG-hoN0HEeSfTfTnKh2G1L"
editPartQualifiedName="org.eclipse.papyrus.uml.diagram.common.editparts.EditableLabelForNodeEditPart"
name="Editable Label representing the name of a Node"
viewFactory="org.eclipse.papyrus.gmf.diagram.common.factory.ShapeViewFactory"/>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderItemNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderItemNameEditPart.java
index 112f9a976e7..06b1e37970e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderItemNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderItemNameEditPart.java
@@ -32,6 +32,7 @@ import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
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;
@@ -73,6 +74,7 @@ import org.eclipse.papyrus.uml.diagram.common.editpolicies.UMLTextSelectionEditP
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure;
import org.eclipse.papyrus.uml.diagram.common.locator.MultilineCellEditorLocator;
+import org.eclipse.papyrus.uml.diagram.common.parser.DefaultParserHintAdapter;
import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser;
import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
import org.eclipse.swt.SWT;
@@ -297,8 +299,10 @@ public class BorderItemNameEditPart extends FloatingLabelEditPart implements ITe
public IParser getParser() {
if(parser == null) {
- parser = new NamedElementLabelParser();
-
+ parser =ParserService.getInstance().getParser(new DefaultParserHintAdapter(getNotationView().getDiagram(), resolveSemanticElement(), getNotationView().getType()));
+ if(parser == null) {
+ parser = new NamedElementLabelParser();
+ }
}
return parser;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/EditableLabelForNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/EditableLabelForNodeEditPart.java
index 85147591c21..46c7acf6c95 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/EditableLabelForNodeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/EditableLabelForNodeEditPart.java
@@ -32,6 +32,7 @@ import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
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;
@@ -73,6 +74,7 @@ import org.eclipse.papyrus.uml.diagram.common.editpolicies.UMLTextSelectionEditP
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure;
import org.eclipse.papyrus.uml.diagram.common.locator.MultilineCellEditorLocator;
+import org.eclipse.papyrus.uml.diagram.common.parser.DefaultParserHintAdapter;
import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser;
import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
import org.eclipse.swt.SWT;
@@ -284,9 +286,12 @@ public class EditableLabelForNodeEditPart extends PapyrusCompartmentEditPart imp
}
public IParser getParser() {
- if(parser == null) {
- parser = new NamedElementLabelParser();
+ if(parser == null) {
+ parser =ParserService.getInstance().getParser(new DefaultParserHintAdapter(getNotationView().getDiagram(), resolveSemanticElement(), getNotationView().getType()));
+ if(parser == null) {
+ parser = new NamedElementLabelParser();
+ }
}
return parser;
}

Back to the top