Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2011-10-25 13:20:56 +0000
committercletavernie2011-10-25 13:20:56 +0000
commit8cdc737aa46551e5708103da8564b5389b074ea1 (patch)
tree7befcecf1a95680d3d7f13aca51dd9b30b254551 /plugins/sysml/table
parent2dd422b8503feecdcfa3e021dbbf6ba7c0394be4 (diff)
downloadorg.eclipse.papyrus-8cdc737aa46551e5708103da8564b5389b074ea1.tar.gz
org.eclipse.papyrus-8cdc737aa46551e5708103da8564b5389b074ea1.tar.xz
org.eclipse.papyrus-8cdc737aa46551e5708103da8564b5389b074ea1.zip
359057: [Architecture - SVN - Build] The Papyrus architecture should be refactored
https://bugs.eclipse.org/bugs/show_bug.cgi?id=359057
Diffstat (limited to 'plugins/sysml/table')
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/.classpath7
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/.project34
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/META-INF/MANIFEST.MF25
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/about.html28
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/build.properties7
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/allocation_table.gifbin0 -> 978 bytes
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/allocation_table.pngbin0 -> 1360 bytes
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/table_SysML_Allocation.gifbin0 -> 898 bytes
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/table_SysML_Allocation.pngbin0 -> 1261 bytes
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/plugin.properties3
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/plugin.xml64
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/allocate.querySet19
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/allocate.tableconfiguration213
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/table_SysML_Allocation_showOnlyClientAndSupplier.uiCustom90
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/Activator.java45
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableCommand.java86
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableFactory.java36
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/editor/AllocationTableEditor.java43
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/CreateAbstractionQuery.java68
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/CreateAllocateQuery.java69
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/IsAllocateQuery.java45
-rw-r--r--plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/tester/AllocationPropertyTester.java62
22 files changed, 744 insertions, 0 deletions
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/.classpath b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/.classpath
new file mode 100644
index 00000000000..45f024e850e
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="output" path="bin"/>
+</classpath>
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/.project b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/.project
new file mode 100644
index 00000000000..8415b6fa7a1
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml.table.allocation</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>
+ <buildCommand>
+ <name>org.eclipse.emf.facet.common.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.emf.facet.common.ProjectNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/META-INF/MANIFEST.MF b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..f073b8e5ec8
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.emf.facet.infra.common.core,
+ org.eclipse.emf.facet.infra.query.core,
+ org.eclipse.papyrus.service.edit;bundle-version="0.8.0",
+ org.eclipse.papyrus.sysml.service.types;bundle-version="0.8.0",
+ org.eclipse.papyrus.diagram.common;bundle-version="0.8.0",
+ org.eclipse.papyrus.table.common,
+ org.eclipse.core.expressions,
+ org.eclipse.papyrus.table.instance;bundle-version="0.8.0",
+ org.eclipse.emf.facet.widgets.nattable;bundle-version="0.1.0",
+ org.eclipse.emf.facet.widgets.nattable.tableconfiguration;bundle-version="0.1.0",
+ org.eclipse.emf.facet.widgets.nattable.instance;bundle-version="0.1.0",
+ org.eclipse.papyrus.sysml
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .,bin
+Bundle-Version: 0.9.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Activator: org.eclipse.papyrus.sysml.table.allocation.Activator
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.table.allocation;single
+ ton:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/about.html b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/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>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). 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, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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>
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/build.properties b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/build.properties
new file mode 100644
index 00000000000..03dcecf39d8
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/build.properties
@@ -0,0 +1,7 @@
+#
+#Mon Sep 12 09:30:17 CEST 2011
+bin.includes=META-INF/,.,plugin.properties,resources/,plugin.xml,icons/,about.html
+output..=bin/
+src.includes=about.html,resources/,icons/,META-INF/,.,plugin.properties,plugin.xml
+source..=src/
+bin..=bin/
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/allocation_table.gif b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/allocation_table.gif
new file mode 100644
index 00000000000..01476ab60c0
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/allocation_table.gif
Binary files differ
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/allocation_table.png b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/allocation_table.png
new file mode 100644
index 00000000000..757b31ce86b
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/allocation_table.png
Binary files differ
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/table_SysML_Allocation.gif b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/table_SysML_Allocation.gif
new file mode 100644
index 00000000000..da218ead152
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/table_SysML_Allocation.gif
Binary files differ
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/table_SysML_Allocation.png b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/table_SysML_Allocation.png
new file mode 100644
index 00000000000..761ea002323
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/icons/table_SysML_Allocation.png
Binary files differ
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/plugin.properties b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/plugin.properties
new file mode 100644
index 00000000000..842ff06fe4c
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/plugin.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.sysml.table.allocation
+providerName = Eclipse Modeling Project
+pluginName = Papyrus Table Editor For Allocation \ No newline at end of file
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/plugin.xml b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/plugin.xml
new file mode 100644
index 00000000000..dab2e4dbdab
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/plugin.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse version="3.4"?>
+
+<plugin>
+ <extension point="org.eclipse.papyrus.core.papyrusDiagram">
+ <editorDiagram factoryClass="org.eclipse.papyrus.sysml.table.allocation.CreateAllocationTableFactory" icon="icons/table_SysML_Allocation.gif">
+ </editorDiagram>
+ </extension>
+ <extension point="org.eclipse.ui.menus">
+ <menuContribution allPopups="false" locationURI="toolbar:org.eclipse.papyrus.table.ui.toolbar">
+ <command commandId="org.eclipse.papyrus.sysml.table.allocation.create.table.command" icon="icons/table_SysML_Allocation.gif" id="org.eclipse.papyrus.table.ui.toolbar.allocation.table" style="push" tooltip="Create a new SysML Allocation table">
+ <visibleWhen>
+ <reference
+ definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML">
+ </reference>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution allPopups="false" locationURI="popup:org.eclipse.papyrus.modelexplorer.popupmenu.createtable">
+ <command commandId="org.eclipse.papyrus.sysml.table.allocation.create.table.command" icon="icons/table_SysML_Allocation.gif" id="org.eclipse.papyrus.modelexplorer.popupmenu.createtable.allocation.table" style="push" tooltip="Create a new SysML Allocation table">
+ <visibleWhen>
+ <reference
+ definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML">
+ </reference>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution allPopups="false" locationURI="menu:org.eclipse.papyrus.table.ui.menu.tables">
+ <command commandId="org.eclipse.papyrus.sysml.table.allocation.create.table.command" icon="icons/table_SysML_Allocation.gif" id="org.eclipse.papyrus.table.ui.menu.tables.allocation.table" style="push" tooltip="Create a new SysML Allocation table">
+ <visibleWhen>
+ <reference
+ definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML">
+ </reference>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension point="org.eclipse.ui.commands">
+ <command categoryId="org.eclipse.papyrus.editor.category" description="Create a new SysML Allocation table" id="org.eclipse.papyrus.sysml.table.allocation.create.table.command" name="SysML &amp;Allocation Table">
+ </command>
+ </extension>
+ <extension point="org.eclipse.ui.handlers">
+ <handler class="org.eclipse.papyrus.sysml.table.allocation.CreateAllocationTableCommand" commandId="org.eclipse.papyrus.sysml.table.allocation.create.table.command">
+ <activeWhen>
+ <and>
+ <with variable="selection">
+ <test forcePluginActivation="true" property="org.eclipse.papyrus.sysml.table.allocation.tester.isAppliedAllocations" value="true">
+ </test>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
+ </extension>
+ <extension point="org.eclipse.emf.facet.infra.query.registration">
+ <modelqueryset file="resources/allocate.querySet"/>
+ </extension>
+ <extension point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester class="org.eclipse.papyrus.sysml.table.allocation.tester.AllocationPropertyTester" id="org.eclipse.papyrus.sysml.table.allocation.tester" namespace="org.eclipse.papyrus.sysml.table.allocation.tester" properties="isAppliedAllocations" type="org.eclipse.jface.viewers.IStructuredSelection">
+ </propertyTester>
+ </extension>
+ <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <browserCustomization file="resources/table_SysML_Allocation_showOnlyClientAndSupplier.uiCustom"/>
+ </extension>
+</plugin>
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/allocate.querySet b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/allocate.querySet
new file mode 100644
index 00000000000..7f57f0ecd96
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/allocate.querySet
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ASCII"?>
+<query:ModelQuerySet 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:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="allocate" description="Query Set for Allocation">
+ <associatedMetamodels href="http://www.eclipse.org/uml2/3.0.0/UML#/"/>
+ <associatedMetamodels href="http://www.eclipse.org/papyrus/0.7.0/SysML#/"/>
+ <associatedMetamodels href="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8#/"/>
+ <associatedMetamodels href="http://www.eclipse.org/emf/2002/Ecore#/"/>
+ <queries xsi:type="query:JavaModelQuery" name="IsAllocateQuery" description="Test is the element is an Allocate" implementationClassName="org.eclipse.papyrus.sysml.table.allocation.queries.IsAllocateQuery">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <scope href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="CreateAbstractionQuery" description="Create a new Abstraction" lowerBound="1" implementationClassName="org.eclipse.papyrus.sysml.table.allocation.queries.CreateAbstractionQuery">
+ <returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/3.0.0/UML#//Abstraction"/>
+ <scope href="http://www.eclipse.org/uml2/3.0.0/UML#//Package"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="CreateAllocateQuery" description="Create a new Allocation" lowerBound="1" implementationClassName="org.eclipse.papyrus.sysml.table.allocation.queries.CreateAllocateQuery">
+ <returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/3.0.0/UML#//Abstraction"/>
+ <scope href="http://www.eclipse.org/uml2/3.0.0/UML#//Package"/>
+ </queries>
+</query:ModelQuerySet>
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/allocate.tableconfiguration2 b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/allocate.tableconfiguration2
new file mode 100644
index 00000000000..25bdafe1803
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/allocate.tableconfiguration2
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tableconfiguration2:TableConfiguration2 xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" xmlns:tableconfiguration2="http://www.eclipse.org/EMF_Facet/Table/0.1.0/tableconfiguration2">
+ <canBePresentedInTheTable xsi:type="query:JavaModelQuery" href="emffacet:/query/allocate#IsAllocateQuery"/>
+ <defaultCustomizations href="emffacet:/customization/SysMLDefaultExplorerCustomization#/"/>
+ <instantiationMethod name="CreateAbstractionQuery" description="Create a new Abstraction">
+ <instantiationQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/allocate#CreateAbstractionQuery"/>
+ </instantiationMethod>
+ <instantiationMethod name="CreateAllocateQuery" description="Create a new Allocate">
+ <instantiationQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/allocate#CreateAllocateQuery"/>
+ </instantiationMethod>
+ <defaultLocalCustomizations href="emffacet:/customization/table_Ecore_hideEAnnotationFeature#/"/>
+ <defaultLocalCustomizations href="emffacet:/customization/table_SysML_Allocation_showOnlyClientAndSupplier#/"/>
+</tableconfiguration2:TableConfiguration2>
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/table_SysML_Allocation_showOnlyClientAndSupplier.uiCustom b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/table_SysML_Allocation_showOnlyClientAndSupplier.uiCustom
new file mode 100644
index 00000000000..f760181f0e3
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/resources/table_SysML_Allocation_showOnlyClientAndSupplier.uiCustom
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="ASCII"?>
+<uicustom:MetamodelView xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8" metamodelURI="http://www.eclipse.org/uml2/3.0.0/UML" allQuerySetsAvailable="false">
+ <types metaclassName="uml.Element">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedComment">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.NamedElement">
+ <attributes attributeName="name">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </attributes>
+ <attributes attributeName="visibility">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </attributes>
+ <attributes attributeName="qualifiedName">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </attributes>
+ <references referenceName="clientDependency">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="nameExpression">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ParameterableElement">
+ <references referenceName="owningTemplateParameter">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="templateParameter">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Relationship">
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DirectedRelationship">
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Abstraction">
+ <references referenceName="mapping">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+</uicustom:MetamodelView> \ No newline at end of file
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/Activator.java b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/Activator.java
new file mode 100644
index 00000000000..5f829acfd95
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/Activator.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Mia-Software.
+ * 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:
+ * Nicolas Bros (Mia-Software)
+ *******************************************************************************/
+package org.eclipse.papyrus.sysml.table.allocation;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/** The activator class controls the plug-in life cycle */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.sysml.table.allocation"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ @Override
+ public void start(final BundleContext context) throws Exception {
+ super.start(context);
+ Activator.plugin = this;
+ }
+
+ @Override
+ public void stop(final BundleContext context) throws Exception {
+ Activator.plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return Activator.plugin;
+ }
+}
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableCommand.java b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableCommand.java
new file mode 100644
index 00000000000..7dcac8210af
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableCommand.java
@@ -0,0 +1,86 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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.allocation;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.facet.widgets.nattable.tableconfiguration2.TableConfiguration2;
+import org.eclipse.papyrus.sysml.table.allocation.editor.AllocationTableEditor;
+import org.eclipse.papyrus.sysml.util.SysmlResource;
+import org.eclipse.papyrus.table.common.handlers.AbstractCreateNattableEditorCommand;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+
+
+
+/**
+ * The command to create the Requirement Table
+ *
+ *
+ *
+ */
+public class CreateAllocationTableCommand extends AbstractCreateNattableEditorCommand {
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public CreateAllocationTableCommand() {
+ super(AllocationTableEditor.EDITOR_TYPE, AllocationTableEditor.DEFAULT_NAME);
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.table.common.handlers.AbstractCreateNattableEditorCommand#getTableConfiguration()
+ *
+ * @return
+ */
+ @Override
+ protected TableConfiguration2 getTableConfiguration2() {
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ String symbolicName = Activator.getDefault().getBundle().getSymbolicName();
+ URI uri = URI.createPlatformPluginURI(symbolicName + "/resources/allocate.tableconfiguration2", true); //$NON-NLS-1$
+ Resource resource = resourceSet.getResource(uri, true);
+
+ TableConfiguration2 tableConfiguration = null;
+ if(resource.getContents().get(0) instanceof org.eclipse.emf.facet.widgets.nattable.tableconfiguration.TableConfiguration) {
+ tableConfiguration = (TableConfiguration2)resource.getContents().get(0);
+ return tableConfiguration;
+ }
+ return null;
+ }
+ /**
+ *
+ * @see org.eclipse.papyrus.table.common.handlers.AbstractCreateNattableEditorCommand#isEnabled()
+ *
+ * @return
+ */
+ @Override
+ public boolean isEnabled() {
+ EObject object = getTableContext();
+ if(object instanceof Element) {
+ Element el = (Element)object;
+ Package pack = el.getNearestPackage();
+ //we can create an Allocation Table only when the profile is applied
+ return pack.getAppliedProfile(SysmlResource.ALLOCATIONS_ID, true) != null;
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableFactory.java b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableFactory.java
new file mode 100644
index 00000000000..60db909131b
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/CreateAllocationTableFactory.java
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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.allocation;
+
+import org.eclipse.papyrus.sysml.table.allocation.editor.AllocationTableEditor;
+import org.eclipse.papyrus.table.common.factory.AbstractNattableEditorFactory;
+
+/**
+ * the factory for the AllocationTable
+ *
+ *
+ *
+ */
+public class CreateAllocationTableFactory extends AbstractNattableEditorFactory {
+
+ /**
+ * Constructor.
+ *
+ * @param diagramClass
+ * @param expectedType
+ */
+ public CreateAllocationTableFactory() {
+ super(AllocationTableEditor.class, AllocationTableEditor.EDITOR_TYPE);
+ }
+}
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/editor/AllocationTableEditor.java b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/editor/AllocationTableEditor.java
new file mode 100644
index 00000000000..6c41d9ad24b
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/editor/AllocationTableEditor.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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.allocation.editor;
+
+import org.eclipse.papyrus.core.services.ServicesRegistry;
+import org.eclipse.papyrus.table.common.editor.AbstractNattableEditor;
+import org.eclipse.papyrus.table.instance.papyrustableinstance.PapyrusTableInstance;
+
+
+/**
+ *
+ * The requirement table editor
+ *
+ */
+public class AllocationTableEditor extends AbstractNattableEditor {
+
+
+ /** the type of the editor */
+ public static final String EDITOR_TYPE = "PapyrusAllocationTable"; //$NON-NLS-1$
+
+ public static final String DEFAULT_NAME = "AllocationTable"; //$NON-NLS-1$
+
+ /**
+ * @param servicesRegistry
+ * @param rawModel2
+ *
+ */
+ public AllocationTableEditor(ServicesRegistry servicesRegistry, PapyrusTableInstance rawModel) {
+ super(servicesRegistry, rawModel);
+ }
+
+}
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/CreateAbstractionQuery.java b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/CreateAbstractionQuery.java
new file mode 100644
index 00000000000..e5bce405b57
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/CreateAbstractionQuery.java
@@ -0,0 +1,68 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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.allocation.queries;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
+import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
+import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
+import org.eclipse.emf.facet.infra.query.runtime.ModelQueryParameterValue;
+import org.eclipse.emf.facet.widgets.celleditors.ICommandFactoriesRegistry;
+import org.eclipse.emf.facet.widgets.celleditors.ICommandFactory;
+import org.eclipse.emf.facet.widgets.nattable.tableconfiguration.InstantiationMethodParameters;
+import org.eclipse.uml2.uml.Abstraction;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/** Create a new Abstraction */
+public class CreateAbstractionQuery implements IJavaModelQuery<Package, Abstraction> {
+
+ /**
+ *
+ * @see org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery#evaluate(org.eclipse.emf.ecore.EObject,
+ * org.eclipse.emf.facet.infra.query.core.java.ParameterValueList)
+ *
+ * @param context
+ * @param parameterValues
+ * @return
+ * @throws ModelQueryExecutionException
+ */
+ public Abstraction evaluate(final Package context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ EditingDomain editingDomain = null;
+ ModelQueryParameterValue model = parameterValues.getParameterValueByName(InstantiationMethodParameters.getEditingDomainParameter().getName());
+ if(model != null) {
+ if(model.getValue() instanceof EditingDomain) {
+ editingDomain = (EditingDomain)model.getValue();
+ }
+ }
+ if(editingDomain != null) {
+ ICommandFactory commandFactory = ICommandFactoriesRegistry.INSTANCE.getCommandFactoryFor(editingDomain);
+
+ if(context != null) {
+ Abstraction abstraction = UMLFactory.eINSTANCE.createAbstraction();
+
+ String name = org.eclipse.papyrus.diagram.common.helper.NamedElementHelper.EINSTANCE.getNewUMLElementName(context, abstraction.eClass());
+ abstraction.setName(name);
+ Command command = commandFactory.createAddCommand(editingDomain, context, UMLPackage.eINSTANCE.getPackage_PackagedElement(), abstraction);
+
+ editingDomain.getCommandStack().execute(command);
+ return abstraction;
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/CreateAllocateQuery.java b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/CreateAllocateQuery.java
new file mode 100644
index 00000000000..b389d954c78
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/CreateAllocateQuery.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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.allocation.queries;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
+import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
+import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
+import org.eclipse.emf.facet.infra.query.runtime.ModelQueryParameterValue;
+import org.eclipse.emf.facet.widgets.nattable.tableconfiguration.InstantiationMethodParameters;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.service.edit.service.IElementEditService;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.uml2.uml.Abstraction;
+import org.eclipse.uml2.uml.Package;
+
+/** Test if the element is an Allocation */
+public class CreateAllocateQuery implements IJavaModelQuery<Package, Abstraction> {
+
+ /**
+ *
+ * @see org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery#evaluate(org.eclipse.emf.ecore.EObject,
+ * org.eclipse.emf.facet.infra.query.core.java.ParameterValueList)
+ *
+ * @param context
+ * @param parameterValues
+ * @return
+ * @throws ModelQueryExecutionException
+ */
+ public Abstraction evaluate(final Package context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ EditingDomain editingDomain = null;
+ ModelQueryParameterValue model = parameterValues.getParameterValueByName(InstantiationMethodParameters.getEditingDomainParameter().getName());
+ if(model != null) {
+ if(model.getValue() instanceof EditingDomain) {
+ editingDomain = (EditingDomain)model.getValue();
+ }
+ }
+ if(editingDomain != null) {
+ if(context != null) {
+
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(context);
+ CreateElementRequest createRequest = new CreateElementRequest(context, SysMLElementTypes.ALLOCATE);
+ ICommand createGMFCommand = provider.getEditCommand(createRequest);
+ editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(createGMFCommand));
+ if(createGMFCommand.getCommandResult() != null) {//when the Model is not a SysML model, return null!
+ Object returnedValue = createGMFCommand.getCommandResult().getReturnValue();
+ return (Abstraction)returnedValue;
+ }
+ return null;
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/IsAllocateQuery.java b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/IsAllocateQuery.java
new file mode 100644
index 00000000000..b03802e2afb
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/queries/IsAllocateQuery.java
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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.allocation.queries;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
+import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
+import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
+import org.eclipse.uml2.uml.Abstraction;
+import org.eclipse.uml2.uml.Stereotype;
+
+/** Test is the element is an Abstraction */
+public class IsAllocateQuery implements IJavaModelQuery<EObject, Boolean> {
+
+ /**
+ *
+ * @see org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery#evaluate(org.eclipse.emf.ecore.EObject,
+ * org.eclipse.emf.facet.infra.query.core.java.ParameterValueList)
+ *
+ * @param context
+ * @param parameterValues
+ * @return
+ * @throws ModelQueryExecutionException
+ */
+ public Boolean evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+
+ if(context instanceof Abstraction) {
+ Abstraction abstraction = (Abstraction)context;
+ Stereotype ste = abstraction.getAppliedStereotype("SysML::Allocations::Allocate"); //$NON-NLS-1$
+ return new Boolean(ste != null);
+ }
+ return new Boolean(false);
+ }
+}
diff --git a/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/tester/AllocationPropertyTester.java b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/tester/AllocationPropertyTester.java
new file mode 100644
index 00000000000..3677994f225
--- /dev/null
+++ b/plugins/sysml/table/org.eclipse.papyrus.sysml.table.allocation/src/org/eclipse/papyrus/sysml/table/allocation/tester/AllocationPropertyTester.java
@@ -0,0 +1,62 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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.allocation.tester;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.sysml.table.allocation.CreateAllocationTableCommand;
+
+/**
+ * Property tester for Allocation Table
+ *
+ *
+ *
+ */
+public class AllocationPropertyTester extends PropertyTester {
+
+ /**
+ * the property to test
+ */
+ public static final String IS_APPLIED_ALLOCATIONS = "isAppliedAllocations"; //$NON-NLS-1$
+
+ /**
+ *
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ *
+ * @param receiver
+ * @param property
+ * @param args
+ * @param expectedValue
+ * @return
+ */
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ if(IS_APPLIED_ALLOCATIONS.equals(property) && receiver instanceof IStructuredSelection) {
+ boolean currentValue = testIsAppliedAllocation((IStructuredSelection)receiver);
+ return (new Boolean(currentValue).equals(expectedValue));
+ }
+ return false;
+ }
+
+ /**
+ * returns <code>true</code> if the first selected element is inside a package where the profile SysML::Allocations is applied
+ *
+ * @param selection
+ * @return
+ */
+ private boolean testIsAppliedAllocation(IStructuredSelection selection) {
+ CreateAllocationTableCommand handler = new CreateAllocationTableCommand();
+ return handler.isEnabled();
+ }
+
+}

Back to the top