Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2012-08-30 12:12:54 +0000
committervlorenzo2012-08-30 12:12:54 +0000
commit550f8a94a2881cf97a1132271b32c905743428ed (patch)
treef6d390e1c7a7bf64aaf20f1ad79c195f20ee3d84 /sandbox
parentb4033b86deaf1e8ed2a3cea6086210e4479612ed (diff)
downloadorg.eclipse.papyrus-550f8a94a2881cf97a1132271b32c905743428ed.tar.gz
org.eclipse.papyrus-550f8a94a2881cf97a1132271b32c905743428ed.tar.xz
org.eclipse.papyrus-550f8a94a2881cf97a1132271b32c905743428ed.zip
Share the plugin oep.sysml.table.efacet.requirement
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/.classpath7
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/.project28
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/META-INF/MANIFEST.MF16
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/build.properties5
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/icons/table_SysML_Requirement.gifbin0 -> 899 bytes
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/icons/table_SysML_Requirement.pngbin0 -> 1262 bytes
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/plugin.xml95
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/resources/sysml_requirement_table.papyrustableconfiguration25
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/Activator.java50
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/editor/RequirementTableEditor.java39
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/factory/RequirementTableEditorFactory.java41
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/handler/CreateRequirementEditorHandlerWithoutDialog.java34
-rw-r--r--sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/handler/CreateRequirementTableEditorHandler.java64
14 files changed, 411 insertions, 0 deletions
diff --git a/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/.classpath b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/.classpath
@@ -0,0 +1,7 @@
+<?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="output" path="bin"/>
+</classpath>
diff --git a/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/.project b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/.project
new file mode 100644
index 00000000000..fb04985a85d
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml.table.efacet.requirement</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/org.eclipse.papyrus.sysml.table.efacet.requirement/.settings/org.eclipse.jdt.core.prefs b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..44217f8c068
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/.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/org.eclipse.papyrus.sysml.table.efacet.requirement/META-INF/MANIFEST.MF b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..f0236c6929b
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: EFacet Requirement SysML Table (Incubation)
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.table.efacet.requirement;singleton:=true
+Bundle-Version: 0.9.1.qualifier
+Bundle-Activator: org.eclipse.papyrus.sysml.table.efacet.requirement.Activator
+Bundle-Vendor: Eclispe Modeling Project
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.sysml.efacet;bundle-version="0.9.1",
+ org.eclipse.papyrus.infra.table.efacet.common;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.table.efacet.metamodel;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.core,
+ org.eclipse.papyrus.infra.emf.efacet;bundle-version="0.9.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
diff --git a/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/build.properties b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/build.properties
new file mode 100644
index 00000000000..6f20375d6c7
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/icons/table_SysML_Requirement.gif b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/icons/table_SysML_Requirement.gif
new file mode 100644
index 00000000000..426869ed0ff
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/icons/table_SysML_Requirement.gif
Binary files differ
diff --git a/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/icons/table_SysML_Requirement.png b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/icons/table_SysML_Requirement.png
new file mode 100644
index 00000000000..c671f9e6440
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/icons/table_SysML_Requirement.png
Binary files differ
diff --git a/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/plugin.xml b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/plugin.xml
new file mode 100644
index 00000000000..705d0c75c24
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/plugin.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.infra.core.papyrusDiagram">
+ <editorDiagram
+ factoryClass="org.eclipse.papyrus.sysml.table.efacet.requirement.factory.RequirementTableEditorFactory"
+ icon="icons/table_SysML_Requirement.gif">
+ </editorDiagram>
+ </extension>
+<extension point="org.eclipse.ui.commands">
+ <command categoryId="org.eclipse.papyrus.editor.category" description="Create a new SysML Requirement Table Editor " id="org.eclipse.papyrus.sysml.table.efacet.requirement.creation" name="Create a new SysML Requirement Table Editor ">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ description="Create a new SysML Requirement Table Editor "
+ id="org.eclipse.papyrus.sysml.table.efacet.requirement.creation.withoutdialog"
+ name="Create a new SysML RequirementTable Editor Without Dialog">
+ </command>
+ </extension>
+ <extension point="org.eclipse.ui.handlers">
+ <handler class="org.eclipse.papyrus.sysml.table.efacet.requirement.handler.CreateRequirementTableEditorHandler" commandId="org.eclipse.papyrus.sysml.table.efacet.requirement.creation">
+ <activeWhen>
+ <or>
+ <with variable="activeEditorId">
+ <equals value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </or>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.sysml.table.efacet.requirement.handler.CreateRequirementEditorHandlerWithoutDialog"
+ commandId="org.eclipse.papyrus.sysml.table.efacet.requirement.creation.withoutdialog">
+ <activeWhen>
+ <or>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </or>
+ </activeWhen>
+ </handler>
+ </extension>
+ <extension id="create.table.menus" name="Create Table Menus" point="org.eclipse.ui.menus">
+ <menuContribution allPopups="false" locationURI="popup:org.eclipse.papyrus.views.modelexplorer.popupmenu.table.efacet.creation">
+ <command commandId="org.eclipse.papyrus.sysml.table.efacet.requirement.creation" icon="icons/table_SysML_Requirement.gif" label="SysML Requirement" mnemonic="&amp;G" style="push" tooltip="Create a new SysML Requirement Table">
+ <visibleWhen>
+ <with variable="activeEditorId">
+ <equals value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution allPopups="false" locationURI="menu:org.eclipse.papyrus.ui.menu.efacet.table.creation">
+ <command
+ commandId="org.eclipse.papyrus.sysml.table.efacet.requirement.creation"
+ icon="icons/table_SysML_Requirement.gif"
+ label="SysML Requirement"
+ mnemonic="&amp;G"
+ style="push"
+ tooltip="Create a new SysML Requirement Table">
+ <visibleWhen>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution allPopups="false" locationURI="toolbar:org.eclipse.papyrus.toolbar.table.efacet.creation">
+ <command
+ commandId="org.eclipse.papyrus.sysml.table.efacet.requirement.creation"
+ icon="icons/table_SysML_Requirement.gif"
+ label="SysML Requirement"
+ mnemonic="&amp;G"
+ style="push"
+ tooltip="Create a new SysML Requirement Table">
+ <visibleWhen>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+</plugin>
diff --git a/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/resources/sysml_requirement_table.papyrustableconfiguration b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/resources/sysml_requirement_table.papyrustableconfiguration
new file mode 100644
index 00000000000..521e85dc77d
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/resources/sysml_requirement_table.papyrustableconfiguration
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration:PapyrusTableConfiguration
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:efacet="http://www.eclipse.org/emf/facet/efacet/0.2.incubation/efacet"
+ xmlns:org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration="http://www.eclipse.org/Papyrus/PapyrusTableConfiguration/0.9.0/papyrustableconfiguration"
+ fillingMode="CONTEXT_FEATURE">
+ <listenContextFeature
+ href="http://www.eclipse.org/uml2/4.0.0/UML#//EncapsulatedClassifier/ownedPort"/>
+ <tableConfiguration>
+ <canBePresentedInTheTable
+ xsi:type="efacet:FacetAttribute"
+ href="platform:/plugin/org.eclipse.papyrus.sysml.efacet/resources/sysml.efacet#//Utils/SysMLElement/isRequirement"/>
+ <instantiationMethod name="Requirement In" description="Create a new Requirement">
+ <instantiationOperation
+ href="platform:/plugin/org.eclipse.papyrus.sysml.efacet/resources/sysml.efacet#//Requirements/Requirement/createRequirement"/>
+ </instantiationMethod>
+ <defaultColumns xsi:type="efacet:FacetReference" href="platform:/plugin/org.eclipse.papyrus.infra.emf.efacet/resources/emf.efacet#//Extended_EObject/self"/>
+ <defaultColumns
+ xsi:type="ecore:EAttribute"
+ href="http://www.eclipse.org/uml2/4.0.0/UML#//NamedElement/name"/>
+ </tableConfiguration>
+</org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration:PapyrusTableConfiguration>
diff --git a/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/Activator.java b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/Activator.java
new file mode 100644
index 00000000000..a5740fd607f
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.papyrus.sysml.table.efacet.requirement;
+
+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.table.efacet.requirement"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * 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;
+ }
+
+ /*
+ * (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/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/editor/RequirementTableEditor.java b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/editor/RequirementTableEditor.java
new file mode 100644
index 00000000000..40154ef22ea
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/editor/RequirementTableEditor.java
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.table.efacet.requirement.editor;
+
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.table.efacet.common.editor.AbstractSynchronizedTableEditor;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+
+
+public class RequirementTableEditor extends AbstractSynchronizedTableEditor {
+
+ /** the type of the editor */
+ public static final String EDITOR_TYPE = "PapyrusSysMLRequirementTable"; //$NON-NLS-1$
+
+ /** the default name for this table */
+ public static final String DEFAULT_NAME = "RequirementTable"; //$NON-NLS-1$
+
+ /**
+ * @param servicesRegistry
+ * @param rawModel
+ *
+ */
+ public RequirementTableEditor(final ServicesRegistry servicesRegistry, final PapyrusTable rawModel) {
+ super(servicesRegistry, rawModel);
+ }
+
+
+}
diff --git a/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/factory/RequirementTableEditorFactory.java b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/factory/RequirementTableEditorFactory.java
new file mode 100644
index 00000000000..81f3a084990
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/factory/RequirementTableEditorFactory.java
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+
+package org.eclipse.papyrus.sysml.table.efacet.requirement.factory;
+
+import org.eclipse.papyrus.infra.table.efacet.common.factory.AbstractTableEditorFactory;
+import org.eclipse.papyrus.sysml.table.efacet.requirement.editor.RequirementTableEditor;
+
+
+
+/**
+ *
+ *
+ */
+public class RequirementTableEditorFactory extends AbstractTableEditorFactory {
+
+
+ /**
+ * Constructor.
+ *
+ * @param diagramClass
+ * @param expectedType
+ */
+ public RequirementTableEditorFactory() {
+ super(RequirementTableEditor.class, RequirementTableEditor.EDITOR_TYPE);
+ }
+
+
+}
diff --git a/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/handler/CreateRequirementEditorHandlerWithoutDialog.java b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/handler/CreateRequirementEditorHandlerWithoutDialog.java
new file mode 100644
index 00000000000..bd83611cac7
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/handler/CreateRequirementEditorHandlerWithoutDialog.java
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.table.efacet.requirement.handler;
+
+
+
+public class CreateRequirementEditorHandlerWithoutDialog extends CreateRequirementTableEditorHandler {
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public CreateRequirementEditorHandlerWithoutDialog() {
+ super();
+ }
+
+
+ @Override
+ protected boolean shouldOpenNameDialog() {
+ return false;
+ }
+}
diff --git a/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/handler/CreateRequirementTableEditorHandler.java b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/handler/CreateRequirementTableEditorHandler.java
new file mode 100644
index 00000000000..7688bdd3f89
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.sysml.table.efacet.requirement/src/org/eclipse/papyrus/sysml/table/efacet/requirement/handler/CreateRequirementTableEditorHandler.java
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.table.efacet.requirement.handler;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.table.efacet.common.handlers.AbstractCreateTableEditorHandler;
+import org.eclipse.papyrus.sysml.table.efacet.requirement.Activator;
+import org.eclipse.papyrus.sysml.table.efacet.requirement.editor.RequirementTableEditor;
+
+
+public class CreateRequirementTableEditorHandler extends AbstractCreateTableEditorHandler {
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public CreateRequirementTableEditorHandler() {
+ super(RequirementTableEditor.EDITOR_TYPE, RequirementTableEditor.DEFAULT_NAME);
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.table.efacet.common.handlers.AbstractCreateTableEditorHandler#isEnabled()
+ *
+ * @return
+ */
+ @Override
+ public boolean isEnabled() {
+ final boolean enabled = super.isEnabled();
+ final EObject context = getTableContext();
+ //TODO improve the condition
+// if(context instanceof Element) {
+// return enabled && (UMLUtil.getStereotypeApplication((Element)context, Block.class) != null);
+// }
+ return true;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.table.efacet.common.handlers.AbstractCreateTableEditorHandler#getPapyrusTableConfigurationURI()
+ *
+ * @return
+ */
+ @Override
+ protected URI getPapyrusTableConfigurationURI() {
+ final String symbolicName = Activator.getDefault().getBundle().getSymbolicName();
+ final URI uri = URI.createPlatformPluginURI(symbolicName + "/resources/sysml_requirement_table.papyrustableconfiguration", true); //$NON-NLS-1$
+ return uri;
+ }
+
+}

Back to the top