Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration')
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/META-INF/MANIFEST.MF4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.facetset37
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.querySet23
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/plugin.xml2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetDrawerLabelQuery.java17
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetIconQuery.java19
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetToolLabelQuery.java53
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/HasIconQuery.java17
8 files changed, 75 insertions, 97 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/META-INF/MANIFEST.MF b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/META-INF/MANIFEST.MF
index a35c8da0004..5429da82ed3 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/META-INF/MANIFEST.MF
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/META-INF/MANIFEST.MF
@@ -3,10 +3,10 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.core.runtime;bundle-version="3.7.0",
org.eclipse.papyrus.uml.diagram.paletteconfiguration;bundle-version="1.0.0",
org.eclipse.uml2.uml;bundle-version="3.2.0",
- org.eclipse.emf.facet.infra.query.core;bundle-version="0.1.0",
org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
org.eclipse.papyrus.infra.extendedtypes;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit;bundle-version="1.0.0"
+ org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit;bundle-version="1.0.0",
+ org.eclipse.papyrus.emf.facet.query.java.core;bundle-version="0.4.0"
Export-Package: org.eclipse.papyrus.customization.paletteconfiguration,
org.eclipse.papyrus.customization.paletteconfiguration.queries
Bundle-Vendor: %Bundle-Vendor
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.facetset b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.facetset
new file mode 100644
index 00000000000..be0f12298f0
--- /dev/null
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.facetset
@@ -0,0 +1,37 @@
+<efacet:FacetSet 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:query="http://www.eclipse.org/emf/facet/efacet/0.2.incubation/efacet/query"
+ xmlns:javaQuery2="http://www.eclipse.org/emf/facet/query/java/0.2.incubation"
+ xmlns:library="http://www.eclipse.org/emf/facet/examples/library/0.2.incubation/library"
+ name="org.eclipse.emf.facet.efacet.examples.library.core.facet"
+ documentation="Queries">
+ <eSubpackages xsi:type="efacet:FacetSet" name="PaletteConfiguration" documentation="PaletteConfiguration">
+ <eClassifiers xsi:type="efacet:Facet" name="Configuration" documentation="Configuration">
+ <extendedMetaclass href="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7#//Configuration"/>
+ <facetOperations xsi:type="efacet:FacetOperation" name="hasIcon" lowerBound="1" documentation="Returns true if the element has a specific icon to display" >
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//Boolean"/>
+ <query xsi:type="javaQuery2:JavaQuery" implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.HasIconQuery"/>
+ </facetOperations>
+ <facetOperations xsi:type="efacet:FacetOperation" name="getIcon" lowerBound="1" documentation="Gets the icon for a configuration element in the palette configuration model" >
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
+ <query xsi:type="javaQuery2:JavaQuery" implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.GetIconQuery"/>
+ </facetOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="efacet:Facet" name="ToolConfiguration" documentation="ToolConfiguration">
+ <extendedMetaclass href="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7#//ToolConfiguration"/>
+ <facetOperations xsi:type="efacet:FacetOperation" name="getToolLabel" lowerBound="1" documentation="Returns the Label for a tool." >
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
+ <query xsi:type="javaQuery2:JavaQuery" implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.GetToolLabelQuery"/>
+ </facetOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="efacet:Facet" name="DrawerConfiguration" documentation="DrawerConfiguration">
+ <extendedMetaclass href="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7#//DrawerConfiguration"/>
+ <facetOperations xsi:type="efacet:FacetOperation" name="getDrawerLabel" documentation="Returns the label for a drawer">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
+ <query xsi:type="javaQuery2:JavaQuery" implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.GetDrawerLabelQuery"/>
+ </facetOperations>
+ </eClassifiers>
+ </eSubpackages>
+</efacet:FacetSet> \ No newline at end of file
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.querySet b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.querySet
deleted file mode 100644
index fa9003faf65..00000000000
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.querySet
+++ /dev/null
@@ -1,23 +0,0 @@
-<?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="PaletteConfiguration" description="Query Set For Palette Configuration">
- <associatedMetamodels href="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7#/"/>
- <associatedMetamodels href="http://www.eclipse.org/emf/2002/Ecore#/"/>
- <associatedMetamodels href="http://www.eclipse.org/uml2/4.0.0/UML#/"/>
- <associatedMetamodels href="http://www.eclipse.org/uml2/4.0.0/Types#/"/>
- <queries xsi:type="query:JavaModelQuery" name="getIcon" description="Gets the icon for a configuration element in the palette configuration model" implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.GetIconQuery">
- <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
- <scope href="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7#//Configuration"/>
- </queries>
- <queries xsi:type="query:JavaModelQuery" name="hasIcon" description="Returns &lt;code>true&lt;/code> if the element has a specific icon to display" implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.HasIconQuery">
- <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//Boolean"/>
- <scope href="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7#//Configuration"/>
- </queries>
- <queries xsi:type="query:JavaModelQuery" name="getToolLabel" description="Returns the Label for a tool." implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.GetToolLabelQuery">
- <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
- <scope href="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7#//ToolConfiguration"/>
- </queries>
- <queries xsi:type="query:JavaModelQuery" name="getDrawerLabel" description="Returns the label for a drawer" implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.GetDrawerLabelQuery">
- <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
- <scope href="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7#//DrawerConfiguration"/>
- </queries>
-</query:ModelQuerySet>
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/plugin.xml b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/plugin.xml
index 845efa5865c..ea7b0bf10ec 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/plugin.xml
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/plugin.xml
@@ -2,10 +2,12 @@
<?eclipse version="3.4"?>
<plugin>
+<!-- TODO: PAPYRUS EMF-FACET
<extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
<browserCustomization file="facet/PaletteConfiguration.uiCustom"/>
</extension>
<extension point="org.eclipse.emf.facet.infra.query.registration">
<modelqueryset file="facet/PaletteConfiguration.querySet"/>
</extension>
+ -->
</plugin>
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetDrawerLabelQuery.java b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetDrawerLabelQuery.java
index 5390581b77d..e277e3c17df 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetDrawerLabelQuery.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetDrawerLabelQuery.java
@@ -1,14 +1,15 @@
package org.eclipse.papyrus.customization.paletteconfiguration.queries;
-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.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.DrawerConfiguration;
/** Returns the label for a drawer */
-public class GetDrawerLabelQuery implements IJavaModelQuery<DrawerConfiguration, String> {
- public String evaluate(final DrawerConfiguration context, final ParameterValueList parameterValues)
- throws ModelQueryExecutionException {
-
- return (context.getLabel() !=null ? context.getLabel() : "<>");
+public class GetDrawerLabelQuery implements IJavaQuery2<DrawerConfiguration, String> {
+
+ public String evaluate(DrawerConfiguration source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ return (source.getLabel() !=null ? source.getLabel() : "<>");
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetIconQuery.java b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetIconQuery.java
index 04d3a70d940..39f5d75a04d 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetIconQuery.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetIconQuery.java
@@ -1,22 +1,19 @@
package org.eclipse.papyrus.customization.paletteconfiguration.queries;
-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.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Configuration;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.IconDescriptor;
/** Gets the icon for a configuration element in the palette configuration model */
-public class GetIconQuery implements IJavaModelQuery<Configuration, String> {
-
- /**
- * {@inheritDoc}
- */
- public String evaluate(final Configuration context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+public class GetIconQuery implements IJavaQuery2<Configuration, String> {
+ public String evaluate(Configuration source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
// retrieves icon descriptor
- IconDescriptor descriptor = context.getIcon();
+ IconDescriptor descriptor = source.getIcon();
if(descriptor == null) {
return "";
}
@@ -29,6 +26,6 @@ public class GetIconQuery implements IJavaModelQuery<Configuration, String> {
}
return "/" + bundleID + iconPath;
-
}
+
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetToolLabelQuery.java b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetToolLabelQuery.java
index 3af1d78a2ab..1077ea87f85 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetToolLabelQuery.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetToolLabelQuery.java
@@ -13,21 +13,19 @@
*****************************************************************************/
package org.eclipse.papyrus.customization.paletteconfiguration.queries;
-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.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration;
/** Returns the Label for a tool. */
-public class GetToolLabelQuery implements IJavaModelQuery<ToolConfiguration, String> {
+public class GetToolLabelQuery implements IJavaQuery2<ToolConfiguration, String> {
- /**
- * {@inheritDoc}
- */
- public String evaluate(final ToolConfiguration context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ public String evaluate(ToolConfiguration source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
StringBuffer buffer = new StringBuffer();
buffer.append('[');
- switch(context.getKind()) {
+ switch(source.getKind()) {
case CONNECTION_TOOL:
buffer.append("Connection Tool");
break;
@@ -39,42 +37,7 @@ public class GetToolLabelQuery implements IJavaModelQuery<ToolConfiguration, Str
buffer.append(' ');
- buffer.append(context.getLabel());
-
- // // retrieves list of types to create
- // List<IElementType> typesToCreate = new ArrayList<IElementType>();
- // for(ElementDescriptor descriptor : context.getElementDescriptors()) {
- // IElementType type = ExtendedTypesRegistry.getInstance().getType(descriptor.getElementTypeId());
- // if(type != null) {
- // typesToCreate.add(type);
- // }
- // }
- //
- // // filter the list (removes all elements that create the same metaclass, but with different representation. this is caused by standard GMF tooling generation
- // List<IElementType> filteredList = new ArrayList<IElementType>();
- // for(IElementType type : typesToCreate) {
- // boolean toAdd = true;
- // for(IElementType typeInFilteredList : filteredList) {
- // boolean isEquivalent = ElementTypeUtils.isSemanticallyEquivalent(typeInFilteredList, type);
- // if(isEquivalent) {
- // toAdd = false;
- // }
- // }
- //
- // if(toAdd) {
- // filteredList.add(type);
- // }
- // }
- //
- // Iterator<IElementType> it = filteredList.iterator();
- // while(it.hasNext()) {
- // IElementType type = it.next();
- // buffer.append(type.getDisplayName());
- // if(it.hasNext()) {
- // buffer.append(", ");
- // }
- // }
-
+ buffer.append(source.getLabel());
return buffer.toString();
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/HasIconQuery.java b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/HasIconQuery.java
index 77a9cc765fd..3bcde535f14 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/HasIconQuery.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/HasIconQuery.java
@@ -1,16 +1,17 @@
package org.eclipse.papyrus.customization.paletteconfiguration.queries;
-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.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Configuration;
/** Returns <code>true</code> if the element has a specific icon to display */
-public class HasIconQuery implements IJavaModelQuery<Configuration, Boolean> {
- public Boolean evaluate(final Configuration context, final ParameterValueList parameterValues)
- throws ModelQueryExecutionException {
+public class HasIconQuery implements IJavaQuery2<Configuration, Boolean> {
+
- IJavaModelQuery<Configuration, String> getImageQuery = new GetIconQuery();
- String imagePath = getImageQuery.evaluate(context, parameterValues);
+ public Boolean evaluate(Configuration source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ IJavaQuery2<Configuration, String> getImageQuery = new GetIconQuery();
+ String imagePath = getImageQuery.evaluate(source, parameterValues, facetManager);
if(imagePath!=null && imagePath.length() > 0) {
return true;

Back to the top