Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest')
-rw-r--r--tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/build.properties3
-rw-r--r--tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/plugin.xml6
-rw-r--r--tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/LoadRecipeFacet.uiCustom17
-rw-r--r--tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/LoadRecipeFacet2.uiCustom27
-rw-r--r--tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/umlModelExplorerRecipe.facetSet8
-rw-r--r--tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/umlModelExplorerRecipe.querySet8
-rw-r--r--tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/src/org/eclipse/papyrus/uml/modelexplorer/recipetest/GetAllWithoutDependencies.java25
-rw-r--r--tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/src/org/eclipse/papyrus/uml/modelexplorer/recipetest/GetAllWithoutPorts.java26
8 files changed, 118 insertions, 2 deletions
diff --git a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/build.properties b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/build.properties
index a7e9dee91b3..aee52b8c26f 100644
--- a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/build.properties
+++ b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/build.properties
@@ -7,5 +7,6 @@ bin.includes = META-INF/,\
resource/packagedElementsItemLinksWithIcon.uiCustom,\
resource/umlModelExplorerRecipe.querySet,\
resource/umlModelExplorerRecipe.facetSet,\
- resource/LoadRecipeFacet.uiCustom
+ resource/LoadRecipeFacet.uiCustom,\
+ resource/LoadRecipeFacet2.uiCustom
source.. = src/
diff --git a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/plugin.xml b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/plugin.xml
index 4155c1c2e70..cc8a5e8761f 100644
--- a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/plugin.xml
+++ b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/plugin.xml
@@ -20,4 +20,10 @@
<extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
<browserCustomization file="resource/LoadRecipeFacet.uiCustom"/>
</extension>
+ <extension
+ point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <browserCustomization
+ file="resource/LoadRecipeFacet2.uiCustom">
+ </browserCustomization>
+ </extension>
</plugin>
diff --git a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/LoadRecipeFacet.uiCustom b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/LoadRecipeFacet.uiCustom
index 4cbad95ad7e..fc5a3a8371c 100644
--- a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/LoadRecipeFacet.uiCustom
+++ b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/LoadRecipeFacet.uiCustom
@@ -1,2 +1,17 @@
<?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="umlModelExplorerRecipe"/>
+<uicustom:MetamodelView xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8" metamodelURI="umlModelExplorerRecipe">
+ <types metaclassName="umlModelExplorerRecipe.NewClassifier">
+ <references referenceName="ports">
+ <customizedFeatures customizedFeature="icon">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="/org.eclipse.papyrus.icons.uml/resource/gif/Port.gif"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="umlModelExplorerRecipe.NewPackage">
+ <references referenceName="dependencies">
+ <customizedFeatures customizedFeature="icon">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="/org.eclipse.papyrus.icons.uml/resource/gif/Dependency.gif"/>
+ </customizedFeatures>
+ </references>
+ </types>
+</uicustom:MetamodelView>
diff --git a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/LoadRecipeFacet2.uiCustom b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/LoadRecipeFacet2.uiCustom
new file mode 100644
index 00000000000..0ba85cb3abd
--- /dev/null
+++ b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/LoadRecipeFacet2.uiCustom
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ASCII"?>
+<uicustom:MetamodelView xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8" metamodelURI="umlModelExplorerRecipe">
+ <types metaclassName="umlModelExplorerRecipe.NewClassifier">
+ <references referenceName="ports">
+ <customizedFeatures customizedFeature="icon">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="/org.eclipse.papyrus.icons.uml/resource/gif/Port.gif"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="others">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="umlModelExplorerRecipe.NewPackage">
+ <references referenceName="dependencies">
+ <customizedFeatures customizedFeature="icon">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="/org.eclipse.papyrus.icons.uml/resource/gif/Dependency.gif"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="other">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+</uicustom:MetamodelView>
diff --git a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/umlModelExplorerRecipe.facetSet b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/umlModelExplorerRecipe.facetSet
index 5997b8c5aaa..d29c553a59c 100644
--- a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/umlModelExplorerRecipe.facetSet
+++ b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/umlModelExplorerRecipe.facetSet
@@ -6,6 +6,10 @@
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/3.0.0/UML#//Dependency"/>
<valueQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/umlModelExplorerRecipe#getAllDependencies"/>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="facet:FacetReference" name="others" upperBound="-1" changeable="false" volatile="true" unsettable="true" derived="true">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/3.0.0/UML#//PackageableElement"/>
+ <valueQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/umlModelExplorerRecipe#getAllWithoutDependencies"/>
+ </eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="facet:Facet" name="NewClassifier" abstract="true">
<eSuperTypes href="http://www.eclipse.org/uml2/3.0.0/UML#//Classifier"/>
@@ -13,6 +17,10 @@
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/3.0.0/UML#//Property"/>
<valueQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/umlModelExplorerRecipe#getAllPorts"/>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="facet:FacetReference" name="others" upperBound="-1" changeable="false" volatile="true" unsettable="true" derived="true">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/3.0.0/UML#//Property"/>
+ <valueQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/umlModelExplorerRecipe#getAllWithoutPorts"/>
+ </eStructuralFeatures>
</eClassifiers>
<extendedPackage href="http://www.eclipse.org/uml2/3.0.0/UML#/"/>
</facet:FacetSet>
diff --git a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/umlModelExplorerRecipe.querySet b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/umlModelExplorerRecipe.querySet
index 7f5ac542a67..3f765b509ec 100644
--- a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/umlModelExplorerRecipe.querySet
+++ b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/resource/umlModelExplorerRecipe.querySet
@@ -9,4 +9,12 @@
<returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/3.0.0/UML#//Property"/>
<scope href="http://www.eclipse.org/uml2/3.0.0/UML#//Classifier"/>
</queries>
+ <queries xsi:type="query:JavaModelQuery" name="getAllWithoutDependencies" description="get All without Dependencies" upperBound="-1" implementationClassName="org.eclipse.papyrus.uml.modelexplorer.recipetest.GetAllWithoutDependencies">
+ <returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/3.0.0/UML#//PackageableElement"/>
+ <scope href="http://www.eclipse.org/uml2/3.0.0/UML#//Package"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="getAllWithoutPorts" description="get all without ports from a classifier" upperBound="-1" implementationClassName="org.eclipse.papyrus.uml.modelexplorer.recipetest.GetAllWithoutPorts">
+ <returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/uml2/3.0.0/UML#//Property"/>
+ <scope href="http://www.eclipse.org/uml2/3.0.0/UML#//Classifier"/>
+ </queries>
</query:ModelQuerySet>
diff --git a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/src/org/eclipse/papyrus/uml/modelexplorer/recipetest/GetAllWithoutDependencies.java b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/src/org/eclipse/papyrus/uml/modelexplorer/recipetest/GetAllWithoutDependencies.java
new file mode 100644
index 00000000000..74a84fe3565
--- /dev/null
+++ b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/src/org/eclipse/papyrus/uml/modelexplorer/recipetest/GetAllWithoutDependencies.java
@@ -0,0 +1,25 @@
+package org.eclipse.papyrus.uml.modelexplorer.recipetest;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+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.Dependency;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.PackageableElement;
+
+/** get All without Dependencies */
+public class GetAllWithoutDependencies implements IJavaModelQuery<Package, Collection<PackageableElement>> {
+ public Collection<PackageableElement> evaluate(final Package context, final ParameterValueList parameterValues){
+ ArrayList<PackageableElement> result= new ArrayList<PackageableElement>();
+ Iterator<PackageableElement> iter= context.getPackagedElements().iterator();
+ while(iter.hasNext()){
+ PackageableElement currentElement= iter.next();
+ if( !(currentElement instanceof Dependency)){
+ result.add(currentElement);
+ }
+ }
+ return result;
+ }
+}
diff --git a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/src/org/eclipse/papyrus/uml/modelexplorer/recipetest/GetAllWithoutPorts.java b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/src/org/eclipse/papyrus/uml/modelexplorer/recipetest/GetAllWithoutPorts.java
new file mode 100644
index 00000000000..7abac0369ab
--- /dev/null
+++ b/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.modelexplorer.recipetest/src/org/eclipse/papyrus/uml/modelexplorer/recipetest/GetAllWithoutPorts.java
@@ -0,0 +1,26 @@
+package org.eclipse.papyrus.uml.modelexplorer.recipetest;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+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.Classifier;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.Property;
+
+/** get all without ports from a classifier */
+public class GetAllWithoutPorts implements IJavaModelQuery<Classifier, Collection<Property>> {
+ public Collection<Property> evaluate(final Classifier context, final ParameterValueList parameterValues){
+ ArrayList<Property> result= new ArrayList<Property>();
+ Iterator<Property> iter= context.getAllAttributes().iterator();
+ while(iter.hasNext()){
+ Property currentElement= iter.next();
+ if( !(currentElement instanceof Port)){
+ result.add(currentElement);
+ }
+ }
+ return result;
+ }
+}

Back to the top