Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauline DEVILLE2017-08-04 09:24:40 -0400
committerJeremie Tatibouet2017-09-01 07:27:11 -0400
commite03090be3defca0e0e63ba488a7a457c25a530f4 (patch)
tree7142719f6c970449a34868f6a79c17222bf3efd0
parent48bdd38000b9f133bd6b51fe651e67c8399e164d (diff)
downloadorg.eclipse.papyrus-e03090be3defca0e0e63ba488a7a457c25a530f4.tar.gz
org.eclipse.papyrus-e03090be3defca0e0e63ba488a7a457c25a530f4.tar.xz
org.eclipse.papyrus-e03090be3defca0e0e63ba488a7a457c25a530f4.zip
Bug 365887 - [StateMachineDiagram] The deferred triggers are not
displayed into a state. -Add label for deferred trigger feature -Add parser -regenerate State Machine diagram Change-Id: Id3fc76097c25eb36b49654a1edf360c3ea8393df Signed-off-by: Pauline DEVILLE <pauline.deville@cea.fr>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/theme/umlBase.css4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/DeferrableTriggerParser.java204
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/Messages.java2
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/messages.properties1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/util/TriggerUtil.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen48
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.xml4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/DeferrableTriggerEditPart.java841
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/UMLEditPartFactory.java3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramUpdater.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLVisualIDRegistry.java8
-rwxr-xr-xplugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLElementTypes.java12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLParserProvider.java19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java19
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/canonical/TestSemantic.java11
15 files changed, 1309 insertions, 3 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/theme/umlBase.css b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/theme/umlBase.css
index 4e0ee4a1269..21bf5c2db4c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/theme/umlBase.css
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.css/theme/umlBase.css
@@ -431,6 +431,10 @@ StateMachineDiagram Pseudostate[kind="choice"]{
maintainSymbolRatio:false;
}
+StateMachineDiagram State{
+ canonical:true;
+}
+
/*---------- Composite Diagram ---------*/
CompositeStructureDiagram Property[aggregation="shared"]{
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/DeferrableTriggerParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/DeferrableTriggerParser.java
new file mode 100644
index 00000000000..6ad474d7d4d
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/DeferrableTriggerParser.java
@@ -0,0 +1,204 @@
+/*****************************************************************************
+ * Copyright (c) 2017 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:
+ * Pauline DEVILLE (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.statemachine.custom.parsers;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+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.ParserEditStatus;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.papyrus.infra.internationalization.common.utils.InternationalizationPreferencesUtils;
+import org.eclipse.papyrus.uml.diagram.statemachine.custom.util.TriggerUtil;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Trigger;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * This class define the parser for the DeferrableTrigger feature of the State
+ *
+ */
+public class DeferrableTriggerParser implements IParser, ISemanticParser {
+
+ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
+
+ private static final String SPACE_STRING = " "; //$NON-NLS-1$
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed(org.eclipse.emf.ecore.EObject)
+ *
+ * @param element
+ * @return
+ */
+ @Override
+ public List<Trigger> getSemanticElementsBeingParsed(EObject element) {
+ if (element instanceof Trigger) {
+ final Trigger trigger = ((Trigger) element);
+ return Collections.singletonList(trigger);
+ }
+ return Collections.emptyList();
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected(org.eclipse.emf.ecore.EObject, java.lang.Object)
+ *
+ * @param listener
+ * @param notification
+ * @return
+ */
+ @Override
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ return true;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getEditString(org.eclipse.core.runtime.IAdaptable, int)
+ *
+ * @param element
+ * @param flags
+ * @return
+ */
+ @Override
+ public String getEditString(IAdaptable element, int flags) {
+ Object obj = element.getAdapter(Behavior.class);
+ if (obj instanceof Trigger) {
+ final Trigger trigger = ((Trigger) obj);
+ return UMLLabelInternationalization.getInstance().getLabel(trigger);
+ }
+ return EMPTY_STRING;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#isValidEditString(org.eclipse.core.runtime.IAdaptable, java.lang.String)
+ *
+ * @param element
+ * @param editString
+ * @return
+ */
+ @Override
+ public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
+ return new ParserEditStatus(org.eclipse.papyrus.uml.diagram.statemachine.part.UMLDiagramEditorPlugin.ID, IStatus.OK, ""); //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getParseCommand(org.eclipse.core.runtime.IAdaptable, java.lang.String, int)
+ *
+ * @param element
+ * @param newString
+ * @param flags
+ * @return
+ */
+ @Override
+ public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
+ final Trigger trigger = (Trigger) ((EObjectAdapter) element).getRealObject();
+ final EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(trigger);
+ final String newStringResult = newString;
+ if (editingDomain != null && editingDomain instanceof TransactionalEditingDomain) {
+ AbstractTransactionalCommand cmd = new AbstractTransactionalCommand((TransactionalEditingDomain) editingDomain, "Set new name in " + trigger.getName(), null) { //$NON-NLS-1$
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if (InternationalizationPreferencesUtils.getInternationalizationPreference(trigger) && null != UMLLabelInternationalization.getInstance().getLabelWithoutUML(trigger)) {
+ UMLLabelInternationalization.getInstance().setLabel(trigger, newStringResult, null);
+ } else {
+ trigger.setName(newStringResult);
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ if (cmd != null && cmd.canExecute()) {
+ return cmd;
+ }
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getPrintString(org.eclipse.core.runtime.IAdaptable, int)
+ *
+ * @param element
+ * @param flags
+ * @return
+ */
+ @Override
+ public String getPrintString(IAdaptable element, int flags) {
+ Object obj = element.getAdapter(EObject.class);
+ View view = element.getAdapter(View.class);
+ if (obj instanceof Trigger) {
+ Trigger trigger = (Trigger) obj;
+ StringBuilder result = new StringBuilder();
+ if (trigger.getEvent() != null) {
+ result.append(TriggerUtil.getTextForTrigger(view, trigger));
+ }
+ result.append(SPACE_STRING);
+ result.append(Messages.DeferrableTriggerParser_DEFER_KEYWORD);
+ return result.toString();
+ }
+ return EMPTY_STRING;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#isAffectingEvent(java.lang.Object, int)
+ *
+ * @param event
+ * @param flags
+ * @return
+ */
+ @Override
+ public boolean isAffectingEvent(Object event, int flags) {
+ if (event instanceof Notification) {
+ int notificationType = ((Notification) event).getEventType();
+ if (Notification.ADD == notificationType || Notification.SET == notificationType || Notification.REMOVE == notificationType) {
+ Object feature = ((Notification) event).getFeature();
+ if (feature instanceof EStructuralFeature) {
+ EStructuralFeature eStrucFeature = (EStructuralFeature) feature;
+ if (UMLPackage.Literals.STATE__DEFERRABLE_TRIGGER.equals(eStrucFeature)) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getCompletionProcessor(org.eclipse.core.runtime.IAdaptable)
+ *
+ * @param element
+ * @return
+ */
+ @Override
+ public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
+ return null;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/Messages.java
index 20e501cdb99..b6cc20ea3a9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/Messages.java
@@ -17,6 +17,8 @@ public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.diagram.statemachine.custom.parsers.messages"; //$NON-NLS-1$
+ public static String DeferrableTriggerParser_DEFER_KEYWORD;
+
public static String DoActivityStateBehaviorParser_DO_KEYWORD;
public static String EntryStateBehaviorParser_ENTRY_KEYWORD;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/messages.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/messages.properties
index efec89805a0..962d8e5beee 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/messages.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/messages.properties
@@ -1,3 +1,4 @@
+DeferrableTriggerParser_DEFER_KEYWORD=/defer
DoActivityStateBehaviorParser_DO_KEYWORD=/do
EntryStateBehaviorParser_ENTRY_KEYWORD=/entry
ExitStateBehaviorParser_EXIT_KEYWORD=/exit
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/util/TriggerUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/util/TriggerUtil.java
new file mode 100644
index 00000000000..b606a674723
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/util/TriggerUtil.java
@@ -0,0 +1,98 @@
+/*****************************************************************************
+ * Copyright (c) 2017 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.statemachine.custom.util;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.statemachine.custom.parsers.OpaqueBehaviorViewUtil;
+import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
+import org.eclipse.uml2.uml.CallEvent;
+import org.eclipse.uml2.uml.ChangeEvent;
+import org.eclipse.uml2.uml.Event;
+import org.eclipse.uml2.uml.OpaqueExpression;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Signal;
+import org.eclipse.uml2.uml.SignalEvent;
+import org.eclipse.uml2.uml.TimeEvent;
+import org.eclipse.uml2.uml.TimeExpression;
+import org.eclipse.uml2.uml.Trigger;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public class TriggerUtil {
+
+ /**
+ * Get the text concerning Trigger
+ *
+ * @param view
+ * @param trigger
+ * @return
+ */
+ static public String getTextForTrigger(View view, Trigger trigger) {
+ StringBuilder result = new StringBuilder();
+ if (trigger != null) {
+ Event e = trigger.getEvent();
+ if (e instanceof CallEvent) {
+ Operation op = ((CallEvent) e).getOperation();
+ if (op != null) {
+ result.append(UMLLabelInternationalization.getInstance().getLabel(op));
+ if ((op.getOwnedParameters().size() > 0) && OpaqueBehaviorViewUtil.displayParamDots(view)) {
+ result.append(OpaqueBehaviorViewUtil.PARAM_DOTS);
+ }
+ } else {
+ result.append(UMLLabelInternationalization.getInstance().getLabel((e)));
+ }
+ } else if (e instanceof SignalEvent) {
+ Signal signal = ((SignalEvent) e).getSignal();
+ if (signal != null) {
+ result.append(UMLLabelInternationalization.getInstance().getLabel(signal));
+ if ((signal.getAttributes().size() > 0) && OpaqueBehaviorViewUtil.displayParamDots(view)) {
+ result.append(OpaqueBehaviorViewUtil.PARAM_DOTS);
+ }
+ } else {
+ result.append(UMLLabelInternationalization.getInstance().getLabel((e)));
+ }
+ } else if (e instanceof ChangeEvent) {
+ ValueSpecification vs = ((ChangeEvent) e).getChangeExpression();
+ String value;
+ if (vs instanceof OpaqueExpression) {
+ value = OpaqueBehaviorViewUtil.retrieveBody(view, (OpaqueExpression) vs);
+ } else {
+ value = vs.stringValue();
+ }
+ result.append(value);
+ } else if (e instanceof TimeEvent) {
+ TimeEvent timeEvent = (TimeEvent) e;
+ // absRelPrefix
+ result.append(timeEvent.isRelative() ? "after " : "at "); //$NON-NLS-1$ //$NON-NLS-2$
+ // body
+ TimeExpression te = timeEvent.getWhen();
+ String value;
+ if (te != null) {
+ ValueSpecification vs = te.getExpr();
+ if (vs instanceof OpaqueExpression) {
+ value = OpaqueBehaviorViewUtil.retrieveBody(view, (OpaqueExpression) vs);
+ } else {
+ value = vs.stringValue();
+ }
+ } else {
+ value = "undefined"; //$NON-NLS-1$
+ }
+ result.append(value);
+ } else { // any receive event
+ result.append("all"); //$NON-NLS-1$
+ }
+ }
+ return result.toString();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen
index 043646f005e..b958c05d041 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen
@@ -235,7 +235,7 @@
editPartClassName="StateEditPart"
itemSemanticEditPolicyClassName="StateItemSemanticEditPolicy"
canonicalEditPolicyClassName="StateCanonicalEditPolicy"
- childNodes="/0/@diagram/@childNodes.17 /0/@diagram/@childNodes.18 /0/@diagram/@childNodes.19 /0/@diagram/@childNodes.16 /0/@diagram/@childNodes.0 /0/@diagram/@childNodes.11 /0/@diagram/@childNodes.12 /0/@diagram/@childNodes.13"
+ childNodes="/0/@diagram/@childNodes.17 /0/@diagram/@childNodes.18 /0/@diagram/@childNodes.19 /0/@diagram/@childNodes.20 /0/@diagram/@childNodes.16 /0/@diagram/@childNodes.0 /0/@diagram/@childNodes.11 /0/@diagram/@childNodes.12 /0/@diagram/@childNodes.13"
compartments="/0/@diagram/@compartments.2"
graphicalNodeEditPolicyClassName="StateGraphicalNodeEditPolicy"
createCommandClassName="StateCreateCommand"
@@ -1889,6 +1889,45 @@
href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/State/exit"/>
</labelModelFacet>
</childNodes>
+ <childNodes
+ xsi:type="gmfgen:GenChildLabelNode"
+ visualID="693"
+ editPartClassName="DeferrableTriggerEditPart"
+ itemSemanticEditPolicyClassName="DeferrableTriggerItemSemanticEditPolicy"
+ canonicalEditPolicyClassName="DeferrableTriggerCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="DeferrableTriggerGraphicalNodeEditPolicy"
+ createCommandClassName="DeferrableTriggerCreateCommand"
+ containers="/0/@diagram/@childNodes.2">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.umldi.Trigger_DeferrableTriggerLabel"
+ displayName="DeferrableTrigger"
+ definedExternally="true"
+ editHelperClassName="DeferrableTriggerEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:FigureViewmap"
+ figureQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.CenteredWrappedLabel"/>
+ <behaviour
+ xsi:type="gmfgen:CustomBehaviour"
+ key="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY"
+ editPolicyQualifiedClassName="org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Trigger"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/State/deferrableTrigger"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/State/deferrableTrigger"/>
+ </modelFacet>
+ <labelModelFacet
+ xsi:type="gmfgen:FeatureLabelModelFacet"
+ parser="/0/@labelParsers/@implementations.10">
+ <metaFeatures
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/State/deferrableTrigger"/>
+ </labelModelFacet>
+ </childNodes>
<topLevelNodes
visualID="2000"
editPartClassName="StateMachineEditPart"
@@ -2856,6 +2895,10 @@
xsi:type="gmfgen:CustomParser"
uses="/0/@diagram/@childNodes.19/@labelModelFacet"
qualifiedName="org.eclipse.papyrus.uml.diagram.statemachine.custom.parsers.ExitStateBehaviorParser"/>
+ <implementations
+ xsi:type="gmfgen:CustomParser"
+ uses="/0/@diagram/@childNodes.20/@labelModelFacet"
+ qualifiedName="org.eclipse.papyrus.uml.diagram.statemachine.custom.parsers.DeferrableTriggerParser"/>
</labelParsers>
<contextMenus
context="/0/@diagram">
@@ -2980,6 +3023,9 @@
genView="/0/@diagram/@childNodes.19"
visualID="Behavior_ExitBehaviorLabel"/>
<child
+ genView="/0/@diagram/@childNodes.20"
+ visualID="Trigger_DeferrableTriggerLabel"/>
+ <child
genView="/0/@diagram/@childNodes.11"
visualID="Pseudostate_EntryPointShape">
<child
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.xml
index 1d81c48f672..4d06bd5c37c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/plugin.xml
@@ -144,7 +144,7 @@
<viewProvider class="org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLViewProvider">
<Priority name="Lowest"/>
<context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="PapyrusUMLStateMachineDiagram"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="StateMachine_Shape,State_Shape_TN,Region_Shape,FinalState_Shape,State_Shape,Pseudostate_InitialShape,Pseudostate_JoinShape,Pseudostate_ForkShape,Pseudostate_ChoiceShape,Pseudostate_JunctionShape,Pseudostate_ShallowHistoryShape,Pseudostate_DeepHistoryShape,Pseudostate_TerminateShape,Pseudostate_EntryPointShape,Pseudostate_ExitPointShape,ConnectionPointReference_Shape,Comment_Shape,Constraint_Shape,Transition_InternalTransitionLabel,Behavior_EntryBehaviorLabel,Behavior_DoActivityBehaviorLabel,Behavior_ExitBehaviorLabel"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="StateMachine_Shape,State_Shape_TN,Region_Shape,FinalState_Shape,State_Shape,Pseudostate_InitialShape,Pseudostate_JoinShape,Pseudostate_ForkShape,Pseudostate_ChoiceShape,Pseudostate_JunctionShape,Pseudostate_ShallowHistoryShape,Pseudostate_DeepHistoryShape,Pseudostate_TerminateShape,Pseudostate_EntryPointShape,Pseudostate_ExitPointShape,ConnectionPointReference_Shape,Comment_Shape,Constraint_Shape,Transition_InternalTransitionLabel,Behavior_EntryBehaviorLabel,Behavior_DoActivityBehaviorLabel,Behavior_ExitBehaviorLabel,Trigger_DeferrableTriggerLabel"/>
<context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="Transition_Edge,Generalization_Edge,Comment_AnnotatedElementEdge,Constraint_ConstrainedElementEdge,Constraint_ContextEdge"/>
</viewProvider>
</extension>
@@ -157,7 +157,7 @@
<method name="getType()" value="PapyrusUMLStateMachineDiagram"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
- <method name="getType()" value="StateMachine_Shape,State_Shape_TN,Region_Shape,FinalState_Shape,State_Shape,Pseudostate_InitialShape,Pseudostate_JoinShape,Pseudostate_ForkShape,Pseudostate_ChoiceShape,Pseudostate_JunctionShape,Pseudostate_ShallowHistoryShape,Pseudostate_DeepHistoryShape,Pseudostate_TerminateShape,Pseudostate_EntryPointShape,Pseudostate_ExitPointShape,ConnectionPointReference_Shape,Comment_Shape,Constraint_Shape,Transition_InternalTransitionLabel,Behavior_EntryBehaviorLabel,Behavior_DoActivityBehaviorLabel,Behavior_ExitBehaviorLabel"/>
+ <method name="getType()" value="StateMachine_Shape,State_Shape_TN,Region_Shape,FinalState_Shape,State_Shape,Pseudostate_InitialShape,Pseudostate_JoinShape,Pseudostate_ForkShape,Pseudostate_ChoiceShape,Pseudostate_JunctionShape,Pseudostate_ShallowHistoryShape,Pseudostate_DeepHistoryShape,Pseudostate_TerminateShape,Pseudostate_EntryPointShape,Pseudostate_ExitPointShape,ConnectionPointReference_Shape,Comment_Shape,Constraint_Shape,Transition_InternalTransitionLabel,Behavior_EntryBehaviorLabel,Behavior_DoActivityBehaviorLabel,Behavior_ExitBehaviorLabel,Trigger_DeferrableTriggerLabel"/>
</object>
<object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
<method name="getType()" value="Transition_Edge,Generalization_Edge,Comment_AnnotatedElementEdge,Constraint_ConstrainedElementEdge,Constraint_ContextEdge"/>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/DeferrableTriggerEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/DeferrableTriggerEditPart.java
new file mode 100644
index 00000000000..e9fdf2de085
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/DeferrableTriggerEditPart.java
@@ -0,0 +1,841 @@
+/**
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * 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.statemachine.edit.parts;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.requests.SelectionRequest;
+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.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.ICustomDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
+import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
+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.parsers.ParserUtil;
+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.editpolicies.QualifiedNameDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.CenteredWrappedLabel;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.UMLTextNonResizableEditPolicy;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.policies.UMLTextSelectionEditPolicy;
+import org.eclipse.papyrus.uml.diagram.statemachine.providers.UMLElementTypes;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.graphics.Color;
+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.Feature;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * @generated
+ */
+public class DeferrableTriggerEditPart extends CompartmentEditPart
+ implements ITextAwareEditPart, IPrimaryEditPart, IControlParserForDirectEdit {
+
+ /**
+ * @generated
+ */
+ public static final String VISUAL_ID = "Trigger_DeferrableTriggerLabel";
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List<?> parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+ /**
+ * direct edition mode (default, undefined, registered editor, etc.)
+ *
+ * @generated
+ */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /**
+ * configuration from a registered edit dialog
+ *
+ * @generated
+ */
+ protected IDirectEditorConfiguration configuration;
+
+
+ /**
+ * @generated
+ */
+ public DeferrableTriggerEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ public DragTracker getDragTracker(Request request) {
+ if (request instanceof SelectionRequest && ((SelectionRequest) request).getLastButtonPressed() == 3) {
+ return null;
+ }
+ return new DragEditPartsTrackerEx(this);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new UMLTextNonResizableEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
+ }
+
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure) {
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getText();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getText();
+ } else {
+ return ((Label) figure).getText();
+ }
+ }
+
+ /**
+ * @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 {
+ ((Label) figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure) {
+ if (figure instanceof WrappingLabel) {
+ return ((WrappingLabel) figure).getIcon();
+ } else if (figure instanceof ILabelFigure) {
+ return ((ILabelFigure) figure).getIcon();
+ } else {
+ return ((Label) figure).getIcon();
+ }
+ }
+
+ /**
+ * @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 {
+ ((Label) figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ protected List<?> getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void setParser(IParser parser) {
+ this.parser = parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelText() {
+ String text = null;
+ EObject parserElement = getParserElement();
+ if (parserElement != null && getParser() != null) {
+ text = getParser().getPrintString(
+ ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
+ }
+ if (text == null || text.length() == 0) {
+ text = defaultText;
+ }
+ return text;
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditText() {
+ if (getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(
+ ParserUtil.getParserAdapter(getParserElement(), this),
+ getParserOptions().intValue());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ /**
+ * @generated
+ */
+ public ICellEditorValidator getEditTextValidator() {
+ return new ICellEditorValidator() {
+
+ @Override
+ public String isValid(final Object value) {
+ if (value instanceof String) {
+ final EObject element = getParserElement();
+ final IParser parser = getParser();
+ try {
+ IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(
+ new RunnableWithResult.Impl<java.lang.Object>() {
+
+ @Override
+ public void run() {
+ setResult(parser.isValidEditString(ParserUtil.getParserAdapter(getParserElement(), DeferrableTriggerEditPart.this), (String) value));
+ }
+ });
+ return valid.getCode() == IParserEditStatus.EDITABLE ? null : valid.getMessage();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+
+ // shouldn't get here
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public IContentAssistProcessor getCompletionProcessor() {
+ if (getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(ParserUtil.getParserAdapter(getParserElement(), this));
+ }
+
+ /**
+ * @generated
+ */
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * @generated
+ */
+ public IParser getParser() {
+ if (parser == null) {
+ parser = ParserUtil.getParser(UMLElementTypes.Trigger_DeferrableTriggerLabel, getParserElement(), this, VISUAL_ID);
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager() {
+ if (manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this,
+ MultilineLabelDirectEditManager.getTextCellEditorClass(this),
+ UMLEditPartFactory.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ BusyIndicator.showWhile(Display.getDefault(), new java.lang.Runnable() {
+
+ @Override
+ public void run() {
+ getManager().show();
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(char initialCharacter) {
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if (IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch (directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ 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 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);
+ } else {
+ return;
+ }
+ final Dialog finalDialog = dialog;
+
+ if (Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog) finalDialog).getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+ initializeDirectEditManager(theRequest);
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void initializeDirectEditManager(final Request request) {
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+ @Override
+ public void run() {
+ if (isActive() && isEditable()) {
+ if (request.getExtendedData().get(
+ RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character) request.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshLabel() {
+ EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if (maskLabelPolicy == null) {
+ 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);
+ }
+ }
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof UMLTextSelectionEditPolicy) {
+ ((UMLTextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
+ }
+ if (resolveSemanticElement() instanceof Feature) {
+ if (((Feature) resolveSemanticElement()).isStatic()) {
+ ((WrappingLabel) getFigure()).setTextUnderline(true);
+ } else {
+ ((WrappingLabel) getFigure()).setTextUnderline(false);
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFont() {
+ FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
+ NotationPackage.eINSTANCE.getFontStyle());
+ if (style != null) {
+ FontData fontData = new FontData(
+ style.getFontName(), style.getFontHeight(),
+ (style.isBold() ? SWT.BOLD : SWT.NORMAL) |
+ (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ /**
+ * @generated
+ */
+ protected void addSemanticListeners() {
+ if (getParser() instanceof ISemanticParser) {
+ EObject element = resolveSemanticElement();
+ parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
+ for (int i = 0; i < parserElements.size(); i++) {
+ addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
+ }
+ } else {
+ super.addSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeSemanticListeners() {
+ if (parserElements != null) {
+ for (int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if (accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ @Override
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ /**
+ * @generated
+ */
+ private View getFontStyleOwnerView() {
+ return getPrimaryView();
+ }
+
+ /**
+ * Returns the kind of associated editor for direct edition.
+ *
+ * @return an <code>int</code> corresponding to the kind of direct editor, @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition
+ * @generated
+ */
+ public int getDirectEditionType() {
+ if (checkExtendedEditor()) {
+ initExtendedEditorConfiguration();
+ return IDirectEdition.EXTENDED_DIRECT_EDITOR;
+ }
+ if (checkDefaultEdition()) {
+ return IDirectEdition.DEFAULT_DIRECT_EDITOR;
+ }
+
+ // not a named element. no specific editor => do nothing
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * Checks if an extended editor is present.
+ *
+ * @return <code>true</code> if an extended editor is present.
+ * @generated
+ */
+ protected boolean checkExtendedEditor() {
+ if (resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement(), this);
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ * @generated
+ */
+ protected boolean checkDefaultEdition() {
+ return (getParser() != null);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ *
+ * @generated
+ */
+ protected void initExtendedEditorConfiguration() {
+ if (configuration == null) {
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
+ if (languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement(), this);
+ }
+ }
+ }
+
+ /**
+ * 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.equals(configuration.getLanguage())) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement(), this);
+ } else if (IDirectEditorsIds.SIMPLE_DIRECT_EDITOR.equals(languagePreferred)) {
+ configuration = null;
+ }
+ }
+
+ /**
+ * Performs the direct edit usually used by GMF editors.
+ *
+ * @param theRequest
+ * the direct edit request that starts the direct edit system
+ * @generated
+ */
+ protected void performDefaultDirectEditorEdit(final Request theRequest) {
+ // 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();
+ }
+ }
+
+
+ /**
+ * @generated
+ */
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+ Object feature = event.getFeature();
+ if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ Integer c = (Integer) event.getNewValue();
+ setFontColor(DiagramColorRegistry.getInstance().getColor(c));
+ } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
+ 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)) {
+ refreshFont();
+ } else {
+ if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
+ refreshLabel();
+ }
+ if (getParser() instanceof ISemanticParser) {
+ ISemanticParser modelParser = (ISemanticParser) getParser();
+ if (modelParser.areSemanticElementsAffected(null, event)) {
+ removeSemanticListeners();
+ if (resolveSemanticElement() != null) {
+ addSemanticListeners();
+ }
+ refreshLabel();
+ }
+ }
+ }
+ if (UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature)) {
+ refreshUnderline();
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim() {
+ return new CenteredWrappedLabel();
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public boolean isSelectable() {
+ return getFigure().isShowing();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/UMLEditPartFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/UMLEditPartFactory.java
index 68984d2119a..913a056198b 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/UMLEditPartFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/edit/parts/UMLEditPartFactory.java
@@ -200,6 +200,9 @@ public class UMLEditPartFactory implements EditPartFactory {
case ExitStateBehaviorEditPart.VISUAL_ID:
return new ExitStateBehaviorEditPart(view);
+ case DeferrableTriggerEditPart.VISUAL_ID:
+ return new DeferrableTriggerEditPart(view);
+
case RegionCompartmentEditPart.VISUAL_ID:
return new RegionCompartmentEditPart(view);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramUpdater.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramUpdater.java
index f68498d4326..d33402b3847 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramUpdater.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLDiagramUpdater.java
@@ -30,6 +30,7 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointRe
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DeferrableTriggerEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -73,6 +74,7 @@ import org.eclipse.uml2.uml.Region;
import org.eclipse.uml2.uml.State;
import org.eclipse.uml2.uml.StateMachine;
import org.eclipse.uml2.uml.Transition;
+import org.eclipse.uml2.uml.Trigger;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.Vertex;
@@ -230,6 +232,15 @@ public class UMLDiagramUpdater implements DiagramUpdater {
result.add(new UMLNodeDescriptor(childElement, visualID));
}
}
+ for (Iterator<?> it = modelElement.getDeferrableTriggers()
+ .iterator(); it.hasNext();) {
+ Trigger childElement = (Trigger) it.next();
+ String visualID = UMLVisualIDRegistry.getNodeVisualID(view, childElement);
+ if (DeferrableTriggerEditPart.VISUAL_ID.equals(visualID)) {
+ result.add(new UMLNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
for (Iterator<?> it = modelElement.getIncomings()
.iterator(); it.hasNext();) {
Transition childElement = (Transition) it.next();
@@ -445,6 +456,8 @@ public class UMLDiagramUpdater implements DiagramUpdater {
return getBehavior_DoActivityBehaviorLabel_ContainedLinks(view);
case ExitStateBehaviorEditPart.VISUAL_ID:
return getBehavior_ExitBehaviorLabel_ContainedLinks(view);
+ case DeferrableTriggerEditPart.VISUAL_ID:
+ return getTrigger_DeferrableTriggerLabel_ContainedLinks(view);
case TransitionEditPart.VISUAL_ID:
return getTransition_Edge_ContainedLinks(view);
case GeneralizationEditPart.VISUAL_ID:
@@ -506,6 +519,8 @@ public class UMLDiagramUpdater implements DiagramUpdater {
return getBehavior_DoActivityBehaviorLabel_IncomingLinks(view);
case ExitStateBehaviorEditPart.VISUAL_ID:
return getBehavior_ExitBehaviorLabel_IncomingLinks(view);
+ case DeferrableTriggerEditPart.VISUAL_ID:
+ return getTrigger_DeferrableTriggerLabel_IncomingLinks(view);
case TransitionEditPart.VISUAL_ID:
return getTransition_Edge_IncomingLinks(view);
case GeneralizationEditPart.VISUAL_ID:
@@ -567,6 +582,8 @@ public class UMLDiagramUpdater implements DiagramUpdater {
return getBehavior_DoActivityBehaviorLabel_OutgoingLinks(view);
case ExitStateBehaviorEditPart.VISUAL_ID:
return getBehavior_ExitBehaviorLabel_OutgoingLinks(view);
+ case DeferrableTriggerEditPart.VISUAL_ID:
+ return getTrigger_DeferrableTriggerLabel_OutgoingLinks(view);
case TransitionEditPart.VISUAL_ID:
return getTransition_Edge_OutgoingLinks(view);
case GeneralizationEditPart.VISUAL_ID:
@@ -762,6 +779,13 @@ public class UMLDiagramUpdater implements DiagramUpdater {
/**
* @generated
*/
+ public List<UMLLinkDescriptor> getTrigger_DeferrableTriggerLabel_ContainedLinks(View view) {
+ return Collections.emptyList();
+ }
+
+ /**
+ * @generated
+ */
public List<UMLLinkDescriptor> getTransition_Edge_ContainedLinks(View view) {
return Collections.emptyList();
}
@@ -1040,6 +1064,13 @@ public class UMLDiagramUpdater implements DiagramUpdater {
/**
* @generated
*/
+ public List<UMLLinkDescriptor> getTrigger_DeferrableTriggerLabel_IncomingLinks(View view) {
+ return Collections.emptyList();
+ }
+
+ /**
+ * @generated
+ */
public List<UMLLinkDescriptor> getTransition_Edge_IncomingLinks(View view) {
Transition modelElement = (Transition) view.getElement();
CrossReferenceAdapter crossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(view.eResource().getResourceSet());
@@ -1271,6 +1302,13 @@ public class UMLDiagramUpdater implements DiagramUpdater {
/**
* @generated
*/
+ public List<UMLLinkDescriptor> getTrigger_DeferrableTriggerLabel_OutgoingLinks(View view) {
+ return Collections.emptyList();
+ }
+
+ /**
+ * @generated
+ */
public List<UMLLinkDescriptor> getTransition_Edge_OutgoingLinks(View view) {
return Collections.emptyList();
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLVisualIDRegistry.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLVisualIDRegistry.java
index bb943ef0d1d..81544b3a1bc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLVisualIDRegistry.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/part/UMLVisualIDRegistry.java
@@ -27,6 +27,7 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPar
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintNameLabelEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkAppliedStereotypeEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DeferrableTriggerEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -213,6 +214,9 @@ public class UMLVisualIDRegistry {
if (UMLPackage.eINSTANCE.getBehavior().isSuperTypeOf(domainElement.eClass()) && isBehavior_ExitBehaviorLabel((Behavior) domainElement)) {
return ExitStateBehaviorEditPart.VISUAL_ID;
}
+ if (UMLPackage.eINSTANCE.getTrigger().isSuperTypeOf(domainElement.eClass())) {
+ return DeferrableTriggerEditPart.VISUAL_ID;
+ }
if (UMLPackage.eINSTANCE.getTransition().isSuperTypeOf(domainElement.eClass())) {
return InternalTransitionEditPart.VISUAL_ID;
}
@@ -396,6 +400,9 @@ public class UMLVisualIDRegistry {
if (ExitStateBehaviorEditPart.VISUAL_ID.equals(nodeVisualID)) {
return true;
}
+ if (DeferrableTriggerEditPart.VISUAL_ID.equals(nodeVisualID)) {
+ return true;
+ }
if (InternalTransitionEditPart.VISUAL_ID.equals(nodeVisualID)) {
return true;
}
@@ -835,6 +842,7 @@ public class UMLVisualIDRegistry {
case EntryStateBehaviorEditPart.VISUAL_ID:
case DoActivityStateBehaviorStateEditPart.VISUAL_ID:
case ExitStateBehaviorEditPart.VISUAL_ID:
+ case DeferrableTriggerEditPart.VISUAL_ID:
case FinalStateEditPart.VISUAL_ID:
case PseudostateInitialEditPart.VISUAL_ID:
case PseudostateJoinEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLElementTypes.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLElementTypes.java
index 047dd500415..d3165d7529c 100755
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLElementTypes.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLElementTypes.java
@@ -29,6 +29,7 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointRe
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintConstrainedElementEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DeferrableTriggerEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -176,6 +177,11 @@ public class UMLElementTypes {
/**
* @generated
*/
+ public static final IElementType Trigger_DeferrableTriggerLabel = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Trigger_DeferrableTriggerLabel"); //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
public static final IElementType Transition_Edge = getElementTypeByUniqueId("org.eclipse.papyrus.umldi.Transition_Edge"); //$NON-NLS-1$
/**
* @generated
@@ -301,6 +307,9 @@ public class UMLElementTypes {
elements.put(Behavior_ExitBehaviorLabel, UMLPackage.eINSTANCE.getBehavior());
+ elements.put(Trigger_DeferrableTriggerLabel, UMLPackage.eINSTANCE.getTrigger());
+
+
elements.put(Transition_Edge, UMLPackage.eINSTANCE.getTransition());
@@ -351,6 +360,7 @@ public class UMLElementTypes {
KNOWN_ELEMENT_TYPES.add(Behavior_EntryBehaviorLabel);
KNOWN_ELEMENT_TYPES.add(Behavior_DoActivityBehaviorLabel);
KNOWN_ELEMENT_TYPES.add(Behavior_ExitBehaviorLabel);
+ KNOWN_ELEMENT_TYPES.add(Trigger_DeferrableTriggerLabel);
KNOWN_ELEMENT_TYPES.add(Transition_Edge);
KNOWN_ELEMENT_TYPES.add(Generalization_Edge);
KNOWN_ELEMENT_TYPES.add(Comment_AnnotatedElementEdge);
@@ -422,6 +432,8 @@ public class UMLElementTypes {
return Behavior_DoActivityBehaviorLabel;
case ExitStateBehaviorEditPart.VISUAL_ID:
return Behavior_ExitBehaviorLabel;
+ case DeferrableTriggerEditPart.VISUAL_ID:
+ return Trigger_DeferrableTriggerLabel;
case TransitionEditPart.VISUAL_ID:
return Transition_Edge;
case GeneralizationEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLParserProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLParserProvider.java
index 681ee1cf6f7..1a39108ab17 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLParserProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLParserProvider.java
@@ -26,6 +26,7 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.uml.diagram.common.parser.CommentParser;
import org.eclipse.papyrus.uml.diagram.common.parser.ConstraintParser;
import org.eclipse.papyrus.uml.diagram.common.parser.stereotype.AppliedStereotypeParser;
+import org.eclipse.papyrus.uml.diagram.statemachine.custom.parsers.DeferrableTriggerParser;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.parsers.DoActivityStateBehaviorParser;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.parsers.EntryStateBehaviorParser;
import org.eclipse.papyrus.uml.diagram.statemachine.custom.parsers.ExitStateBehaviorParser;
@@ -36,6 +37,7 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointRe
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointReferenceStereotypeEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintBodyEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintNameLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DeferrableTriggerEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -675,6 +677,21 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
/**
* @generated
*/
+ private DeferrableTriggerParser trigger_DeferrableTriggerLabel_Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getTrigger_DeferrableTriggerLabel_Parser() {
+ if (trigger_DeferrableTriggerLabel_Parser == null) {
+ trigger_DeferrableTriggerLabel_Parser = new DeferrableTriggerParser();
+ }
+ return trigger_DeferrableTriggerLabel_Parser;
+ }
+
+ /**
+ * @generated
+ */
private IParser transition_NameLabel_Parser;
/**
@@ -837,6 +854,8 @@ public class UMLParserProvider extends AbstractProvider implements IParserProvid
return getBehavior_DoActivityBehaviorLabel_Parser();
case ExitStateBehaviorEditPart.VISUAL_ID:
return getBehavior_ExitBehaviorLabel_Parser();
+ case DeferrableTriggerEditPart.VISUAL_ID:
+ return getTrigger_DeferrableTriggerLabel_Parser();
case TransitionNameEditPart.VISUAL_ID:
return getTransition_NameLabel_Parser();
case TransitionGuardEditPart.VISUAL_ID:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java
index 7159f6be7c7..79e7b563728 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src-gen/org/eclipse/papyrus/uml/diagram/statemachine/providers/UMLViewProvider.java
@@ -68,6 +68,7 @@ import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPar
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintNameLabelEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkAppliedStereotypeEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ContextLinkEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DeferrableTriggerEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -270,6 +271,7 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
case EntryStateBehaviorEditPart.VISUAL_ID:
case DoActivityStateBehaviorStateEditPart.VISUAL_ID:
case ExitStateBehaviorEditPart.VISUAL_ID:
+ case DeferrableTriggerEditPart.VISUAL_ID:
case InternalTransitionEditPart.VISUAL_ID:
if (domainElement == null || !visualID.equals(UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement))) {
return false; // visual id in semantic hint should match visual id for domain element
@@ -381,6 +383,8 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
return createBehavior_DoActivityBehaviorLabel(domainElement, containerView, index, persisted, preferencesHint);
case ExitStateBehaviorEditPart.VISUAL_ID:
return createBehavior_ExitBehaviorLabel(domainElement, containerView, index, persisted, preferencesHint);
+ case DeferrableTriggerEditPart.VISUAL_ID:
+ return createTrigger_DeferrableTriggerLabel(domainElement, containerView, index, persisted, preferencesHint);
}
}
// can't happen, provided #provides(CreateNodeViewOperation) is correct
@@ -932,6 +936,21 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider {
/**
* @generated
*/
+ public Node createTrigger_DeferrableTriggerLabel(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Node node = NotationFactory.eINSTANCE.createShape();
+ node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
+ node.setType(UMLVisualIDRegistry.getType(DeferrableTriggerEditPart.VISUAL_ID));
+ ViewUtil.insertChildView(containerView, node, index, persisted);
+ node.setElement(domainElement);
+
+ final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
+ PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "DeferrableTrigger");
+ return node;
+ }
+
+ /**
+ * @generated
+ */
public Edge createTransition_Edge(EObject domainElement, View containerView, int index, boolean persisted,
PreferencesHint preferencesHint) {
Connector edge = NotationFactory.eINSTANCE.createConnector();
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/canonical/TestSemantic.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/canonical/TestSemantic.java
index fc102be334e..9937f63256d 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/canonical/TestSemantic.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/canonical/TestSemantic.java
@@ -35,6 +35,7 @@ import org.eclipse.papyrus.junit.framework.classification.InteractiveTest;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.CommentEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConnectionPointReferenceEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DeferrableTriggerEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.DoActivityStateBehaviorStateEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.EntryStateBehaviorEditPart;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.ExitStateBehaviorEditPart;
@@ -142,6 +143,16 @@ public class TestSemantic extends BaseTestCase {
}
@Test
+ public void testDeferrableTriggerInState() {
+ IGraphicalEditPart stateEP = createChild(StateEditPart.VISUAL_ID, getRegionCompartmentEditPart());
+ IGraphicalEditPart entryEP = createChild(DeferrableTriggerEditPart.VISUAL_ID, stateEP);
+
+ EReference expectedFeature = UMLPackage.eINSTANCE.getState_DeferrableTrigger();
+
+ checkListElementReferenceSemantic(entryEP, stateEP, expectedFeature);
+ }
+
+ @Test
@InteractiveTest("Open a dialog")
public void testExitInState() {
IGraphicalEditPart stateEP = createChild(StateEditPart.VISUAL_ID, getRegionCompartmentEditPart());

Back to the top