diff options
author | vlorenzo | 2013-05-03 11:10:32 +0000 |
---|---|---|
committer | vlorenzo | 2013-05-03 11:10:32 +0000 |
commit | adda585483bf0714f34ceea3acf30ec66aab5469 (patch) | |
tree | 0bfdf917d784205c0b91ebb1a84dacffd260acd7 /sandbox | |
parent | df3284d02c0e92178036247c540693f0658d7053 (diff) | |
download | org.eclipse.papyrus-adda585483bf0714f34ceea3acf30ec66aab5469.tar.gz org.eclipse.papyrus-adda585483bf0714f34ceea3acf30ec66aab5469.tar.xz org.eclipse.papyrus-adda585483bf0714f34ceea3acf30ec66aab5469.zip |
400801: [Table 2] Tabular Editor must allow to create new element and add it to the table
https://bugs.eclipse.org/bugs/show_bug.cgi?id=400801
Diffstat (limited to 'sandbox')
57 files changed, 1856 insertions, 2 deletions
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractAxisManager.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractAxisManager.java index cdb4b4630d7..bddcb9960d1 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractAxisManager.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/AbstractAxisManager.java @@ -115,6 +115,18 @@ public abstract class AbstractAxisManager implements IAxisManager { /**
*
+ * @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#canCreateAxisElement(java.lang.String)
+ *
+ * @param elementId
+ * @return
+ */
+ @Override
+ public boolean canCreateAxisElement(String elementId) {
+ return false;
+ }
+
+ /**
+ *
* @see org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager#canDropAxisElement(java.util.Collection)
*
* @param objectsToAdd
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/CompositeAxisManager.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/CompositeAxisManager.java index f1e33ecd2c0..e27352a67d2 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/CompositeAxisManager.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/CompositeAxisManager.java @@ -111,6 +111,14 @@ public class CompositeAxisManager extends AbstractAxisManager implements ICompos return answer;
}
+ @Override
+ public boolean canCreateAxisElement(String elementId) {
+ boolean canCreateAxisElement = false;
+ for(IAxisManager manager : subManagers) {
+ canCreateAxisElement |= manager.canCreateAxisElement(elementId);
+ }
+ return canCreateAxisElement;
+ }
/**
*
* @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#getAddAxisCommand(org.eclipse.emf.edit.domain.EditingDomain,
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/IAxisManager.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/IAxisManager.java index c86d4f720f3..488ff04b68a 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/IAxisManager.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/axis/IAxisManager.java @@ -160,4 +160,13 @@ public interface IAxisManager extends IDisposable { * @param axisToMove
*/
public void moveAxis(final Object elementToMove, final int newIndex);
+
+ /**
+ *
+ * @param elementId
+ * the id of the element to create
+ * @return
+ * <code>true</code> if the element can be created
+ */
+ public boolean canCreateAxisElement(final String elementId);
}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java index 06e4a792b0e..bb29928508f 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java +++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java @@ -752,8 +752,7 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen }
public boolean canCreateRowElement(String elementType) {
- // TODO Auto-generated method stub
- return true;
+ return this.rowManager.canCreateAxisElement(elementType);
}
public boolean canCreateColumnElement(String elementType) {
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/.classpath b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/.classpath new file mode 100644 index 00000000000..ed2585fb3f4 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/.project b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/.project new file mode 100644 index 00000000000..5bfcdd44c46 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml.nattable.menu</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/.settings/org.eclipse.jdt.core.prefs b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..44217f8c068 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/META-INF/MANIFEST.MF b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..1282fd98fef --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/META-INF/MANIFEST.MF @@ -0,0 +1,27 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-SymbolicName: org.eclipse.papyrus.sysml.nattable.menu;singleton:=true +Bundle-Version: 0.10.0.qualifier +Bundle-Activator: org.eclipse.papyrus.sysml.nattable.menu.Activator +Bundle-Vendor: %Bundle-Vendor +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.uml.nattable.menu;bundle-version="0.10.0", + org.eclipse.gmf.runtime.emf.type.core, + org.eclipse.papyrus.sysml.service.types;bundle-version="0.10.0", + org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.0", + org.eclipse.papyrus.sysml.diagram.common;bundle-version="0.10.0", + org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.0", + org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.0", + org.eclipse.papyrus.uml.service.types;bundle-version="0.10.0", + org.eclipse.core.expressions;bundle-version="3.4.500", + org.eclipse.papyrus.infra.nattable;bundle-version="0.10.0", + org.eclipse.papyrus.infra.core.sasheditor;bundle-version="0.10.0", + org.eclipse.papyrus.infra.core;bundle-version="0.10.0", + org.eclipse.papyrus.infra.nattable.model;bundle-version="0.10.0", + org.eclipse.nebula.widgets.nattable.core;bundle-version="1.0.0", + org.eclipse.papyrus.infra.core.log;bundle-version="0.10.0", + org.eclipse.uml2.uml;bundle-version="4.1.0" +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ActivationPolicy: lazy diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/OSGI-INF/l10n/bundle.properties b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/OSGI-INF/l10n/bundle.properties new file mode 100644 index 00000000000..0e3374a8431 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,3 @@ +#Properties file for org.eclipse.papyrus.sysml.nattable.menu
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Menu for the creation of Sysml elements in the tabular editor (Incubation)
\ No newline at end of file diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/about.html b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/about.html new file mode 100644 index 00000000000..598b3684879 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>May 12, 2008</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/build.properties b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/build.properties new file mode 100644 index 00000000000..f701cb1cc0a --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/build.properties @@ -0,0 +1,8 @@ +source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html,\
+ plugin.pdoc
+src.includes = about.html
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/plugin.pdoc b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/plugin.pdoc new file mode 100644 index 00000000000..5e34df8f759 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/plugin.pdoc @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<doc:Documentation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:doc="http://www.eclipse.org/papyrus/documentation/plugin/documentation" description="This plugin provides the context menu for the tabular editor in SysML, with handlers for the creation of SysML model elements">
+ <referent firstName="Juan" lastName="Cadavid" eMail="juan.cadavid@cea.fr" currentCompany="CEA-LIST"/>
+</doc:Documentation>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/plugin.xml b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/plugin.xml new file mode 100644 index 00000000000..133c4ccb938 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/plugin.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+<extension point="org.eclipse.ui.handlers">
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ActorPartPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ActorPartCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.AllocateHandler" commandId="org.eclipse.papyrus.sysml.service.types.AllocateCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.AssociationHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.AssociationCompositeHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationCompositeCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.AssociationCompositeDirectedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationCompositeDirectedCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.AssociationNoneHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationNoneCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.AssociationNoneDirectedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationNoneDirectedCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.AssociationSharedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationSharedCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.AssociationSharedDirectedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationSharedDirectedCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.BlockHandler" commandId="org.eclipse.papyrus.sysml.service.types.BlockCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ConformHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConformCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ConstraintBlockHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConstraintBlockCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ConstraintBlockParameterHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConstraintBlockParameterCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ConstraintPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConstraintPropertyCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.CopyHandler" commandId="org.eclipse.papyrus.sysml.service.types.CopyCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.DeriveReqtHandler" commandId="org.eclipse.papyrus.sysml.service.types.DeriveReqtCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.DimensionHandler" commandId="org.eclipse.papyrus.sysml.service.types.DimensionCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.FlowPortHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPortCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.FlowPort_InOutHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InOutCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.FlowPort_InHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.FlowPort_OutHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_OutCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.FlowPort_NAHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_NACreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.FlowPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPropertyCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.FlowSpecificationHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowSpecificationCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ItemFlowHandler" commandId="org.eclipse.papyrus.sysml.service.types.ItemFlowCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.PartPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.PartPropertyCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ProblemHandler" commandId="org.eclipse.papyrus.sysml.service.types.ProblemCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.RationaleHandler" commandId="org.eclipse.papyrus.sysml.service.types.RationaleCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ReferencePropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ReferencePropertyCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.RequirementHandler" commandId="org.eclipse.papyrus.sysml.service.types.RequirementCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.SatisfyHandler" commandId="org.eclipse.papyrus.sysml.service.types.SatisfyCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.UnitHandler" commandId="org.eclipse.papyrus.sysml.service.types.UnitCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ValuePropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValuePropertyCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ValueTypeHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValueTypeCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ValueType_EnumerationHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValueType_EnumerationCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ValueType_PrimitiveTypeHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValueType_PrimitiveTypeCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.VerifyHandler" commandId="org.eclipse.papyrus.sysml.service.types.VerifyCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ViewHandler" commandId="org.eclipse.papyrus.sysml.service.types.ViewCreateCommand" ></handler>
+ <handler class= "org.eclipse.papyrus.sysml.nattable.menu.handlers.ViewPointHandler" commandId="org.eclipse.papyrus.sysml.service.types.ViewPointCreateCommand" ></handler>
+</extension>
+
+<extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="true"
+ locationURI="popup:org.eclipse.ui.popup.any">
+ <menu
+ id="org.eclipse.papyrus.sysml.nattable.create.sysml.menu"
+ label="Create Sysml Element">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activePart">
+ <test
+ property="org.eclipse.papyrus.uml.nattable.menu.tester.isTable"
+ value="true">
+ </test>
+ </with>
+ </visibleWhen>
+ </menu>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ class="org.eclipse.papyrus.sysml.nattable.menu.handlers.SysmlNattableCreateMenu"
+ locationURI="popup:org.eclipse.papyrus.sysml.nattable.create.sysml.menu">
+ </menuContribution>
+
+
+ </extension>
+</plugin>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ActorPartPropertyHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ActorPartPropertyHandler.java new file mode 100644 index 00000000000..a9c9309f5f2 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ActorPartPropertyHandler.java @@ -0,0 +1,72 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.UnexecutableCommand; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; +import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory; +import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; +import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; +import org.eclipse.papyrus.sysml.diagram.common.commands.CreateActorPartWithTypeConfigureCommandFactory; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for ActorPart (Property) creation + * + * </pre> + * + * @generated + */ +public class ActorPartPropertyHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.uml.service.creation.handler.CreateHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.ACTOR_PART_PROPERTY; + } + + /** + * {@inheritDoc} + */ + @Override + protected Command buildCommand() { + + if(getCommandContext() == null) { + return UnexecutableCommand.INSTANCE; + } + + EObject container = getCommandContext().getContainer(); + EReference reference = getCommandContext().getReference(); + + IElementEditService provider = ElementEditServiceUtils.getCommandProvider(container); + if(provider == null) { + return UnexecutableCommand.INSTANCE; + } + + CreateElementRequest createRequest = null; + if(reference == null) { + createRequest = new CreateElementRequest(container, getElementTypeToCreate()); + } else { + createRequest = new CreateElementRequest(container, getElementTypeToCreate(), reference); + } + createRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreateActorPartWithTypeConfigureCommandFactory()); + + // Retrieve create command from the Element Edit service + ICommand createGMFCommand = provider.getEditCommand(createRequest); + Command emfCommand = new org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper(createGMFCommand); + return emfCommand; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AllocateHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AllocateHandler.java new file mode 100644 index 00000000000..6cc3fbffa1b --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AllocateHandler.java @@ -0,0 +1,32 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Allocate creation + * + * </pre> + * + * @generated + */ +public class AllocateHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.ALLOCATE; + } + + +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationCompositeDirectedHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationCompositeDirectedHandler.java new file mode 100644 index 00000000000..cda67401e51 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationCompositeDirectedHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for AssociationCompositeDirected creation + * + * </pre> + * + * @generated + */ +public class AssociationCompositeDirectedHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.ASSOCIATION_COMPOSITE_DIRECTED; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationCompositeHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationCompositeHandler.java new file mode 100644 index 00000000000..31f953c348a --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationCompositeHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for AssociationComposite creation + * + * </pre> + * + * @generated + */ +public class AssociationCompositeHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.ASSOCIATION_COMPOSITE; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationHandler.java new file mode 100644 index 00000000000..6379997200d --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Association creation + * + * </pre> + * + * @generated + */ +public class AssociationHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.ASSOCIATION; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationNoneDirectedHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationNoneDirectedHandler.java new file mode 100644 index 00000000000..bd38070502e --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationNoneDirectedHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for AssociationNoneDirected creation + * + * </pre> + * + * @generated + */ +public class AssociationNoneDirectedHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.ASSOCIATION_NONE_DIRECTED; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationNoneHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationNoneHandler.java new file mode 100644 index 00000000000..7f406a79245 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationNoneHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for AssociationNone creation + * + * </pre> + * + * @generated + */ +public class AssociationNoneHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.ASSOCIATION_NONE; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationSharedDirectedHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationSharedDirectedHandler.java new file mode 100644 index 00000000000..af3e064cc9b --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationSharedDirectedHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for AssociationSharedDirected creation + * + * </pre> + * + * @generated + */ +public class AssociationSharedDirectedHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.ASSOCIATION_SHARED_DIRECTED; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationSharedHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationSharedHandler.java new file mode 100644 index 00000000000..305075870f5 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/AssociationSharedHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for AssociationShared creation + * + * </pre> + * + * @generated + */ +public class AssociationSharedHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.ASSOCIATION_SHARED; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/BlockHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/BlockHandler.java new file mode 100644 index 00000000000..7ca00a85d5d --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/BlockHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Block creation + * + * </pre> + * + * @generated + */ +public class BlockHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.uml.service.creation.handler.CreateHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.BLOCK; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConformHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConformHandler.java new file mode 100644 index 00000000000..dace272adbd --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConformHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Conform creation + * + * </pre> + * + * @generated + */ +public class ConformHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.CONFORM; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConstraintBlockHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConstraintBlockHandler.java new file mode 100644 index 00000000000..9671ab55f31 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConstraintBlockHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for ConstraintBlock creation + * + * </pre> + * + * @generated + */ +public class ConstraintBlockHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.CONSTRAINT_BLOCK; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConstraintBlockParameterHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConstraintBlockParameterHandler.java new file mode 100644 index 00000000000..da140f65001 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConstraintBlockParameterHandler.java @@ -0,0 +1,78 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.UnexecutableCommand; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; +import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.services.edit.commands.ConfigureFeatureCommandFactory; +import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory; +import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; +import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; +import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; +import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * <pre> + * Command handler for Problem creation + * + * </pre> + * + * @generated + */ +public class ConstraintBlockParameterHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return UMLElementTypes.PROPERTY; + } + + /** + * {@inheritDoc} + */ + @Override + protected Command buildCommand() { + + if(getCommandContext() == null) { + return UnexecutableCommand.INSTANCE; + } + + EObject container = getCommandContext().getContainer(); + EReference reference = getCommandContext().getReference(); + + IElementEditService provider = ElementEditServiceUtils.getCommandProvider(container); + if(provider == null) { + return UnexecutableCommand.INSTANCE; + } + + CreateElementRequest createRequest = null; + if(reference == null) { + createRequest = new CreateElementRequest(container, getElementTypeToCreate()); + } else { + createRequest = new CreateElementRequest(container, getElementTypeToCreate(), reference); + } + + String name = NamedElementUtil.getDefaultNameWithIncrementFromBase("parameter", ((Element)container).eContents()); //$NON-NLS-1$ + createRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new ConfigureFeatureCommandFactory(UMLPackage.eINSTANCE.getNamedElement_Name(), name)); + + // Retrieve create command from the Element Edit service + ICommand createGMFCommand = provider.getEditCommand(createRequest); + Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand); + return emfCommand; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConstraintPropertyHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConstraintPropertyHandler.java new file mode 100644 index 00000000000..b1ba55d62c4 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ConstraintPropertyHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for ConstraintProperty creation + * + * </pre> + * + * @generated + */ +public class ConstraintPropertyHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.CONSTRAINT_PROPERTY; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/CopyHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/CopyHandler.java new file mode 100644 index 00000000000..ba99dc355d2 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/CopyHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Copy creation + * + * </pre> + * + * @generated + */ +public class CopyHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.COPY; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/DeriveReqtHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/DeriveReqtHandler.java new file mode 100644 index 00000000000..852f9aa3629 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/DeriveReqtHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for DeriveReqt creation + * + * </pre> + * + * @generated + */ +public class DeriveReqtHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.uml.service.creation.handler.CreateHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.DERIVE_REQT; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/DimensionHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/DimensionHandler.java new file mode 100644 index 00000000000..71e1ecd80d4 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/DimensionHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Dimension creation + * + * </pre> + * + * @generated + */ +public class DimensionHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.DIMENSION; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPortHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPortHandler.java new file mode 100644 index 00000000000..300ee882c5d --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPortHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for FlowPort creation + * + * </pre> + * + * @generated + */ +public class FlowPortHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.uml.service.creation.handler.CreateHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.FLOW_PORT; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_InHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_InHandler.java new file mode 100644 index 00000000000..f39c9713ede --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_InHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for FlowPort_In creation + * + * </pre> + * + * @generated + */ +public class FlowPort_InHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.FLOW_PORT_IN; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_InOutHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_InOutHandler.java new file mode 100644 index 00000000000..11f35aa2ffe --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_InOutHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for FlowPort_InOut creation + * + * </pre> + * + * @generated + */ +public class FlowPort_InOutHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.FLOW_PORT_IN_OUT; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_NAHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_NAHandler.java new file mode 100644 index 00000000000..5b9b9d44339 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_NAHandler.java @@ -0,0 +1,55 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.UnexecutableCommand; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; +import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory; +import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; +import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; +import org.eclipse.papyrus.sysml.diagram.common.commands.CreateFlowPortWithFlowSpecificationConfigureCommandFactory; + +/** + * <pre> + * Command handler for FlowPort non atomic creation + * + * </pre> + * + * @generated + */ +public class FlowPort_NAHandler extends FlowPortHandler { + + /** + * {@inheritDoc} + */ + @Override + protected Command buildCommand() { + + if(getCommandContext() == null) { + return UnexecutableCommand.INSTANCE; + } + + EObject container = getCommandContext().getContainer(); + EReference reference = getCommandContext().getReference(); + + IElementEditService provider = ElementEditServiceUtils.getCommandProvider(container); + if(provider == null) { + return UnexecutableCommand.INSTANCE; + } + + CreateElementRequest createRequest = null; + if(reference == null) { + createRequest = new CreateElementRequest(container, getElementTypeToCreate()); + } else { + createRequest = new CreateElementRequest(container, getElementTypeToCreate(), reference); + } + createRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreateFlowPortWithFlowSpecificationConfigureCommandFactory()); + + // Retrieve create command from the Element Edit service + ICommand createGMFCommand = provider.getEditCommand(createRequest); + Command emfCommand = new org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper(createGMFCommand); + return emfCommand; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_OutHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_OutHandler.java new file mode 100644 index 00000000000..3dba414691a --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPort_OutHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for FlowPort_Out creation + * + * </pre> + * + * @generated + */ +public class FlowPort_OutHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.FLOW_PORT_OUT; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPropertyHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPropertyHandler.java new file mode 100644 index 00000000000..8c2f08ed8a1 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowPropertyHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for FlowProperty creation + * + * </pre> + * + * @generated + */ +public class FlowPropertyHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.uml.service.creation.handler.CreateHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.FLOW_PROPERTY; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowSpecificationHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowSpecificationHandler.java new file mode 100644 index 00000000000..0a6780791df --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/FlowSpecificationHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for FlowSpecification creation + * + * </pre> + * + * @generated + */ +public class FlowSpecificationHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.uml.service.creation.handler.CreateHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.FLOW_SPECIFICATION; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ItemFlowHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ItemFlowHandler.java new file mode 100644 index 00000000000..7522e5c1ef7 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ItemFlowHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for ItemFlow creation + * + * </pre> + * + * @generated + */ +public class ItemFlowHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.ITEM_FLOW; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/PartPropertyHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/PartPropertyHandler.java new file mode 100644 index 00000000000..9e4d5ee5afd --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/PartPropertyHandler.java @@ -0,0 +1,72 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.UnexecutableCommand; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; +import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory; +import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; +import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; +import org.eclipse.papyrus.sysml.diagram.common.commands.CreatePartWithTypeConfigureCommandFactory; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Part (Property) creation + * + * </pre> + * + * @generated + */ +public class PartPropertyHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.uml.service.creation.handler.CreateHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.PART_PROPERTY; + } + + /** + * {@inheritDoc} + */ + @Override + protected Command buildCommand() { + + if(getCommandContext() == null) { + return UnexecutableCommand.INSTANCE; + } + + EObject container = getCommandContext().getContainer(); + EReference reference = getCommandContext().getReference(); + + IElementEditService provider = ElementEditServiceUtils.getCommandProvider(container); + if(provider == null) { + return UnexecutableCommand.INSTANCE; + } + + CreateElementRequest createRequest = null; + if(reference == null) { + createRequest = new CreateElementRequest(container, getElementTypeToCreate()); + } else { + createRequest = new CreateElementRequest(container, getElementTypeToCreate(), reference); + } + createRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreatePartWithTypeConfigureCommandFactory()); + + // Retrieve create command from the Element Edit service + ICommand createGMFCommand = provider.getEditCommand(createRequest); + Command emfCommand = new org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper(createGMFCommand); + return emfCommand; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ProblemHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ProblemHandler.java new file mode 100644 index 00000000000..224184cc6e5 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ProblemHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Problem creation + * + * </pre> + * + * @generated + */ +public class ProblemHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.PROBLEM; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/RationaleHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/RationaleHandler.java new file mode 100644 index 00000000000..870effea55d --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/RationaleHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Rationale creation + * + * </pre> + * + * @generated + */ +public class RationaleHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.RATIONALE; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ReferencePropertyHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ReferencePropertyHandler.java new file mode 100644 index 00000000000..7a167fe43eb --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ReferencePropertyHandler.java @@ -0,0 +1,72 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.UnexecutableCommand; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; +import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory; +import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; +import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; +import org.eclipse.papyrus.sysml.diagram.common.commands.CreateReferenceWithTypeConfigureCommandFactory; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Reference (Property) creation + * + * </pre> + * + * @generated + */ +public class ReferencePropertyHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.uml.service.creation.handler.CreateHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.REFERENCE_PROPERTY; + } + + /** + * {@inheritDoc} + */ + @Override + protected Command buildCommand() { + + if(getCommandContext() == null) { + return UnexecutableCommand.INSTANCE; + } + + EObject container = getCommandContext().getContainer(); + EReference reference = getCommandContext().getReference(); + + IElementEditService provider = ElementEditServiceUtils.getCommandProvider(container); + if(provider == null) { + return UnexecutableCommand.INSTANCE; + } + + CreateElementRequest createRequest = null; + if(reference == null) { + createRequest = new CreateElementRequest(container, getElementTypeToCreate()); + } else { + createRequest = new CreateElementRequest(container, getElementTypeToCreate(), reference); + } + createRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreateReferenceWithTypeConfigureCommandFactory()); + + // Retrieve create command from the Element Edit service + ICommand createGMFCommand = provider.getEditCommand(createRequest); + Command emfCommand = new org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper(createGMFCommand); + return emfCommand; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/RequirementHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/RequirementHandler.java new file mode 100644 index 00000000000..b3a8f899287 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/RequirementHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Requirement creation + * + * </pre> + * + * @generated + */ +public class RequirementHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.uml.service.creation.handler.CreateHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.REQUIREMENT; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/SatisfyHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/SatisfyHandler.java new file mode 100644 index 00000000000..4c1053febdb --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/SatisfyHandler.java @@ -0,0 +1,31 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Satisfy creation + * + * </pre> + * + * @generated + */ +public class SatisfyHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.SATISFY; + } + +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/UnitHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/UnitHandler.java new file mode 100644 index 00000000000..02250051d07 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/UnitHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Unit creation + * + * </pre> + * + * @generated + */ +public class UnitHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.UNIT; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValuePropertyHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValuePropertyHandler.java new file mode 100644 index 00000000000..2b6de8ddb0a --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValuePropertyHandler.java @@ -0,0 +1,72 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.UnexecutableCommand; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; +import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory; +import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils; +import org.eclipse.papyrus.infra.services.edit.service.IElementEditService; +import org.eclipse.papyrus.sysml.diagram.common.commands.CreateValueWithTypeConfigureCommandFactory; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Value (Property) creation + * + * </pre> + * + * @generated + */ +public class ValuePropertyHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.uml.service.creation.handler.CreateHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.VALUE_PROPERTY; + } + + /** + * {@inheritDoc} + */ + @Override + protected Command buildCommand() { + + if(getCommandContext() == null) { + return UnexecutableCommand.INSTANCE; + } + + EObject container = getCommandContext().getContainer(); + EReference reference = getCommandContext().getReference(); + + IElementEditService provider = ElementEditServiceUtils.getCommandProvider(container); + if(provider == null) { + return UnexecutableCommand.INSTANCE; + } + + CreateElementRequest createRequest = null; + if(reference == null) { + createRequest = new CreateElementRequest(container, getElementTypeToCreate()); + } else { + createRequest = new CreateElementRequest(container, getElementTypeToCreate(), reference); + } + createRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreateValueWithTypeConfigureCommandFactory()); + + // Retrieve create command from the Element Edit service + ICommand createGMFCommand = provider.getEditCommand(createRequest); + Command emfCommand = new org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper(createGMFCommand); + return emfCommand; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValueTypeHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValueTypeHandler.java new file mode 100644 index 00000000000..ee252708001 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValueTypeHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for ValueType creation + * + * </pre> + * + * @generated + */ +public class ValueTypeHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.VALUE_TYPE; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValueType_EnumerationHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValueType_EnumerationHandler.java new file mode 100644 index 00000000000..3b9f388b8ac --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValueType_EnumerationHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for ValueType_Enumeration creation + * + * </pre> + * + * @generated + */ +public class ValueType_EnumerationHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.VALUE_TYPE_ENUMERATION; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValueType_PrimitiveTypeHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValueType_PrimitiveTypeHandler.java new file mode 100644 index 00000000000..fd1ee5008df --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ValueType_PrimitiveTypeHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for ValueType_PrimitiveType creation + * + * </pre> + * + * @generated + */ +public class ValueType_PrimitiveTypeHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.VALUE_TYPE_PRIMITIVE_TYPE; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/VerifyHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/VerifyHandler.java new file mode 100644 index 00000000000..c107a5a2ee8 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/VerifyHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for Verify creation + * + * </pre> + * + * @generated + */ +public class VerifyHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.VERIFY; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ViewHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ViewHandler.java new file mode 100644 index 00000000000..a1650af5d42 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ViewHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for View creation + * + * </pre> + * + * @generated + */ +public class ViewHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.VIEW; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ViewPointHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ViewPointHandler.java new file mode 100644 index 00000000000..fc27c6638b0 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src-gen/org/eclipse/papyrus/sysml/nattable/menu/handlers/ViewPointHandler.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.sysml.nattable.menu.handlers; + +import org.eclipse.core.commands.IHandler; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes; + +/** + * <pre> + * Command handler for ViewPoint creation + * + * </pre> + * + * @generated + */ +public class ViewPointHandler extends AbstractSysmlNattableCreateCommandHandler implements IHandler { + + /** + * <pre> + * @see org.eclipse.papyrus.sysml.modelexplorer.handler.CreateCommandHandler#getElementTypeToCreate() + * + * @return the IElementType this handler is supposed to create + * + * </pre> + * + * @generated + */ + protected IElementType getElementTypeToCreate() { + return SysMLElementTypes.VIEW_POINT; + } +} diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src/org/eclipse/papyrus/sysml/nattable/menu/Activator.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src/org/eclipse/papyrus/sysml/nattable/menu/Activator.java new file mode 100644 index 00000000000..e6bcdeb5749 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src/org/eclipse/papyrus/sysml/nattable/menu/Activator.java @@ -0,0 +1,65 @@ +/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.nattable.menu;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.sysml.nattable.menu"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ log = new LogHelper(plugin);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src/org/eclipse/papyrus/sysml/nattable/menu/handlers/AbstractSysmlNattableCreateCommandHandler.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src/org/eclipse/papyrus/sysml/nattable/menu/handlers/AbstractSysmlNattableCreateCommandHandler.java new file mode 100644 index 00000000000..3ee423c271a --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src/org/eclipse/papyrus/sysml/nattable/menu/handlers/AbstractSysmlNattableCreateCommandHandler.java @@ -0,0 +1,113 @@ +/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.nattable.menu.handlers;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.UnexecutableCommand;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
+import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.sysml.service.types.handlers.AbstractSysmlCreateCommandHandler;
+import org.eclipse.papyrus.uml.nattable.menu.messages.Messages;
+import org.eclipse.papyrus.uml.nattable.menu.util.TableMenuUtils;
+import org.eclipse.papyrus.uml.service.types.utils.ICommandContext;
+
+/**
+ * Abstract handler for the creation commands of Sysml elements in the Nattable editor
+ *
+ */
+public abstract class AbstractSysmlNattableCreateCommandHandler extends AbstractSysmlCreateCommandHandler {
+
+ @Override
+ protected abstract IElementType getElementTypeToCreate();
+
+ /**
+ * <pre>
+ *
+ * Build the create command for an element creation in the selected container.
+ * The create command is given by the {@link IElementEditService} of selected
+ * element.
+ *
+ * @return the composite creation command for current selection
+ *
+ * </pre>
+ */
+ @Override
+ protected Command buildCommand() {
+ Command createCmd = super.buildCommand();
+
+ final INattableModelManager nattableModelManager = TableMenuUtils.getTableManager(getActiveWorkbenchPart());
+ if(nattableModelManager != null) {
+ CompositeCommand cmd = new CompositeCommand(""); //$NON-NLS-1$
+ cmd.add(new EMFtoGMFCommandWrapper(createCmd));
+
+ final CreateElementRequest request = this.createRequest;
+ // depends on the synchronization of the axis manager
+ cmd.add(new AbstractTransactionalCommand(getEditingDomain(), Messages.AbstractNattableCreateCommandHandler_AddElementCommand, null) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ EObject newElement = request.getNewElement();
+ Collection<Object> toAdd = new ArrayList<Object>();
+ toAdd.add(newElement);
+ Command tmp = nattableModelManager.getAddRowElementCommand(toAdd);
+ if(tmp != null) {
+ tmp.execute();
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ });
+ return new org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper(cmd);
+
+ }
+ return UnexecutableCommand.INSTANCE;
+
+ }
+
+ @Override
+ protected ICommandContext getCommandContext() {
+ return TableMenuUtils.getTableCommandContext(TableMenuUtils.getTableManager(getActiveWorkbenchPart()));
+
+ }
+
+ @Override
+ public void setEnabled(Object evaluationContext) {
+ Command command = getCommand();
+ boolean isEnabled = command.canExecute();
+ if(isEnabled) {
+ IElementType newElementType = getElementTypeToCreate();
+ INattableModelManager tableManager = TableMenuUtils.getTableManager(getActiveWorkbenchPart());
+ String id = newElementType.getId();
+
+ isEnabled = tableManager.canCreateRowElement(id);
+ Set<String> visibleCommands = getFilterIds();
+ isEnabled &= visibleCommands.contains(id);
+
+ }
+ setBaseEnabled(isEnabled);
+
+ }
+
+}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src/org/eclipse/papyrus/sysml/nattable/menu/handlers/SysmlNattableCreateMenu.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src/org/eclipse/papyrus/sysml/nattable/menu/handlers/SysmlNattableCreateMenu.java new file mode 100644 index 00000000000..5a394669461 --- /dev/null +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable.menu/src/org/eclipse/papyrus/sysml/nattable/menu/handlers/SysmlNattableCreateMenu.java @@ -0,0 +1,36 @@ +/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.nattable.menu.handlers;
+
+import org.eclipse.papyrus.sysml.service.types.menu.AbstractCreateSysmlChildMenu;
+import org.eclipse.papyrus.uml.nattable.menu.tester.TableEditorPropertyTester;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.menus.IContributionRoot;
+import org.eclipse.ui.services.IServiceLocator;
+
+/**
+ * Menu contributions for the creation of Sysml elements from the Nattable editor
+ */
+public class SysmlNattableCreateMenu extends AbstractCreateSysmlChildMenu {
+
+ //FIXME : use the same property tester than in oep.infra.nattable.modelexplorer
+ private TableEditorPropertyTester tester = new TableEditorPropertyTester();
+
+ @Override
+ public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) {
+ IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
+ if(tester.test(part, TableEditorPropertyTester.IS_TABLE, null, Boolean.TRUE)) {
+ super.createContributionItems(serviceLocator, additions);
+ }
+ }
+}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java index f01661d46d8..1ebb612cf7e 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java +++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java @@ -62,6 +62,12 @@ public class RequirementAxisManager extends AbstractSynchronizedOnFeatureAxisMan super.dispose();
}
+
+ @Override
+ public boolean canCreateAxisElement(String elementId) {
+ return "org.eclipse.papyrus.sysml.Requirement".equals(elementId); //$NON-NLS-1$
+ }
+
/**
*
* @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractSynchronizedOnFeatureAxisManager#filterObject(java.util.List)
diff --git a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLElementAxisManager.java b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLElementAxisManager.java index 35ef0f0bd92..695ebe2dd3b 100644 --- a/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLElementAxisManager.java +++ b/sandbox/TableV3/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/UMLElementAxisManager.java @@ -38,4 +38,9 @@ public class UMLElementAxisManager extends EObjectAxisManager { }
return value;
}
+
+ @Override
+ public boolean canCreateAxisElement(String elementId) {
+ return true;//FIXME : must be true only for uml elements
+ }
}
|