Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-02-18 10:54:29 +0000
committerptessier2014-02-18 10:54:29 +0000
commit8cd40030ff262e39496ef4306b3d39542a8a3098 (patch)
treeff2cd33c41482bac48319ffddf444d7150ac2d3d
parentd668cabc2926a5560c9ba80b83504c8f95c47b3d (diff)
downloadorg.eclipse.papyrus-8cd40030ff262e39496ef4306b3d39542a8a3098.tar.gz
org.eclipse.papyrus-8cd40030ff262e39496ef4306b3d39542a8a3098.tar.xz
org.eclipse.papyrus-8cd40030ff262e39496ef4306b3d39542a8a3098.zip
386118: [EMF Facet] Papyrus should progressively support EMF Facet 0.2
https://bugs.eclipse.org/bugs/show_bug.cgi?id=386118
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.custom34
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/preview/Preview.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/GenericAttributeModelElement.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextContentProvider.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextLabelProvider.java3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java16
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetDiagramIcon.java14
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java16
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/EMFQueryConstraint.java105
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/providers/ModifySemanticValuesActionProvider.java2
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/advices/ExtendedTypesOwnerAdvice.java28
-rw-r--r--plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration.edit/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration.edit/src-gen/org/eclipse/papyrus/infra/queries/core/configuration/provider/ConfigurationEditPlugin.java7
-rw-r--r--plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration/META-INF/MANIFEST.MF1
-rw-r--r--plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration/src-gen/org/eclipse/papyrus/infra/queries/core/configuration/impl/ConfigurationPackageImpl.java9
-rw-r--r--plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/META-INF/MANIFEST.MF3
-rw-r--r--plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/src/org/eclipse/papyrus/infra/queries/core/converter/ConverterRegistry.java20
-rw-r--r--plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/src/org/eclipse/papyrus/infra/queries/core/modisco/QueryUtil.java807
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.decoration/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.decoration/src/org/eclipse/papyrus/infra/services/decoration/util/DecorationUtils.java6
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF3
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml4
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetImageQuery.java18
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetLabelQuery.java16
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/HasImageQuery.java16
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF1
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/META-INF/MANIFEST.MF3
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/edit/provider/PaletteConfigurationEditPlugin.java4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore7
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF5
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml4
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerHandler.java13
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerState.java27
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetComplexName.java21
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetContainedDiagrams.java16
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetDiagramIcon.java14
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetName.java16
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsDiagram.java15
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsDiagramContainer.java17
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsReadOnly.java16
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/util/ModelExplorerUtils.java6
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF3
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/Activator.java9
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/DecoratingLabelProviderWTooltips.java4
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/LinkNodeAdapterFactory.java4
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dialog/PapyrusLoadBrowserCustomizationDialog.java473
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dnd/CommonDropAdapterAssistant.java14
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java138
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/LinkItemMatchingItem.java6
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/ModelElementItemMatchingItem.java6
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsOpen.java17
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsPage.java16
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsReadOnly.java16
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/META-INF/MANIFEST.MF1
56 files changed, 1028 insertions, 1025 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.custom b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.custom
new file mode 100644
index 00000000000..d5c27d5173d
--- /dev/null
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/facet/PaletteConfiguration.custom
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<custom:Customization xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:custom="http://www.eclipse.org/emf/facet/custom/0.2.incubation/custom" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:javaQuery="http://www.eclipse.org/emf/facet/query/java/0.2.incubation/javaquery" name="PaletteConfiguration">
+ <eClassifiers xsi:type="custom:EClassCustomization" name="PaletteConfiguration" documentation="PaletteConfiguration">
+ <extendedMetaclass href="platform:/plugins/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore#//PaletteConfiguration"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="custom:EClassCustomization" name="DrawerConfiguration" documentation="DrawerConfiguration">
+ <extendedMetaclass href="platform:/plugins/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore#//DrawerConfiguration"/>
+ <facetOperations 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="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.GetDrawerLabelQuery"/>
+ </facetOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="custom:EClassCustomization" name="Configuration" documentation="Configuration">
+ <extendedMetaclass href="platform:/plugins/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore#//Configuration"/>
+ <facetOperations 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="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.HasIconQuery"/>
+ </facetOperations>
+ <facetOperations 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="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.GetIconQuery"/>
+ </facetOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="custom:EClassCustomization" name="ToolConfiguration" documentation="ToolConfiguration">
+ <extendedMetaclass href="platform:/plugins/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore#//ToolConfiguration"/>
+ <facetOperations 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="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.customization.paletteconfiguration.queries.GetToolLabelQuery"/>
+ </facetOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="custom:EClassCustomization" name="StackConfiguration" instanceClassName="" documentation="StackConfiguration">
+ <extendedMetaclass href="platform:/plugins/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore#//StackConfiguration"/>
+ </eClassifiers>
+</custom:Customization>
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/preview/Preview.java b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/preview/Preview.java
index c742198472d..439fc7e3c19 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/preview/Preview.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/preview/Preview.java
@@ -31,7 +31,8 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.ITreeElement;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EObjectTreeElement;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EStructuralFeatureTreeElement;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -435,8 +436,8 @@ public class Preview extends ViewPart implements ISelectionChangedListener, IPar
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection)event.getSelection();
if(selection.size() == 1) {
- ITreeElement child = null;
- ITreeElement element = (ITreeElement)selection.getFirstElement();
+ EObjectTreeElement child = null;
+ EObjectTreeElement element = (EObjectTreeElement)selection.getFirstElement();
do {
@@ -449,7 +450,10 @@ public class Preview extends ViewPart implements ISelectionChangedListener, IPar
}
child = element;
- element = element.getTreeParent();
+ EStructuralFeatureTreeElement elementFeature = element.getParent();
+ if( elementFeature.getParent()!=null){
+ element=elementFeature.getParent();
+ }
} while(child != element && element != null);
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/GenericAttributeModelElement.java b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/GenericAttributeModelElement.java
index f7832c1e141..49222748076 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/GenericAttributeModelElement.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/GenericAttributeModelElement.java
@@ -22,15 +22,17 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
-import org.eclipse.emf.facet.infra.query.ModelQuery;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.papyrus.infra.constraints.ConfigProperty;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResource;
import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
import org.eclipse.papyrus.infra.widgets.providers.AbstractStaticContentProvider;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
import org.eclipse.papyrus.views.properties.modelelement.AbstractModelElement;
+import org.eclipse.papyrus.views.properties.ui.WidgetAttribute;
/**
* XWT relies a lot on reflectivity, as it is based on an XML syntax.
@@ -114,7 +116,7 @@ public class GenericAttributeModelElement extends AbstractModelElement {
Iterator<EObject> iterator = result.iterator();
while(iterator.hasNext()) {
EObject eObject = iterator.next();
- if(!(eObject instanceof ModelQuery)) {
+ if(!(eObject instanceof Query)) {
iterator.remove();
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextContentProvider.java b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextContentProvider.java
index 7509d753907..06a16fa8232 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextContentProvider.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextContentProvider.java
@@ -18,8 +18,6 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.facet.custom.core.ICustomizationManager;
import org.eclipse.emf.facet.custom.ui.internal.CustomizedTreeContentProvider;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelContentProvider;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
import org.eclipse.papyrus.customization.properties.Activator;
import org.eclipse.papyrus.views.properties.contexts.Context;
import org.eclipse.papyrus.views.properties.util.PropertiesUtil;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextLabelProvider.java b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextLabelProvider.java
index e27a7e883a0..e00e12a8e3e 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextLabelProvider.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextLabelProvider.java
@@ -16,6 +16,7 @@ import java.lang.reflect.Method;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.facet.custom.core.ICustomizationManager;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EObjectTreeElement;
import org.eclipse.emf.facet.custom.ui.internal.CustomizedLabelProvider;
import org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelLabelProvider;
import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
@@ -44,7 +45,7 @@ public class ContextLabelProvider extends CustomizedLabelProvider {
@Override
public String getText(Object element) {
- if(!(element instanceof ITreeElement) && element instanceof EObject) {
+ if(!(element instanceof EObjectTreeElement) && element instanceof EObject) {
try {
Method method = CustomizationManager.class.getDeclaredMethod("getAppearanceConfiguration");//$NON-NLS-1$
method.setAccessible(true);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF
index 00fbcfd5159..cfa41143655 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF
@@ -11,7 +11,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.gmf.runtime.emf.type.core,
org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.core;bundle-version="1.0.0"
+ org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
+ org.eclipse.papyrus.emf.facet.query.java.core
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java
index 1e544507e49..21e3ae05227 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetContainedDiagrams.java
@@ -19,19 +19,21 @@ import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
-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.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
/** Get the collection of all contained diagrams */
-public class GetContainedDiagrams extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Collection<org.eclipse.gmf.runtime.notation.Diagram>> {
+public class GetContainedDiagrams extends AbstractEditorContainerQuery implements IJavaQuery2<EObject, Collection<org.eclipse.gmf.runtime.notation.Diagram>> {
- public Collection<Diagram> evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+
+ public Collection<Diagram> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
List<Diagram> result = new ArrayList<Diagram>();
- Iterator<EObject> roots = NavigatorUtils.getNotationRoots(context);
+ Iterator<EObject> roots = NavigatorUtils.getNotationRoots(source);
if(roots == null) {
return result;
}
@@ -39,7 +41,7 @@ public class GetContainedDiagrams extends AbstractEditorContainerQuery implement
while(roots.hasNext()) {
EObject root = roots.next();
if(root instanceof Diagram) {
- if(EcoreUtil.equals(((Diagram)root).getElement(), context)) {
+ if(EcoreUtil.equals(((Diagram)root).getElement(), source)) {
result.add((Diagram)root);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetDiagramIcon.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetDiagramIcon.java
index a9608b11f8f..de7765c15cb 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetDiagramIcon.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/GetDiagramIcon.java
@@ -12,16 +12,18 @@
*/
package org.eclipse.papyrus.infra.gmfdiag.modelexplorer.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.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.views.modelexplorer.queries.AbstractGetEditorIconQuery;
/** Return the path to the icon of the corresponding diagram */
-public class GetDiagramIcon extends AbstractGetEditorIconQuery implements IJavaModelQuery<Diagram, String> {
+public class GetDiagramIcon extends AbstractGetEditorIconQuery implements IJavaQuery2<Diagram, String> {
- public String evaluate(final Diagram context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
- return "/" + getEditorRegistry(context).getEditorURLIcon(context); //$NON-NLS-1$
+
+ public String evaluate(Diagram source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ return "/" + getEditorRegistry(source).getEditorURLIcon(source); //$NON-NLS-1$
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java
index b5eb764bf79..e102bb3423c 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java
@@ -16,20 +16,22 @@ import java.util.Iterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
-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.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
-public class IsDiagramContainer extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Boolean> {
+public class IsDiagramContainer extends AbstractEditorContainerQuery implements IJavaQuery2<EObject, Boolean> {
/**
* Return true if the element is a Diagram Container
*/
- public Boolean evaluate(final EObject context, ParameterValueList parameterValues) throws ModelQueryExecutionException {
- Iterator<EObject> roots = NavigatorUtils.getNotationRoots(context);
+
+ public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ Iterator<EObject> roots = NavigatorUtils.getNotationRoots(source);
if(roots == null) {
return false;
}
@@ -37,7 +39,7 @@ public class IsDiagramContainer extends AbstractEditorContainerQuery implements
while(roots.hasNext()) {
EObject root = roots.next();
if(root instanceof Diagram) {
- if(EcoreUtil.equals(((Diagram)root).getElement(), context)) {
+ if(EcoreUtil.equals(((Diagram)root).getElement(), source)) {
return true;
}
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/EMFQueryConstraint.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/EMFQueryConstraint.java
index 22c247ba550..f9194564065 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/EMFQueryConstraint.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/EMFQueryConstraint.java
@@ -11,19 +11,6 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.constraints.constraints;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.facet.infra.query.OCLModelQuery;
-import org.eclipse.emf.facet.infra.query.QueryFactory;
-import org.eclipse.emf.facet.infra.query.core.AbstractModelQuery;
-import org.eclipse.emf.facet.infra.query.core.ModelQuerySetCatalog;
-import org.eclipse.emf.facet.infra.query.runtime.ModelQueryResult;
-import org.eclipse.papyrus.infra.constraints.Activator;
-import org.eclipse.papyrus.infra.constraints.ConfigProperty;
-import org.eclipse.papyrus.infra.constraints.ReferenceProperty;
-import org.eclipse.papyrus.infra.constraints.SimpleConstraint;
-import org.eclipse.papyrus.infra.constraints.ValueProperty;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
/**
* A constraint applying an EMF Query on a selection. The Query should return
@@ -33,52 +20,64 @@ import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
*/
public class EMFQueryConstraint extends AbstractConstraint {
- private OCLModelQuery query;
-
@Override
- protected void setDescriptor(SimpleConstraint descriptor) {
- ConfigProperty property = getProperty("query"); //$NON-NLS-1$
- if(property instanceof ReferenceProperty) {
- query = (OCLModelQuery)getReferenceValue("query"); //$NON-NLS-1$
- } else {
- String queryExpression = ((ValueProperty)property).getValue();
- query = QueryFactory.eINSTANCE.createOCLModelQuery();
- query.setQuery(queryExpression);
- query.setReturnType(EcorePackage.eINSTANCE.getEBoolean());
- query.getScope().add(EcorePackage.eINSTANCE.getEObject());
- throw new UnsupportedOperationException();
- }
- }
-
- public boolean match(Object selection) {
- if(query == null) {
- return false;
- }
-
- EObject selectedItem = EMFHelper.getEObject(selection);
-
- if(selectedItem != null) {
- try {
- ModelQuerySetCatalog catalog = ModelQuerySetCatalog.getSingleton();
- AbstractModelQuery abstractQuery = catalog.getModelQueryImpl(query);
- ModelQueryResult result = abstractQuery.evaluate(selectedItem);
- Object value = result.getValue();
- return value == null ? false : (Boolean)value;
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
-
- }
+ protected boolean equivalent(Constraint constraint) {
+ // TODO Auto-generated method stub
return false;
}
@Override
- protected boolean equivalent(Constraint constraint) {
- if(constraint != null && constraint instanceof EMFQueryConstraint) {
- EMFQueryConstraint other = (EMFQueryConstraint)constraint;
- return other.query.equals(query);
- }
+ protected boolean match(Object selection) {
+ // TODO Auto-generated method stub
return false;
}
+// private OCLModelQuery query;
+//
+// @Override
+// protected void setDescriptor(SimpleConstraint descriptor) {
+// ConfigProperty property = getProperty("query"); //$NON-NLS-1$
+// if(property instanceof ReferenceProperty) {
+// query = (OCLModelQuery)getReferenceValue("query"); //$NON-NLS-1$
+// } else {
+// String queryExpression = ((ValueProperty)property).getValue();
+// query = QueryFactory.eINSTANCE.createOCLModelQuery();
+// query.setQuery(queryExpression);
+// query.setReturnType(EcorePackage.eINSTANCE.getEBoolean());
+// query.getScope().add(EcorePackage.eINSTANCE.getEObject());
+// throw new UnsupportedOperationException();
+// }
+// }
+//
+// public boolean match(Object selection) {
+// if(query == null) {
+// return false;
+// }
+//
+// EObject selectedItem = EMFHelper.getEObject(selection);
+//
+// if(selectedItem != null) {
+// try {
+// ModelQuerySetCatalog catalog = ModelQuerySetCatalog.getSingleton();
+// AbstractModelQuery abstractQuery = catalog.getModelQueryImpl(query);
+// ModelQueryResult result = abstractQuery.evaluate(selectedItem);
+// Object value = result.getValue();
+// return value == null ? false : (Boolean)value;
+// } catch (Exception ex) {
+// Activator.log.error(ex);
+// }
+//
+// }
+// return false;
+// }
+//
+// @Override
+// protected boolean equivalent(Constraint constraint) {
+// if(constraint != null && constraint instanceof EMFQueryConstraint) {
+// EMFQueryConstraint other = (EMFQueryConstraint)constraint;
+// return other.query.equals(query);
+// }
+// return false;
+// }
+
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/providers/ModifySemanticValuesActionProvider.java b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/providers/ModifySemanticValuesActionProvider.java
index 5ecc4b638bd..039a038df90 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/providers/ModifySemanticValuesActionProvider.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/providers/ModifySemanticValuesActionProvider.java
@@ -135,7 +135,7 @@ public class ModifySemanticValuesActionProvider extends AbstractProvider impleme
Object value = null;
QueryConfiguration configuration = queryExecutionValue.getConfiguration();
try {
- value = QueryUtil.evaluateQuery(eObject, configuration);
+ //value = QueryUtil.evaluateQuery(eObject, configuration);
} catch (Exception e) {
Activator.log.error(e);
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/META-INF/MANIFEST.MF
index 9d08c0c4d88..915f280e398 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/META-INF/MANIFEST.MF
@@ -9,13 +9,13 @@ Export-Package: org.eclipse.papyrus.infra.extendedtypes,
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
org.eclipse.emf.ecore;bundle-version="2.7.0";visibility:=reexport,
org.eclipse.emf.ecore.xmi;bundle-version="2.6.0";visibility:=reexport,
- org.eclipse.papyrus.infra.queries.core.configuration;bundle-version="1.0.0",
org.eclipse.uml2.uml;bundle-version="3.2.0",
org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
org.eclipse.papyrus.infra.queries.core;bundle-version="1.0.0",
- org.eclipse.gmf.runtime.common.ui.services;bundle-version="1.3.0"
+ org.eclipse.gmf.runtime.common.ui.services;bundle-version="1.3.0",
+ org.eclipse.papyrus.infra.queries.core.configuration;bundle-version="1.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/advices/ExtendedTypesOwnerAdvice.java b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/advices/ExtendedTypesOwnerAdvice.java
index 139ff2798c5..695d741f7ae 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/advices/ExtendedTypesOwnerAdvice.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/advices/ExtendedTypesOwnerAdvice.java
@@ -56,20 +56,20 @@ public class ExtendedTypesOwnerAdvice extends AbstractEditHelperAdvice {
}
// check all validation rules given by the configuration
- for(Object objectToEdit : request.getElementsToEdit()) {
- // there are queries to test
- for(QueryConfiguration queryConfiguration : queryConfigurations) {
- try {
- boolean result = QueryUtil.evaluateBooleanQuery((EObject)objectToEdit, queryConfiguration);
- if(!result) {
- // return an unexecutable command, so the create command will not be executable
- return UnexecutableCommand.INSTANCE;
- }
- } catch (Exception e) {
- Activator.log.error(e);
- }
- }
- }
+// for(Object objectToEdit : request.getElementsToEdit()) {
+// // there are queries to test
+// for(QueryConfiguration queryConfiguration : queryConfigurations) {
+// try {
+// // boolean result = QueryUtil.evaluateBooleanQuery((EObject)objectToEdit, queryConfiguration);
+// // if(!result) {
+// // return an unexecutable command, so the create command will not be executable
+// return UnexecutableCommand.INSTANCE;
+// }
+// } catch (Exception e) {
+// Activator.log.error(e);
+// }
+// }
+// }
// Check all pre and post action validation rules. They are given by the provider of the action
CompositeCommand compositeCommand = new CompositeCommand("PreValidationPostAction");
diff --git a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration.edit/META-INF/MANIFEST.MF b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration.edit/META-INF/MANIFEST.MF
index 8a393a254a5..1a2041eb873 100644
--- a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration.edit/META-INF/MANIFEST.MF
+++ b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration.edit/META-INF/MANIFEST.MF
@@ -6,8 +6,6 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.edit;visibility:=reexport,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.emf.ecore.edit;visibility:=reexport,
- org.eclipse.emf.facet.infra.query,
- org.eclipse.emf.facet.infra.query.edit,
org.eclipse.uml2.uml,
org.eclipse.uml2.uml.edit
Bundle-Vendor: %providerName
diff --git a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration.edit/src-gen/org/eclipse/papyrus/infra/queries/core/configuration/provider/ConfigurationEditPlugin.java b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration.edit/src-gen/org/eclipse/papyrus/infra/queries/core/configuration/provider/ConfigurationEditPlugin.java
index 3b656338250..f8205917100 100644
--- a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration.edit/src-gen/org/eclipse/papyrus/infra/queries/core/configuration/provider/ConfigurationEditPlugin.java
+++ b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration.edit/src-gen/org/eclipse/papyrus/infra/queries/core/configuration/provider/ConfigurationEditPlugin.java
@@ -7,13 +7,8 @@
package org.eclipse.papyrus.infra.queries.core.configuration.provider;
import org.eclipse.emf.common.EMFPlugin;
-
import org.eclipse.emf.common.util.ResourceLocator;
-
import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
-
-import org.eclipse.emf.facet.infra.query.edit.provider.QueryEditPlugin;
-
import org.eclipse.uml2.uml.edit.UMLEditPlugin;
/**
@@ -49,7 +44,7 @@ public final class ConfigurationEditPlugin extends EMFPlugin {
super
(new ResourceLocator [] {
EcoreEditPlugin.INSTANCE,
- QueryEditPlugin.INSTANCE,
+ // QueryEditPlugin.INSTANCE,
UMLEditPlugin.INSTANCE,
});
}
diff --git a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration/META-INF/MANIFEST.MF b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration/META-INF/MANIFEST.MF
index dc1292f2cfa..48330dece96 100644
--- a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration/META-INF/MANIFEST.MF
+++ b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration/META-INF/MANIFEST.MF
@@ -6,7 +6,6 @@ Export-Package: org.eclipse.papyrus.infra.queries.core.configuration,
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
- org.eclipse.emf.facet.infra.query,
org.eclipse.uml2.uml
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
diff --git a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration/src-gen/org/eclipse/papyrus/infra/queries/core/configuration/impl/ConfigurationPackageImpl.java b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration/src-gen/org/eclipse/papyrus/infra/queries/core/configuration/impl/ConfigurationPackageImpl.java
index 66153d6db8a..93081f21411 100644
--- a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration/src-gen/org/eclipse/papyrus/infra/queries/core/configuration/impl/ConfigurationPackageImpl.java
+++ b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core.configuration/src-gen/org/eclipse/papyrus/infra/queries/core/configuration/impl/ConfigurationPackageImpl.java
@@ -11,7 +11,6 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.facet.infra.query.QueryPackage;
import org.eclipse.papyrus.infra.queries.core.configuration.ConfigurationFactory;
import org.eclipse.papyrus.infra.queries.core.configuration.ConfigurationPackage;
import org.eclipse.papyrus.infra.queries.core.configuration.ConstantParameterValue;
@@ -120,7 +119,7 @@ public class ConfigurationPackageImpl extends EPackageImpl implements Configurat
isInited = true;
// Initialize simple dependencies
- QueryPackage.eINSTANCE.eClass();
+ //QueryPackage.eINSTANCE.eClass();
UMLPackage.eINSTANCE.eClass();
// Obtain or create and register interdependencies
@@ -332,7 +331,7 @@ public class ConfigurationPackageImpl extends EPackageImpl implements Configurat
setNsURI(eNS_URI);
// Obtain other dependent packages
- QueryPackage theQueryPackage = (QueryPackage)EPackage.Registry.INSTANCE.getEPackage(QueryPackage.eNS_URI);
+ //QueryPackage theQueryPackage = (QueryPackage)EPackage.Registry.INSTANCE.getEPackage(QueryPackage.eNS_URI);
UMLPackage theUMLPackage = (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI);
// Create type parameters
@@ -350,11 +349,11 @@ public class ConfigurationPackageImpl extends EPackageImpl implements Configurat
initEAttribute(getQueryConfiguration_Name(), ecorePackage.getEString(), "name", null, 1, 1, QueryConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(modiscoQueryConfigurationEClass, ModiscoQueryConfiguration.class, "ModiscoQueryConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getModiscoQueryConfiguration_Query(), theQueryPackage.getModelQuery(), null, "query", null, 1, 1, ModiscoQueryConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ //initEReference(getModiscoQueryConfiguration_Query(), theQueryPackage.getModelQuery(), null, "query", null, 1, 1, ModiscoQueryConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getModiscoQueryConfiguration_ParameterValues(), this.getParameterValue(), null, "parameterValues", null, 0, -1, ModiscoQueryConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(parameterValueEClass, ParameterValue.class, "ParameterValue", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getParameterValue_Parameter(), theQueryPackage.getModelQueryParameter(), null, "parameter", null, 1, 1, ParameterValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ //initEReference(getParameterValue_Parameter(), theQueryPackage.getModelQueryParameter(), null, "parameter", null, 1, 1, ParameterValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(queryExecutionValueEClass, QueryExecutionValue.class, "QueryExecutionValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getQueryExecutionValue_Configuration(), this.getQueryConfiguration(), null, "configuration", null, 1, 1, QueryExecutionValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
diff --git a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/META-INF/MANIFEST.MF b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/META-INF/MANIFEST.MF
index b37366c3d3d..49ac0760eea 100644
--- a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/META-INF/MANIFEST.MF
+++ b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/META-INF/MANIFEST.MF
@@ -1,9 +1,6 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.core.runtime;bundle-version="3.7.0",
- org.eclipse.emf.facet.infra.query;bundle-version="0.1.0",
- org.eclipse.emf.facet.infra.query.core;bundle-version="0.1.0",
- org.eclipse.emf.facet.infra.common.core;bundle-version="0.1.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
org.eclipse.core.databinding;bundle-version="1.3.100",
org.eclipse.papyrus.infra.queries.core.configuration;bundle-version="1.0.0",
diff --git a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/src/org/eclipse/papyrus/infra/queries/core/converter/ConverterRegistry.java b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/src/org/eclipse/papyrus/infra/queries/core/converter/ConverterRegistry.java
index 5d2bef8bc11..fed4d51e1e6 100644
--- a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/src/org/eclipse/papyrus/infra/queries/core/converter/ConverterRegistry.java
+++ b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/src/org/eclipse/papyrus/infra/queries/core/converter/ConverterRegistry.java
@@ -133,17 +133,17 @@ public class ConverterRegistry {
throw new RuntimeException("List conversion not implemented for this type of configuration. " + queryConfiguration.eClass().getName());
}
Object executionResult = null;
- try {
- executionResult = QueryUtil.evaluateBooleanQuery(context, queryConfiguration);
- } catch (Exception e) {
- Activator.log.error(e);
- }
- int upperBound = ((ModiscoQueryConfiguration)queryConfiguration).getQuery().getUpperBound();
- if(upperBound == 1) {
- return Arrays.asList(executionResult);
- } else {
+// try {
+// executionResult = QueryUtil.evaluateBooleanQuery(context, queryConfiguration);
+// } catch (Exception e) {
+// Activator.log.error(e);
+// }
+// int upperBound = ((ModiscoQueryConfiguration)queryConfiguration).getQuery().getUpperBound();
+// if(upperBound == 1) {
+// return Arrays.asList(executionResult);
+// } else {
return (List<?>)executionResult;
- }
+// }
};
/**
diff --git a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/src/org/eclipse/papyrus/infra/queries/core/modisco/QueryUtil.java b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/src/org/eclipse/papyrus/infra/queries/core/modisco/QueryUtil.java
index 4ff17948d52..f87a4810a9a 100644
--- a/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/src/org/eclipse/papyrus/infra/queries/core/modisco/QueryUtil.java
+++ b/plugins/infra/queries/org.eclipse.papyrus.infra.queries.core/src/org/eclipse/papyrus/infra/queries/core/modisco/QueryUtil.java
@@ -11,33 +11,6 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.queries.core.modisco;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.facet.infra.query.ModelQuery;
-import org.eclipse.emf.facet.infra.query.ModelQueryParameter;
-import org.eclipse.emf.facet.infra.query.ModelQuerySet;
-import org.eclipse.emf.facet.infra.query.core.AbstractModelQuery;
-import org.eclipse.emf.facet.infra.query.core.ModelQuerySetCatalog;
-import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
-import org.eclipse.emf.facet.infra.query.runtime.ModelQueryParameterValue;
-import org.eclipse.emf.facet.infra.query.runtime.ModelQueryResult;
-import org.eclipse.papyrus.infra.queries.core.Activator;
-import org.eclipse.papyrus.infra.queries.core.configuration.ConstantParameterValue;
-import org.eclipse.papyrus.infra.queries.core.configuration.ListParameterValue;
-import org.eclipse.papyrus.infra.queries.core.configuration.ModiscoQueryConfiguration;
-import org.eclipse.papyrus.infra.queries.core.configuration.ParameterValue;
-import org.eclipse.papyrus.infra.queries.core.configuration.QueryConfiguration;
-import org.eclipse.papyrus.infra.queries.core.configuration.QueryExecutionValue;
-import org.eclipse.papyrus.infra.queries.core.configuration.util.ConfigurationSwitch;
-import org.eclipse.papyrus.infra.queries.core.converter.ConverterNotfoundException;
-import org.eclipse.papyrus.infra.queries.core.converter.ConverterRegistry;
/**
* Utility class for modisco queries
@@ -54,394 +27,394 @@ public class QueryUtil {
protected QueryUtil() {
}
- /**
- * Evaluates a modisco query, that should only return a boolean value.
- *
- * @param query
- * the query to check and evaluate
- * @param context
- * the eobject on which the query is evaluated
- * @param parameters
- * a map containing the name of parameters and their values
- * @return <code>true</code> if the context fills the condition given by the query
- * @throws Exception
- * exception thrown when the query could not be correctly evaluated
- */
- public static final boolean evaluateBooleanQuery(final ModelQuery query, EObject context, Map<String, Object> parameters) throws Exception {
- // construct the structure parameterValues if the query is valid
- IStatus queryStatus = isValidQuery(query);
- if(!queryStatus.isOK()) {
- throw new Exception(queryStatus.getMessage());
- }
-
- // if no parameters, evaluate
- List<ModelQueryParameter> queryParameters = query.getParameters();
- List<ModelQueryParameterValue> parameterValues = new ArrayList<ModelQueryParameterValue>();
- if(queryParameters == null || queryParameters.isEmpty()) {
- return evaluateBooleanQuery(query, context, parameterValues);
- }
-
- // check the parameters given and the set of required parameters
- IStatus parameterCheck = isValidParameterSet(query, parameters);
- if(IStatus.CANCEL == parameterCheck.getSeverity() || IStatus.ERROR == parameterCheck.getSeverity()) {
- Activator.log.error(parameterCheck.getMessage(), null);
- throw new Exception(parameterCheck.getMessage());
- } else if(IStatus.WARNING == parameterCheck.getSeverity()) {
- Activator.log.warn(parameterCheck.getMessage());
- } else if(IStatus.INFO == parameterCheck.getSeverity()) {
- Activator.log.info(parameterCheck.getMessage());
- }
-
- // construct parameter structure for Modisco solver
- for(ModelQueryParameter parameter : queryParameters) {
- String parametername = parameter.getName();
- Object value = parameters.get(parametername);
- ModelQueryParameterValue parameterValue = ParameterValueList.createParameterValue(value, parameter);
-
- // should try to bind elements here..
- parameterValues.add(parameterValue);
- }
-
- // execute the query
- return evaluateBooleanQuery(query, context, parameterValues);
- }
-
- /**
- * Evaluates a query.
- *
- * @param context
- * the eobject on which the query is evaluated
- * @param queryConfiguration
- * the query configuration, containing all values for the parameters of the query
- * @return the result of the execution of the query
- * @throws Exception
- * exception thrown when the query could not be correctly evaluated
- */
- public static final Object evaluateQuery(EObject context, QueryConfiguration queryConfiguration) throws Exception {
- if(queryConfiguration instanceof ModiscoQueryConfiguration) {
- return evaluateQuery(context, (ModiscoQueryConfiguration)queryConfiguration);
- }
- throw new Exception("Unhandled kind of query");
- }
-
- /**
- * Evaluates a query, that should only return a boolean value.
- *
- * @param context
- * the eobject on which the query is evaluated
- * @param queryConfiguration
- * the query configuration, containing all values for the parameters of the query
- * @return <code>true</code> if the context fills the condition given by the query
- * @throws Exception
- * exception thrown when the query could not be correctly evaluated
- */
- public static final boolean evaluateBooleanQuery(EObject context, QueryConfiguration queryConfiguration) throws Exception {
- if(queryConfiguration instanceof ModiscoQueryConfiguration) {
- return evaluateBooleanQuery(context, (ModiscoQueryConfiguration)queryConfiguration);
- }
- throw new Exception("Unhandled kind of query");
- }
-
- /**
- * Evaluates a modisco query, that should only return a boolean value.
- *
- * @param context
- * the eobject on which the query is evaluated
- * @param queryConfiguration
- * the query configuration, containing all values for the parameters of the query
- * @return <code>true</code> if the context fills the condition given by the query
- * @throws Exception
- * exception thrown when the query could not be correctly evaluated
- */
- public static final boolean evaluateBooleanQuery(EObject context, ModiscoQueryConfiguration queryConfiguration) throws Exception {
- Object result = evaluateQuery(context, queryConfiguration);
- if(result instanceof Boolean) {
- return (Boolean)result;
- }
- Activator.log.error("Not a boolean result: " + result, null);
- return defaultReturnValue;
- }
-
- /**
- * Evaluates a modisco query, that should only return a boolean value.
- *
- * @param context
- * the eobject on which the query is evaluated
- * @param queryConfiguration
- * the query configuration, containing all values for the parameters of the query
- * @return <code>true</code> if the context fills the condition given by the query
- * @throws Exception
- * exception thrown when the query could not be correctly evaluated
- */
- public static final Object evaluateQuery(EObject context, ModiscoQueryConfiguration queryConfiguration) throws Exception {
- // retrieve query (problem of bundle loader if not used correctly)
- ModelQuery query = queryConfiguration.getQuery();
- String modelQuerySetName = query.getModelQuerySet().getName();
- String modelQueryName = query.getName();
-
- ModelQuery finalModelQuery = retrieveModelQuery(modelQueryName, modelQuerySetName);
-
- // construct the structure parameterValues if the query is valid
- IStatus queryValidation = isValidQuery(finalModelQuery);
- if(!queryValidation.isOK()) {
- throw new Exception(queryValidation.getMessage(), queryValidation.getException());
- }
-
- // create the set of parameter values
- List<ModelQueryParameterValue> parameterValues = createParameterValuesListFromConfiguration(context, queryConfiguration);
-
- // execute the query
- return evaluateQuery(finalModelQuery, context, parameterValues);
- }
-
- /**
- * Creates the {@link ModelQueryParameterValue} list from a configuration
- *
- * @param queryConfiguration
- * the configuration to check
- * @return the list of parameter values
- */
- private static List<ModelQueryParameterValue> createParameterValuesListFromConfiguration(EObject context, ModiscoQueryConfiguration queryConfiguration) {
- List<ModelQueryParameterValue> parameterValues = new ArrayList<ModelQueryParameterValue>();
-
- List<ModelQueryParameter> parameters = queryConfiguration.getQuery().getParameters();
- for(ModelQueryParameter parameter : parameters) {
- Object value = retrieveParameterValue(context, parameter, queryConfiguration);
- // resolve the value for the parameters
- ModelQueryParameterValue parameterValue = ParameterValueList.createParameterValue(value, parameter);
- parameterValues.add(parameterValue);
- }
- return parameterValues;
- }
-
- /**
- * Retrieves the value of a parameter.
- *
- * @param parameter
- * the parameter for which the value is computed
- * @return the parameter value associated to the parameter
- */
- private static Object retrieveParameterValue(final EObject context, final ModelQueryParameter parameter, ModiscoQueryConfiguration configuration) {
- for(final ParameterValue parameterValue : configuration.getParameterValues()) {
- if(parameter.equals(parameterValue.getParameter())) {
- // This is the right parameter. Compute the value, depending on the type of the parameters
- return new ConfigurationSwitch<Object>() {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object caseListParameterValue(ListParameterValue listParameterValue) {
- ArrayList<Object> values = new ArrayList<Object>();
- Class<?> parameterType = parameter.getType().getInstanceClass();
- for(ParameterValue parameterValue : listParameterValue.getValues()) {
- values.addAll(ConverterRegistry.getSingleton().convertToList(context, parameterType, parameterValue));
- }
- return values;
- };
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object caseConstantParameterValue(ConstantParameterValue constantParameterValue) {
- Class<?> parameterType = parameter.getType().getInstanceClass();
- try {
- Object convertedValue = ConverterRegistry.getSingleton().convert(parameterType, constantParameterValue.getValueInstance());
- return convertedValue;
- } catch (ConverterNotfoundException e) {
- Activator.log.error(e);
- }
- return null;
- };
-
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object caseQueryExecutionValue(QueryExecutionValue queryExecutionValue) {
- // retrieves the associated configuration and launch it.
- QueryConfiguration configuration = queryExecutionValue.getConfiguration();
- try {
- return QueryUtil.evaluateQuery(context, configuration);
- } catch (Exception e) {
- Activator.log.error(e);
- }
- return null;
-
- };
- }.doSwitch(parameterValue);
- }
- }
- return null;
-
- }
-
- /**
- * Evaluates a modisco query.
- *
- * @param query
- * the query to evaluate
- * @param context
- * the context element against which the query is evaluated
- * @param parameterValues
- * the list of parameters for the query
- * @return the result of the query evaluation
- * @throws Exception
- * exception thrown in case of problem during evaluation of the query
- */
- public static final Object evaluateQuery(final ModelQuery query, EObject context, List<ModelQueryParameterValue> parameterValues) throws Exception {
- // checks that the query is valid
- if(isValidQuery(query).isOK()) {
- AbstractModelQuery myModelQuery;
- myModelQuery = ModelQuerySetCatalog.getSingleton().getModelQueryImpl(query);
- //the model query set evaluation
- ModelQueryResult result = myModelQuery.evaluate(context, parameterValues);
- if(result.getException() != null) {
- throw new Exception();
- }
- return result.getValue();
- }
- throw new Exception("Query was not a valid query: " + query, null);
- }
-
- /**
- * Evaluates a modisco query, that should only return a boolean value.
- *
- * @param query
- * the query to check and evaluate
- * @param context
- * the eobject on which the query is evaluated
- * @param parameterValues
- * the list of parameter values for the evaluation
- * @return <code>true</code> if the context fills the condition given by the query
- * @throws Exception
- * exception thrown when the query can not be correctly evaluated
- */
- public static final boolean evaluateBooleanQuery(final ModelQuery query, EObject context, List<ModelQueryParameterValue> parameterValues) throws Exception {
- Object result = evaluateQuery(query, context, parameterValues);
- if(result instanceof Boolean) {
- // try to cast into a boolean
- return (Boolean)result;
- }
- Activator.log.error("Query did not return a boolean: " + result, null);
- return defaultReturnValue;
- }
-
- /**
- * Retrieves a model query, given its name and its query set.
- *
- * @param queryName
- * the name of the query
- * @param querySetName
- * the name of the query set
- * @return the found model query or <code>null</code>.
- * @throws ModelQueryNotFoundException
- * exception thrown when the the query set was found but not the model query was not found.
- * @throws ModelQuerySetNotFoundException
- * exception thrown when the the query set was not found.
- */
- public static final ModelQuery retrieveModelQuery(String queryName, String querySetName) throws ModelQueryNotFoundException, ModelQuerySetNotFoundException {
- ModelQuerySet querySet = ModelQuerySetCatalog.getSingleton().getModelQuerySet(querySetName);
- if(querySet == null) {
- throw new ModelQuerySetNotFoundException(querySetName);
- }
-
- ModelQuery query = querySet.getQuery(queryName);
- if(query == null) {
- throw new ModelQueryNotFoundException(queryName);
- }
-
- return query;
- }
-
- /**
- * Checks if the query is valid, i.e. not <code>null</code>, returning a boolean value, etc.
- *
- * @param query
- * the query to test
- * @return <code>true</code> if the query is valid
- */
- public static final IStatus isValidQuery(ModelQuery query) {
- if(query == null) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Query should not be null.");
- }
- return Status.OK_STATUS;
- }
-
- /**
- * Checks if the query is valid, i.e. not <code>null</code>, returning a boolean value, etc.
- * @param query the query to test
- * @return <code>true</code> if the query is valid
- */
- public static final IStatus isValidBooleanQuery(ModelQuery query) {
- IStatus status = isValidQuery(query);
- if(status.isOK()) {
- // check the instance type is compatible with boolean
- EClassifier returnType = query.getReturnType();
- if(returnType == null) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Query " + query.getName() + " does not have a return value, whereas it should have a boolean return status");
- } else {
- Class<?> instanceClass = returnType.getInstanceClass();
- if(!boolean.class.isAssignableFrom(instanceClass)) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Query " + query.getName() + " should return a value that can be cast into Boolean value. Currently: " + returnType.getInstanceClass());
- }
- // check return size of the query... should be 0..1 or 1..1 (even 0..1 could be difficult to handle, but we let this possible)
- if(query.getUpperBound() > 1 || query.getUpperBound() < 0) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Query " + query.getName() + " should return only one value. Currently: " + query.getUpperBound());
- }
- }
- }
- return status;
- }
-
- /**
- * Check if the set of given parameters is compatible with the query
- * @param query the query against which the set of parameters is tested
- * @param parameters the map of parameter names and their value
- * @return the status corresponding to the validation
- */
- public static final IStatus isValidParameterSet(ModelQuery query, Map<String, Object> parameters) {
- // check size, which should be equal.
- int querySize = query.getParameters().size();
- int parameterSize = parameters.keySet().size();
-
- if(querySize != parameterSize) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The given parameters set do not have the same size (" + parameterSize + ") than the query parameter set (" + querySize + ")");
- }
-
- List<IStatus> status = new ArrayList<IStatus>();
-
- // size is ok, checking names, type, multiplicity
- for(String parameterName : parameters.keySet()) {
- // retrieve the equivalent parameter in the query
- ModelQueryParameter queryParameter = retrieveParameterByName(query, parameterName);
- if(queryParameter == null) {
- status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Impossible to find the parameter " + parameterName + " in the query parameters list for query: " + query.getName()));
- }
- }
- if(status.size() > 0) {
- return new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, status.toArray(new IStatus[status.size()]), "", null);
- }
- return Status.OK_STATUS;
- }
-
- /**
- * Retrieves a parameter, given the query to look into and the name of the parameter
- *
- * @param query
- * the query where the parameter is stored
- * @param parameterName
- * the name of the parameter
- * @return the parameter
- */
- private final static ModelQueryParameter retrieveParameterByName(ModelQuery query, String parameterName) {
- for(ModelQueryParameter queryParameter : query.getParameters()) {
- if(parameterName.equals(queryParameter.getName())) {
- return queryParameter;
- }
- }
- return null;
- }
+// /**
+// * Evaluates a modisco query, that should only return a boolean value.
+// *
+// * @param query
+// * the query to check and evaluate
+// * @param context
+// * the eobject on which the query is evaluated
+// * @param parameters
+// * a map containing the name of parameters and their values
+// * @return <code>true</code> if the context fills the condition given by the query
+// * @throws Exception
+// * exception thrown when the query could not be correctly evaluated
+// */
+// public static final boolean evaluateBooleanQuery(final ModelQuery query, EObject context, Map<String, Object> parameters) throws Exception {
+// // construct the structure parameterValues if the query is valid
+// IStatus queryStatus = isValidQuery(query);
+// if(!queryStatus.isOK()) {
+// throw new Exception(queryStatus.getMessage());
+// }
+//
+// // if no parameters, evaluate
+// List<ModelQueryParameter> queryParameters = query.getParameters();
+// List<ModelQueryParameterValue> parameterValues = new ArrayList<ModelQueryParameterValue>();
+// if(queryParameters == null || queryParameters.isEmpty()) {
+// return evaluateBooleanQuery(query, context, parameterValues);
+// }
+//
+// // check the parameters given and the set of required parameters
+// IStatus parameterCheck = isValidParameterSet(query, parameters);
+// if(IStatus.CANCEL == parameterCheck.getSeverity() || IStatus.ERROR == parameterCheck.getSeverity()) {
+// Activator.log.error(parameterCheck.getMessage(), null);
+// throw new Exception(parameterCheck.getMessage());
+// } else if(IStatus.WARNING == parameterCheck.getSeverity()) {
+// Activator.log.warn(parameterCheck.getMessage());
+// } else if(IStatus.INFO == parameterCheck.getSeverity()) {
+// Activator.log.info(parameterCheck.getMessage());
+// }
+//
+// // construct parameter structure for Modisco solver
+// for(ModelQueryParameter parameter : queryParameters) {
+// String parametername = parameter.getName();
+// Object value = parameters.get(parametername);
+// ModelQueryParameterValue parameterValue = ParameterValueList.createParameterValue(value, parameter);
+//
+// // should try to bind elements here..
+// parameterValues.add(parameterValue);
+// }
+//
+// // execute the query
+// return evaluateBooleanQuery(query, context, parameterValues);
+// }
+//
+// /**
+// * Evaluates a query.
+// *
+// * @param context
+// * the eobject on which the query is evaluated
+// * @param queryConfiguration
+// * the query configuration, containing all values for the parameters of the query
+// * @return the result of the execution of the query
+// * @throws Exception
+// * exception thrown when the query could not be correctly evaluated
+// */
+// public static final Object evaluateQuery(EObject context, QueryConfiguration queryConfiguration) throws Exception {
+// if(queryConfiguration instanceof ModiscoQueryConfiguration) {
+// return evaluateQuery(context, (ModiscoQueryConfiguration)queryConfiguration);
+// }
+// throw new Exception("Unhandled kind of query");
+// }
+//
+// /**
+// * Evaluates a query, that should only return a boolean value.
+// *
+// * @param context
+// * the eobject on which the query is evaluated
+// * @param queryConfiguration
+// * the query configuration, containing all values for the parameters of the query
+// * @return <code>true</code> if the context fills the condition given by the query
+// * @throws Exception
+// * exception thrown when the query could not be correctly evaluated
+// */
+// public static final boolean evaluateBooleanQuery(EObject context, QueryConfiguration queryConfiguration) throws Exception {
+// if(queryConfiguration instanceof ModiscoQueryConfiguration) {
+// return evaluateBooleanQuery(context, (ModiscoQueryConfiguration)queryConfiguration);
+// }
+// throw new Exception("Unhandled kind of query");
+// }
+//
+// /**
+// * Evaluates a modisco query, that should only return a boolean value.
+// *
+// * @param context
+// * the eobject on which the query is evaluated
+// * @param queryConfiguration
+// * the query configuration, containing all values for the parameters of the query
+// * @return <code>true</code> if the context fills the condition given by the query
+// * @throws Exception
+// * exception thrown when the query could not be correctly evaluated
+// */
+// public static final boolean evaluateBooleanQuery(EObject context, ModiscoQueryConfiguration queryConfiguration) throws Exception {
+// Object result = evaluateQuery(context, queryConfiguration);
+// if(result instanceof Boolean) {
+// return (Boolean)result;
+// }
+// Activator.log.error("Not a boolean result: " + result, null);
+// return defaultReturnValue;
+// }
+//
+// /**
+// * Evaluates a modisco query, that should only return a boolean value.
+// *
+// * @param context
+// * the eobject on which the query is evaluated
+// * @param queryConfiguration
+// * the query configuration, containing all values for the parameters of the query
+// * @return <code>true</code> if the context fills the condition given by the query
+// * @throws Exception
+// * exception thrown when the query could not be correctly evaluated
+// */
+// public static final Object evaluateQuery(EObject context, ModiscoQueryConfiguration queryConfiguration) throws Exception {
+// // retrieve query (problem of bundle loader if not used correctly)
+// ModelQuery query = queryConfiguration.getQuery();
+// String modelQuerySetName = query.getModelQuerySet().getName();
+// String modelQueryName = query.getName();
+//
+// ModelQuery finalModelQuery = retrieveModelQuery(modelQueryName, modelQuerySetName);
+//
+// // construct the structure parameterValues if the query is valid
+// IStatus queryValidation = isValidQuery(finalModelQuery);
+// if(!queryValidation.isOK()) {
+// throw new Exception(queryValidation.getMessage(), queryValidation.getException());
+// }
+//
+// // create the set of parameter values
+// List<ModelQueryParameterValue> parameterValues = createParameterValuesListFromConfiguration(context, queryConfiguration);
+//
+// // execute the query
+// return evaluateQuery(finalModelQuery, context, parameterValues);
+// }
+//
+// /**
+// * Creates the {@link ModelQueryParameterValue} list from a configuration
+// *
+// * @param queryConfiguration
+// * the configuration to check
+// * @return the list of parameter values
+// */
+// private static List<ModelQueryParameterValue> createParameterValuesListFromConfiguration(EObject context, ModiscoQueryConfiguration queryConfiguration) {
+// List<ModelQueryParameterValue> parameterValues = new ArrayList<ModelQueryParameterValue>();
+//
+// List<ModelQueryParameter> parameters = queryConfiguration.getQuery().getParameters();
+// for(ModelQueryParameter parameter : parameters) {
+// Object value = retrieveParameterValue(context, parameter, queryConfiguration);
+// // resolve the value for the parameters
+// ModelQueryParameterValue parameterValue = ParameterValueList.createParameterValue(value, parameter);
+// parameterValues.add(parameterValue);
+// }
+// return parameterValues;
+// }
+//
+// /**
+// * Retrieves the value of a parameter.
+// *
+// * @param parameter
+// * the parameter for which the value is computed
+// * @return the parameter value associated to the parameter
+// */
+// private static Object retrieveParameterValue(final EObject context, final ModelQueryParameter parameter, ModiscoQueryConfiguration configuration) {
+// for(final ParameterValue parameterValue : configuration.getParameterValues()) {
+// if(parameter.equals(parameterValue.getParameter())) {
+// // This is the right parameter. Compute the value, depending on the type of the parameters
+// return new ConfigurationSwitch<Object>() {
+//
+// /**
+// * {@inheritDoc}
+// */
+// @Override
+// public Object caseListParameterValue(ListParameterValue listParameterValue) {
+// ArrayList<Object> values = new ArrayList<Object>();
+// Class<?> parameterType = parameter.getType().getInstanceClass();
+// for(ParameterValue parameterValue : listParameterValue.getValues()) {
+// values.addAll(ConverterRegistry.getSingleton().convertToList(context, parameterType, parameterValue));
+// }
+// return values;
+// };
+//
+// /**
+// * {@inheritDoc}
+// */
+// @Override
+// public Object caseConstantParameterValue(ConstantParameterValue constantParameterValue) {
+// Class<?> parameterType = parameter.getType().getInstanceClass();
+// try {
+// Object convertedValue = ConverterRegistry.getSingleton().convert(parameterType, constantParameterValue.getValueInstance());
+// return convertedValue;
+// } catch (ConverterNotfoundException e) {
+// Activator.log.error(e);
+// }
+// return null;
+// };
+//
+//
+// /**
+// * {@inheritDoc}
+// */
+// @Override
+// public Object caseQueryExecutionValue(QueryExecutionValue queryExecutionValue) {
+// // retrieves the associated configuration and launch it.
+// QueryConfiguration configuration = queryExecutionValue.getConfiguration();
+// try {
+// return QueryUtil.evaluateQuery(context, configuration);
+// } catch (Exception e) {
+// Activator.log.error(e);
+// }
+// return null;
+//
+// };
+// }.doSwitch(parameterValue);
+// }
+// }
+// return null;
+//
+// }
+//
+// /**
+// * Evaluates a modisco query.
+// *
+// * @param query
+// * the query to evaluate
+// * @param context
+// * the context element against which the query is evaluated
+// * @param parameterValues
+// * the list of parameters for the query
+// * @return the result of the query evaluation
+// * @throws Exception
+// * exception thrown in case of problem during evaluation of the query
+// */
+// public static final Object evaluateQuery(final ModelQuery query, EObject context, List<ModelQueryParameterValue> parameterValues) throws Exception {
+// // checks that the query is valid
+// if(isValidQuery(query).isOK()) {
+// AbstractModelQuery myModelQuery;
+// myModelQuery = ModelQuerySetCatalog.getSingleton().getModelQueryImpl(query);
+// //the model query set evaluation
+// ModelQueryResult result = myModelQuery.evaluate(context, parameterValues);
+// if(result.getException() != null) {
+// throw new Exception();
+// }
+// return result.getValue();
+// }
+// throw new Exception("Query was not a valid query: " + query, null);
+// }
+//
+// /**
+// * Evaluates a modisco query, that should only return a boolean value.
+// *
+// * @param query
+// * the query to check and evaluate
+// * @param context
+// * the eobject on which the query is evaluated
+// * @param parameterValues
+// * the list of parameter values for the evaluation
+// * @return <code>true</code> if the context fills the condition given by the query
+// * @throws Exception
+// * exception thrown when the query can not be correctly evaluated
+// */
+// public static final boolean evaluateBooleanQuery(final ModelQuery query, EObject context, List<ModelQueryParameterValue> parameterValues) throws Exception {
+// Object result = evaluateQuery(query, context, parameterValues);
+// if(result instanceof Boolean) {
+// // try to cast into a boolean
+// return (Boolean)result;
+// }
+// Activator.log.error("Query did not return a boolean: " + result, null);
+// return defaultReturnValue;
+// }
+//
+// /**
+// * Retrieves a model query, given its name and its query set.
+// *
+// * @param queryName
+// * the name of the query
+// * @param querySetName
+// * the name of the query set
+// * @return the found model query or <code>null</code>.
+// * @throws ModelQueryNotFoundException
+// * exception thrown when the the query set was found but not the model query was not found.
+// * @throws ModelQuerySetNotFoundException
+// * exception thrown when the the query set was not found.
+// */
+// public static final ModelQuery retrieveModelQuery(String queryName, String querySetName) throws ModelQueryNotFoundException, ModelQuerySetNotFoundException {
+// ModelQuerySet querySet = ModelQuerySetCatalog.getSingleton().getModelQuerySet(querySetName);
+// if(querySet == null) {
+// throw new ModelQuerySetNotFoundException(querySetName);
+// }
+//
+// ModelQuery query = querySet.getQuery(queryName);
+// if(query == null) {
+// throw new ModelQueryNotFoundException(queryName);
+// }
+//
+// return query;
+// }
+//
+// /**
+// * Checks if the query is valid, i.e. not <code>null</code>, returning a boolean value, etc.
+// *
+// * @param query
+// * the query to test
+// * @return <code>true</code> if the query is valid
+// */
+// public static final IStatus isValidQuery(ModelQuery query) {
+// if(query == null) {
+// return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Query should not be null.");
+// }
+// return Status.OK_STATUS;
+// }
+//
+// /**
+// * Checks if the query is valid, i.e. not <code>null</code>, returning a boolean value, etc.
+// * @param query the query to test
+// * @return <code>true</code> if the query is valid
+// */
+// public static final IStatus isValidBooleanQuery(ModelQuery query) {
+// IStatus status = isValidQuery(query);
+// if(status.isOK()) {
+// // check the instance type is compatible with boolean
+// EClassifier returnType = query.getReturnType();
+// if(returnType == null) {
+// return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Query " + query.getName() + " does not have a return value, whereas it should have a boolean return status");
+// } else {
+// Class<?> instanceClass = returnType.getInstanceClass();
+// if(!boolean.class.isAssignableFrom(instanceClass)) {
+// return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Query " + query.getName() + " should return a value that can be cast into Boolean value. Currently: " + returnType.getInstanceClass());
+// }
+// // check return size of the query... should be 0..1 or 1..1 (even 0..1 could be difficult to handle, but we let this possible)
+// if(query.getUpperBound() > 1 || query.getUpperBound() < 0) {
+// return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Query " + query.getName() + " should return only one value. Currently: " + query.getUpperBound());
+// }
+// }
+// }
+// return status;
+// }
+//
+// /**
+// * Check if the set of given parameters is compatible with the query
+// * @param query the query against which the set of parameters is tested
+// * @param parameters the map of parameter names and their value
+// * @return the status corresponding to the validation
+// */
+// public static final IStatus isValidParameterSet(ModelQuery query, Map<String, Object> parameters) {
+// // check size, which should be equal.
+// int querySize = query.getParameters().size();
+// int parameterSize = parameters.keySet().size();
+//
+// if(querySize != parameterSize) {
+// return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The given parameters set do not have the same size (" + parameterSize + ") than the query parameter set (" + querySize + ")");
+// }
+//
+// List<IStatus> status = new ArrayList<IStatus>();
+//
+// // size is ok, checking names, type, multiplicity
+// for(String parameterName : parameters.keySet()) {
+// // retrieve the equivalent parameter in the query
+// ModelQueryParameter queryParameter = retrieveParameterByName(query, parameterName);
+// if(queryParameter == null) {
+// status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Impossible to find the parameter " + parameterName + " in the query parameters list for query: " + query.getName()));
+// }
+// }
+// if(status.size() > 0) {
+// return new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, status.toArray(new IStatus[status.size()]), "", null);
+// }
+// return Status.OK_STATUS;
+// }
+//
+// /**
+// * Retrieves a parameter, given the query to look into and the name of the parameter
+// *
+// * @param query
+// * the query where the parameter is stored
+// * @param parameterName
+// * the name of the parameter
+// * @return the parameter
+// */
+// private final static ModelQueryParameter retrieveParameterByName(ModelQuery query, String parameterName) {
+// for(ModelQueryParameter queryParameter : query.getParameters()) {
+// if(parameterName.equals(queryParameter.getName())) {
+// return queryParameter;
+// }
+// }
+// return null;
+// }
}
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.decoration/META-INF/MANIFEST.MF b/plugins/infra/services/org.eclipse.papyrus.infra.services.decoration/META-INF/MANIFEST.MF
index 4ad78236345..630381bf922 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.decoration/META-INF/MANIFEST.MF
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.decoration/META-INF/MANIFEST.MF
@@ -5,11 +5,11 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
org.apache.commons.lang;bundle-version="2.4.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.0",
org.eclipse.emf.ecore;bundle-version="2.8.0",
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.core.resources;bundle-version="3.7.0",
- org.eclipse.papyrus.infra.services.markerlistener;bundle-version="1.0.0"
+ org.eclipse.papyrus.infra.services.markerlistener;bundle-version="1.0.0",
+ org.eclipse.papyrus.emf.facet.custom.metamodel
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.decoration/src/org/eclipse/papyrus/infra/services/decoration/util/DecorationUtils.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.decoration/src/org/eclipse/papyrus/infra/services/decoration/util/DecorationUtils.java
index cc0d33be308..2c69f8b796c 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.decoration/src/org/eclipse/papyrus/infra/services/decoration/util/DecorationUtils.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.decoration/src/org/eclipse/papyrus/infra/services/decoration/util/DecorationUtils.java
@@ -21,7 +21,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.LinkItem;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EReferenceTreeElement;
import org.eclipse.papyrus.infra.services.decoration.DecorationService;
import org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions;
import org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions.MarkChildren;
@@ -61,9 +61,9 @@ public class DecorationUtils {
if(eObject != null) {
eObjects.add(eObject);
}
- else if(element instanceof LinkItem) {
+ else if(element instanceof EReferenceTreeElement) {
// for bug 391676
- for(Object child : ((LinkItem)element).getChildrenElements()) {
+ for(Object child : ((EReferenceTreeElement)element).getReferedEObjectTE()) {
if(child instanceof EObject) {
eObjects.add((EObject)child);
}
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF
index 14defd46cd4..4a1dcb0d3c4 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF
@@ -20,7 +20,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
- org.eclipse.papyrus.uml.modelexplorer;bundle-version="1.0.0"
+ org.eclipse.papyrus.uml.modelexplorer;bundle-version="1.0.0",
+ org.eclipse.papyrus.emf.facet.query.java.core
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml
index 0733c0705cb..c301fc748b9 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml
@@ -3,7 +3,7 @@
<plugin>
<!-- SysML ModelExplorer customization -->
-<extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+<!--extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
<browserCustomization
file="resources/SysMLDefaultExplorerCustomization.uiCustom"
loadByDefault="true"/>
@@ -12,7 +12,7 @@
<extension point="org.eclipse.emf.facet.infra.query.registration">
<modelqueryset file="resources/SysMLDefaultExplorerQueries.querySet"/>
</extension>
-
+-->
<!-- This declaration is added in order command (CommandHandler) status to be
verified (isVisible and isEnabled) before any attempt to execute the command,
and to mask the command in case it is not supported or executable.
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetImageQuery.java b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetImageQuery.java
index 0ded9eb1614..e3609d54cfc 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetImageQuery.java
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetImageQuery.java
@@ -1,26 +1,28 @@
package org.eclipse.papyrus.sysml.modelexplorer.query;
import org.eclipse.emf.common.util.URI;
-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.tools.utils.ElementUtil;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Stereotype;
/** Create a basic label based on element name */
-public class GetImageQuery implements IJavaModelQuery<Element, String> {
+public class GetImageQuery implements IJavaQuery2<Element, String> {
public static final String sysml_plugin_path = "/org.eclipse.papyrus.sysml/";
- public String evaluate(final Element context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ @Override
+ public String evaluate(Element source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
String iconPath = "";
- if(!context.getAppliedStereotypes().isEmpty()) {
- Stereotype first_stereotype = context.getAppliedStereotypes().get(0);
+ if(!source.getAppliedStereotypes().isEmpty()) {
+ Stereotype first_stereotype = source.getAppliedStereotypes().get(0);
if(!first_stereotype.getIcons().isEmpty()) {
- org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(context, first_stereotype, "icon");
+ org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(source, first_stereotype, "icon");
if(icon != null) {
iconPath = icon.getLocation();
}
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetLabelQuery.java b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetLabelQuery.java
index d8ef0e58495..ed8ed0310d9 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetLabelQuery.java
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/GetLabelQuery.java
@@ -1,20 +1,22 @@
package org.eclipse.papyrus.sysml.modelexplorer.query;
-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.uml2.uml.NamedElement;
/** Create a basic label based on element name */
-public class GetLabelQuery implements IJavaModelQuery<NamedElement, String> {
+public class GetLabelQuery implements IJavaQuery2<NamedElement, String> {
public static final String UNNAMED = "";
- public String evaluate(final NamedElement context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ @Override
+ public String evaluate(NamedElement source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
String label = UNNAMED;
- if(context.isSetName() && (!"".equals(context.getName()))) {
- label = context.getName();
+ if(source.isSetName() && (!"".equals(source.getName()))) {
+ label = source.getName();
}
return label;
}
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/HasImageQuery.java b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/HasImageQuery.java
index ca5f6978ecf..0e272ed6a44 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/HasImageQuery.java
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/query/HasImageQuery.java
@@ -1,17 +1,19 @@
package org.eclipse.papyrus.sysml.modelexplorer.query;
-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.uml2.uml.Element;
/** Check is the element has a stereotype icon that can be used */
-public class HasImageQuery implements IJavaModelQuery<Element, Boolean> {
+public class HasImageQuery implements IJavaQuery2<Element, Boolean> {
- public Boolean evaluate(final Element context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
- IJavaModelQuery<Element, String> ImgageGetter = new GetImageQuery();
- String temp_img_path = ImgageGetter.evaluate(context, parameterValues);
+ @Override
+ public Boolean evaluate(Element source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ IJavaQuery2<Element, String> ImgageGetter = new GetImageQuery();
+ String temp_img_path = ImgageGetter.evaluate(source, parameterValues,facetManager);
if(!"".equals(temp_img_path)) {
return true;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
index 5e559d9e02e..f2714f73afc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
@@ -62,7 +62,6 @@ Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.gmf.runtime.diagram.ui.actions,
org.eclipse.gmf.runtime.draw2d.ui.render;bundle-version="1.4.0",
org.eclipse.core.expressions,
- org.eclipse.papyrus.infra.extendedtypes;bundle-version="1.0.0",
org.eclipse.papyrus.infra.services.edit;bundle-version="1.0.0",
org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="1.0.0",
org.eclipse.papyrus.uml.diagram.navigation;bundle-version="1.0.0",
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/META-INF/MANIFEST.MF
index 0cb42cd5d33..118a64c6a39 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/META-INF/MANIFEST.MF
@@ -9,7 +9,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.emf.ecore.edit;visibility:=reexport,
org.eclipse.uml2.uml,
- org.eclipse.uml2.uml.edit
+ org.eclipse.uml2.uml.edit,
+ org.eclipse.papyrus.emf.facet.efacet.metamodel.edit
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/edit/provider/PaletteConfigurationEditPlugin.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/edit/provider/PaletteConfigurationEditPlugin.java
index a63daeb7400..29411db023c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/edit/provider/PaletteConfigurationEditPlugin.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/edit/provider/PaletteConfigurationEditPlugin.java
@@ -9,9 +9,9 @@ package org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit.provider;
import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
-import org.eclipse.emf.facet.infra.query.edit.provider.QueryEditPlugin;
import org.eclipse.papyrus.infra.queries.core.configuration.provider.ConfigurationEditPlugin;
import org.eclipse.uml2.uml.edit.UMLEditPlugin;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.provider.Efacet2EditPlugin;
/**
* This is the central singleton for the PaletteConfiguration edit plugin.
@@ -47,7 +47,7 @@ public final class PaletteConfigurationEditPlugin extends EMFPlugin {
(new ResourceLocator [] {
ConfigurationEditPlugin.INSTANCE,
EcoreEditPlugin.INSTANCE,
- QueryEditPlugin.INSTANCE,
+ Efacet2EditPlugin.INSTANCE,
UMLEditPlugin.INSTANCE,
});
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore
index c1a3bec3865..c2b3f039c19 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage 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" name="paletteconfiguration"
- nsURI="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7" nsPrefix="paletteconfiguration">
+<ecore:EPackage 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" name="paletteconfiguration" nsURI="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7"
+ nsPrefix="paletteconfiguration">
<eClassifiers xsi:type="ecore:EClass" name="PaletteConfiguration" eSuperTypes="#//Configuration">
<eStructuralFeatures xsi:type="ecore:EReference" name="drawerConfigurations" lowerBound="1"
upperBound="-1" eType="#//DrawerConfiguration" containment="true"/>
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF
index d4a5c5195f1..192fa92e84c 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/META-INF/MANIFEST.MF
@@ -24,9 +24,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.uml.tools;bundle-version="1.0.0",
org.eclipse.papyrus.uml.service.types;bundle-version="1.0.0",
org.eclipse.papyrus.infra.services.edit;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.browser.custom;bundle-version="0.3.0",
- org.eclipse.emf.facet.infra.browser.custom.core;bundle-version="0.3.0",
- org.eclipse.emf.facet.infra.common.core;bundle-version="0.3.0"
+ org.eclipse.papyrus.emf.facet.custom.metamodel,
+ org.eclipse.papyrus.emf.facet.query.java.core
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml
index 5d196555d43..e02182aacaa 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/plugin.xml
@@ -1087,7 +1087,7 @@
</factory>
</extension>
- <extension point="org.eclipse.emf.facet.infra.facet.registration">
+ <!--extension point="org.eclipse.emf.facet.infra.facet.registration">
<facetset file="resource/PapyrusUMLFacet.facetSet">
</facetset>
</extension>
@@ -1099,7 +1099,7 @@
file="resource/SimpleUML.uiCustom"
loadByDefault="true">
</browserCustomization>
- </extension>
+ </extension-->
<extension point= "org.eclipse.ui.handlers">
<handler class= "org.eclipse.papyrus.uml.modelexplorer.handler.AbstractionHandler" commandId="org.eclipse.papyrus.uml.service.types.AbstractionCreateCommand">
<activeWhen>
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerHandler.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerHandler.java
index 7b300a71d38..4907c32f23c 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerHandler.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerHandler.java
@@ -13,24 +13,11 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.modelexplorer.handler;
-import java.util.LinkedList;
-import java.util.List;
-
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.emf.facet.custom.core.ICustomizationManager;
-import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
-import org.eclipse.emf.facet.infra.browser.custom.core.CustomizationsCatalog;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
import org.eclipse.papyrus.views.modelexplorer.Activator;
-import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.navigator.CommonNavigator;
/**
* A Handler to toggle the Advanced/Simple UML ModelExplorer customization
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerState.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerState.java
index 6c760eed1e7..4522c28ce36 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerState.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerState.java
@@ -14,11 +14,6 @@
package org.eclipse.papyrus.uml.modelexplorer.handler;
import org.eclipse.core.commands.State;
-import org.eclipse.emf.facet.custom.core.ICustomizationManager;
-import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
-import org.eclipse.emf.facet.infra.browser.custom.core.CustomizationsCatalog;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
-import org.eclipse.papyrus.views.modelexplorer.Activator;
/**
* State for the AdvancedModelExplorer toggle action
@@ -34,17 +29,17 @@ public class ToggleAdvancedModelExplorerState extends State {
@Override
public Boolean getValue() {
- MetamodelView simpleUMLCustomization = CustomizationsCatalog.getInstance().getCustomization(ToggleAdvancedModelExplorerHandler.SIMPLE_UML_CUSTOMIZATION);
- if(simpleUMLCustomization == null) {
- //The SimpleUML Customization doesn't exist. The advanced mode is activated
- return true;
- }
-
- ICustomizationManager customizationManager = Activator.getDefault().getCustomizationManager();
- if(customizationManager == null) {
- //Should not happen, this is a singleton
- return false;
- }
+// MetamodelView simpleUMLCustomization = CustomizationsCatalog.getInstance().getCustomization(ToggleAdvancedModelExplorerHandler.SIMPLE_UML_CUSTOMIZATION);
+// if(simpleUMLCustomization == null) {
+// //The SimpleUML Customization doesn't exist. The advanced mode is activated
+// return true;
+// }
+//
+// ICustomizationManager customizationManager = Activator.getDefault().getCustomizationManager();
+// if(customizationManager == null) {
+// //Should not happen, this is a singleton
+// return false;
+// }
return false;
//return !customizationManager.getRegisteredCustomizations().contains(simpleUMLCustomization);
}
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetComplexName.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetComplexName.java
index a7db6897f64..502050a1c7c 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetComplexName.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetComplexName.java
@@ -5,28 +5,27 @@ package org.eclipse.papyrus.uml.modelexplorer.queries;
import java.util.List;
-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.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Stereotype;
/** get the name + the list of applied stereotypes */
-public class GetComplexName implements IJavaModelQuery<NamedElement, String> {
+public class GetComplexName implements IJavaQuery2<NamedElement, String> {
/** left Stereotype delimiters ('Guillemets francais'). */
public static String ST_LEFT = String.valueOf("\u00AB"); //$NON-NLS-1$
/** Right Stereotype delimiters ('Guillemets francais'). */
public static String ST_RIGHT = String.valueOf("\u00BB"); //$NON-NLS-1$
- public String evaluate(final NamedElement context,
- final ParameterValueList parameterValues)
- throws ModelQueryExecutionException {
- // TODO Auto-generated method stub
+
+ public String evaluate(NamedElement source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
String txt = ""; //$NON-NLS-1$
- List<Stereotype> stereoList = context.getAppliedStereotypes();
+ List<Stereotype> stereoList = source.getAppliedStereotypes();
if (stereoList.size() == 0) {
- return context.getName();
+ return source.getName();
} else {
for (int i = 0; i < stereoList.size(); i++) {
txt = txt + stereoList.get(i).getName();
@@ -34,7 +33,7 @@ public class GetComplexName implements IJavaModelQuery<NamedElement, String> {
txt = txt + ", "; //$NON-NLS-1$
}
}
- txt = ST_LEFT + txt + ST_RIGHT + " " + context.getName(); //$NON-NLS-1$
+ txt = ST_LEFT + txt + ST_RIGHT + " " + source.getName(); //$NON-NLS-1$
return txt;
}
}
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetContainedDiagrams.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetContainedDiagrams.java
index 7354ad1f1c6..90db5ec72d8 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetContainedDiagrams.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetContainedDiagrams.java
@@ -19,9 +19,10 @@ import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
-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.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
@@ -34,11 +35,12 @@ import org.eclipse.uml2.uml.Element;
* @Deprecated : use oep.infra.gmfdiag.modelexplorer#queries.GetContainedDiagrams
*/
@Deprecated
-public class GetContainedDiagrams extends AbstractEditorContainerQuery implements IJavaModelQuery<Element, Collection<org.eclipse.gmf.runtime.notation.Diagram>> {
+public class GetContainedDiagrams extends AbstractEditorContainerQuery implements IJavaQuery2<Element, Collection<org.eclipse.gmf.runtime.notation.Diagram>> {
- public Collection<Diagram> evaluate(final Element context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+
+ public Collection<Diagram> evaluate(Element source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
List<Diagram> result = new ArrayList<Diagram>();
- Iterator<EObject> roots = NavigatorUtils.getNotationRoots(context);
+ Iterator<EObject> roots = NavigatorUtils.getNotationRoots(source);
if(roots == null) {
return result;
}
@@ -46,7 +48,7 @@ public class GetContainedDiagrams extends AbstractEditorContainerQuery implement
while(roots.hasNext()) {
EObject root = roots.next();
if(root instanceof Diagram) {
- if(EcoreUtil.equals(((Diagram)root).getElement(), context)) {
+ if(EcoreUtil.equals(((Diagram)root).getElement(), source)) {
result.add((Diagram)root);
}
}
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetDiagramIcon.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetDiagramIcon.java
index 296d5eb3eb5..61e2e9f002c 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetDiagramIcon.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetDiagramIcon.java
@@ -12,9 +12,10 @@
*/
package org.eclipse.papyrus.uml.modelexplorer.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.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.views.modelexplorer.queries.AbstractGetEditorIconQuery;
@@ -24,9 +25,10 @@ import org.eclipse.papyrus.views.modelexplorer.queries.AbstractGetEditorIconQuer
* @Deprecated : use oep.infra.gmfdiag.modelexplorer#queries.GetDiagramIcon
*/
@Deprecated
-public class GetDiagramIcon extends AbstractGetEditorIconQuery implements IJavaModelQuery<Diagram, String> {
+public class GetDiagramIcon extends AbstractGetEditorIconQuery implements IJavaQuery2<Diagram, String> {
- public String evaluate(final Diagram context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
- return "/" + getEditorRegistry(context).getEditorURLIcon(context); //$NON-NLS-1$
+
+ public String evaluate(Diagram source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ return "/" + getEditorRegistry(source).getEditorURLIcon(source); //$NON-NLS-1$
}
}
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetName.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetName.java
index 78f63761749..62cdac24fea 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetName.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetName.java
@@ -2,16 +2,16 @@
*
*/
package org.eclipse.papyrus.uml.modelexplorer.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.uml2.uml.NamedElement;
/** get the name + the list of stereotypes from a named Element */
-public class GetName implements IJavaModelQuery<NamedElement, String> {
- public String evaluate(final NamedElement context, final ParameterValueList parameterValues)
- throws ModelQueryExecutionException {
- // TODO Auto-generated method stub
- return context.getName();
+public class GetName implements IJavaQuery2<NamedElement, String> {
+
+ public String evaluate(NamedElement source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ return source.getName();
}
}
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsDiagram.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsDiagram.java
index 2caeceaa3d6..b7220be7740 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsDiagram.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsDiagram.java
@@ -13,9 +13,10 @@
package org.eclipse.papyrus.uml.modelexplorer.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.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.gmf.runtime.notation.Diagram;
/**
@@ -24,10 +25,10 @@ import org.eclipse.gmf.runtime.notation.Diagram;
* @Deprecated : use oep.infra.gmfdiag.modelexplorer#queries.IsDiagram
*/
@Deprecated
-public class IsDiagram implements IJavaModelQuery<EObject, Boolean> {
+public class IsDiagram implements IJavaQuery2<EObject, Boolean> {
- public Boolean evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
- return context instanceof Diagram;
- }
+ public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ return source instanceof Diagram;
+ }
}
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsDiagramContainer.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsDiagramContainer.java
index 09086c714b5..c266606b588 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsDiagramContainer.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsDiagramContainer.java
@@ -16,9 +16,10 @@ import java.util.Iterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
-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.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
@@ -29,11 +30,11 @@ import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQu
* @Deprecated : use oep.infra.gmfdiag.modelexplorer#queries.IsDiagramContainer
*/
@Deprecated
-public class IsDiagramContainer extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Boolean> {
+public class IsDiagramContainer extends AbstractEditorContainerQuery implements IJavaQuery2<EObject, Boolean> {
- public Boolean evaluate(final EObject context, ParameterValueList parameterValues) throws ModelQueryExecutionException {
- Iterator<EObject> roots = NavigatorUtils.getNotationRoots(context);
+ public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ Iterator<EObject> roots = NavigatorUtils.getNotationRoots(source);
if(roots == null) {
return false;
}
@@ -41,11 +42,11 @@ public class IsDiagramContainer extends AbstractEditorContainerQuery implements
while(roots.hasNext()) {
EObject root = roots.next();
if(root instanceof Diagram) {
- if(EcoreUtil.equals(((Diagram)root).getElement(), context)) {
+ if(EcoreUtil.equals(((Diagram)root).getElement(), source)) {
return true;
}
}
}
return false;
}
-}
+ }
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsReadOnly.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsReadOnly.java
index 68067243454..3fcf11abef6 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsReadOnly.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/IsReadOnly.java
@@ -16,9 +16,10 @@ package org.eclipse.papyrus.uml.modelexplorer.queries;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
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.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;
/**
* Create a query which will return true if the ressource is in read only mode.
@@ -28,12 +29,13 @@ import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
* @deprecated use org.eclipse.papyrus.views.modelexploer#queries.IsReadOnly
*/
@Deprecated
-public class IsReadOnly implements IJavaModelQuery<EObject, Boolean> {
+public class IsReadOnly implements IJavaQuery2<EObject, Boolean> {
- public Boolean evaluate(EObject context, ParameterValueList parameterValues) throws ModelQueryExecutionException {
- EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(context);
+
+ public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(source);
if(editingDomain != null) {
- if(editingDomain.isReadOnly(context.eResource())) {
+ if(editingDomain.isReadOnly(source.eResource())) {
return true;
}
}
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/util/ModelExplorerUtils.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/util/ModelExplorerUtils.java
index b3d9b140921..8ee774dcf95 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/util/ModelExplorerUtils.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/util/ModelExplorerUtils.java
@@ -14,7 +14,7 @@ package org.eclipse.papyrus.uml.modelexplorer.util;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.LinkItem;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EReferenceTreeElement;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.papyrus.uml.service.types.utils.CommandContext;
import org.eclipse.papyrus.uml.service.types.utils.ICommandContext;
@@ -63,8 +63,8 @@ public class ModelExplorerUtils {
// The following part introduce a dependency to EMF Facet.
// Although the selection can be adapted to EReference, the link parent is required but
// no API allows to get this element except LinkItem or ITreeElement.
- if((reference != null) && (selection instanceof LinkItem)) {
- container = ((LinkItem)selection).getParent();
+ if((reference != null) && (selection instanceof EReferenceTreeElement )) {
+ container = ((EReferenceTreeElement)selection).getParent();
}
}
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF
index 94dae150f57..f119e8bc100 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/META-INF/MANIFEST.MF
@@ -44,7 +44,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.0",
org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="0.4.0",
org.eclipse.papyrus.emf.facet.custom.metamodel,
- org.eclipse.papyrus.emf.facet.util.ui;bundle-version="0.4.0"
+ org.eclipse.papyrus.emf.facet.util.ui;bundle-version="0.4.0",
+ org.eclipse.papyrus.emf.facet.query.java.core
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/Activator.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/Activator.java
index abb1d8bb337..a6c82a96464 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/Activator.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/Activator.java
@@ -15,24 +15,15 @@ package org.eclipse.papyrus.views.modelexplorer;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.edit.EMFEditPlugin;
import org.eclipse.emf.facet.custom.core.ICustomizationManager;
-import org.eclipse.emf.facet.infra.browser.Messages;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/DecoratingLabelProviderWTooltips.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/DecoratingLabelProviderWTooltips.java
index 858f3da6f5b..c87912ecd2c 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/DecoratingLabelProviderWTooltips.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/DecoratingLabelProviderWTooltips.java
@@ -23,7 +23,7 @@ import java.util.Observer;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.LinkItem;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EReferenceTreeElement;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
import org.eclipse.papyrus.infra.core.services.ServiceException;
@@ -116,7 +116,7 @@ public class DecoratingLabelProviderWTooltips extends NavigatorDecoratingLabelPr
//Set the adapter decoration with position as indicated by decoration (from decoration service)
if(element != null) {
- if(element instanceof EObject || element instanceof LinkItem // fix for bug 391676
+ if(element instanceof EObject || element instanceof EReferenceTreeElement // fix for bug 391676
|| (element instanceof IAdaptable && ((IAdaptable)element).getAdapter(EObject.class) != null)) {
List<IPapyrusDecoration> decorations = decorationService.getDecorations(element, true);
if(decorations != null) {
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/LinkNodeAdapterFactory.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/LinkNodeAdapterFactory.java
index a48dafd5514..c078e701185 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/LinkNodeAdapterFactory.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/LinkNodeAdapterFactory.java
@@ -12,7 +12,7 @@ package org.eclipse.papyrus.views.modelexplorer;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.LinkItem;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EReferenceTreeElement;
/**
* This factory returns a LinkNode instance for any adapter instancing LinkItem or EReference
@@ -24,7 +24,7 @@ public class LinkNodeAdapterFactory implements IAdapterFactory {
public Object getAdapter(Object adaptableObject, Class adapterType) {
if(adapterType == LinkNode.class) {
- if(adaptableObject instanceof LinkItem || adaptableObject instanceof EReference) {
+ if(adaptableObject instanceof EReferenceTreeElement || adaptableObject instanceof EReference) {
return LinkNode.LinkNodeInstance;
}
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dialog/PapyrusLoadBrowserCustomizationDialog.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dialog/PapyrusLoadBrowserCustomizationDialog.java
index 88fcbfaf584..75f9c2e4f4a 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dialog/PapyrusLoadBrowserCustomizationDialog.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dialog/PapyrusLoadBrowserCustomizationDialog.java
@@ -20,11 +20,11 @@ import java.util.List;
import java.util.Set;
import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
-import org.eclipse.emf.facet.infra.browser.custom.core.CustomizationsCatalog;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.util.ImageProvider;
-import org.eclipse.emf.facet.infra.common.core.internal.utils.ModelUtils;
-import org.eclipse.emf.facet.infra.facet.FacetSet;
+//import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
+//import org.eclipse.emf.facet.infra.browser.custom.core.CustomizationsCatalog;
+//import org.eclipse.emf.facet.infra.browser.uicore.internal.util.ImageProvider;
+//import org.eclipse.emf.facet.infra.common.core.internal.utils.ModelUtils;
+//import org.eclipse.emf.facet.infra.facet.FacetSet;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
@@ -54,237 +54,242 @@ import org.eclipse.swt.widgets.Shell;
@SuppressWarnings({ "deprecation", "restriction" })
public class PapyrusLoadBrowserCustomizationDialog extends MultipleValueSelectorDialog {
- protected final Collection<EPackage> ePackages;
-
- /**
- * Creates a new dialog to select the EMF Facet uiCustom (Browser customizations) to apply
- *
- * @param parentShell
- * The parent shell for this dialog
- * @param initialSelection
- * The list of browser customization currently applied
- * @param ePackages
- * The list of EPackages used to filter the Browser Customizations to display. Only compatible browser customizations will be displayed to
- * the user.
- * This filter is only graphical (i.e. customizations which do not match these EPackages might still be returned by this dialog)
- * @param manager
- * The Customization
- */
- public PapyrusLoadBrowserCustomizationDialog(Shell parentShell, List<MetamodelView> initialSelection, Collection<EPackage> ePackages) {
- this(parentShell, getElementSelector(ePackages), initialSelection, ePackages);
- }
-
- protected PapyrusLoadBrowserCustomizationDialog(Shell parentShell, IElementSelector selector, List<MetamodelView> initialSelection, Collection<EPackage> ePackages) {
+ public PapyrusLoadBrowserCustomizationDialog(Shell parentShell, IElementSelector selector) {
super(parentShell, selector);
-
- this.ePackages = ePackages;
-
- setInitialElementSelections(initialSelection);
-
- setOrdered(true);
- setLabelProvider(createLabelProvider());
- setTitle("Select browser customizations");
+ // TODO Auto-generated constructor stub
}
- /**
- * {@inheritDoc}
- *
- * Adds the EMF Facet UICustom icon to the dialog
- */
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setImage(ImageProvider.getInstance().getUiCustomIcon());
- }
-
- /**
- * The IElementSelector used for the left panel of this dialog. This is a simple ReferenceSelector for available UICustoms
- *
- * @param ePackages
- * The EPackages used to filter the compatible UICustom to display to the user
- * @return
- */
- protected static IElementSelector getElementSelector(final Collection<EPackage> ePackages) {
- ReferenceSelector selector = new ReferenceSelector(true) {
-
- @Override
- public void createControls(Composite parent) {
- super.createControls(parent);
- installCompatibleCustomizationViewerFilter(treeViewer, ePackages);
- }
- };
-
- List<MetamodelView> registryAllCustomizations = CustomizationsCatalog.getInstance().getRegistryCustomizations();
-
- IStaticContentProvider semanticProvider = new StaticContentProvider(registryAllCustomizations.toArray());
- IStaticContentProvider filteredProvider = new FilteredContentProvider(semanticProvider);
-
- selector.setContentProvider(filteredProvider);
- selector.setLabelProvider(createLabelProvider());
-
- return selector;
- }
-
- /**
- * The ID of the "Restore defaults" button
- */
- public static final int RESTORE_ID = IDialogConstants.CLIENT_ID + 1;
-
- /**
- * {@inheritDoc}
- *
- * Adds a "restore defaults" button
- */
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, RESTORE_ID, "Restore defaults", false);
- super.createButtonsForButtonBar(parent);
- }
-
- /**
- * {@inheritDoc}
- *
- * Adds support for the Restore Default button/action
- */
- @Override
- protected void buttonPressed(int buttonId) {
- if(buttonId == RESTORE_ID) {
- restorePressed();
- } else {
- super.buttonPressed(buttonId);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * Installs a filter for the compatible UICustom models to display to the user
- */
- @Override
- public void create() {
- super.create();
- installCompatibleCustomizationViewerFilter(selectedElementsViewer, ePackages);
- getShell().pack();
- }
-
- /**
- * Install the compatible UICustom filter to the given viewer
- *
- * @param viewer
- * The viewer to filter
- * @param ePackages
- * The UICustom models will be displayed if they are compatible with one of these EPackages
- */
- protected static void installCompatibleCustomizationViewerFilter(StructuredViewer viewer, Collection<EPackage> ePackages) {
- List<ViewerFilter> currentFilters = ListHelper.asList(viewer.getFilters());
- currentFilters.add(createCompatibleCustomizationViewerFilter(ePackages));
- viewer.setFilters(currentFilters.toArray(new ViewerFilter[currentFilters.size()]));
- }
-
- /**
- * Creates a filter for the compatible UICustom
- *
- * @param ePackages
- * The UICustom models will be displayed if they are compatible with one of these EPackages
- */
- protected static ViewerFilter createCompatibleCustomizationViewerFilter(Collection<EPackage> ePackages) {
- final Set<String> ePackageURIs = new HashSet<String>();
-
- for(EPackage ePackage : ePackages) {
- ePackageURIs.add(ePackage.getNsURI());
- final Set<EPackage> referencedPackages = ModelUtils.computeReferencedPackages(ePackage);
- for(EPackage referencedEPackage : referencedPackages) {
- ePackageURIs.add(referencedEPackage.getNsURI());
- }
- }
-
- return new ViewerFilter() {
-
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if(element instanceof MetamodelView) {
- MetamodelView customization = (MetamodelView)element;
-
- String nsURI = customization.getMetamodelURI();
-
- if(ePackageURIs.contains(nsURI)) {
- return true;
- }
-
- EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(nsURI);
- while(ePackage != null) {
- if(ePackageURIs.contains(ePackage.getNsURI())) {
- return true;
- }
-
- // allow customizations on Facets
- if(ePackage instanceof FacetSet) {
- FacetSet facetSet = (FacetSet)ePackage;
- ePackage = facetSet.getExtendedPackage();
- } else {
- // allow customizations on sub-packages
- ePackage = ePackage.getESuperPackage();
- }
- }
-
- return false;
- }
-
- return true;
- }
-
- };
- }
-
- /**
- * The "restore defaults" action
- */
- protected void restorePressed() {
- List<MetamodelView> defaultCustomizations = CustomizationsCatalog.getInstance().getRegistryDefaultCustomizations();
- Object[] filteredCustomizations = defaultCustomizations.toArray();
-
- removeAllAction();
- addElements(filteredCustomizations);
- selector.setSelectedElements(allElements.toArray());
- }
-
- /**
- * Returns the list of selected customizations (including the ones hidden by the compatible EPackage filter)
- *
- * @return
- */
- public List<MetamodelView> getSelectedCustomizations() {
- Object[] result = super.getResult();
- List<MetamodelView> customizations = new ArrayList<MetamodelView>();
- for(Object element : result) {
- if(element instanceof MetamodelView) {
- customizations.add((MetamodelView)element);
- }
- }
-
- return customizations;
- }
-
- //Copied from {@link org.eclipse.emf.facet.infra.browser.custom.ui.dialogs.LoadCustomizationsDialog#createLabelProvider()}
- /**
- * Creates a LabelProvider for EMF Facet MetamodelView elements
- *
- * @return the label provider for the Dialog
- */
- protected static ILabelProvider createLabelProvider() {
- return new LabelProvider() {
-
- @Override
- public String getText(final Object element) {
- final MetamodelView metamodelView = (MetamodelView)element;
- return metamodelView.getName();
- }
-
- @Override
- public Image getImage(final Object element) {
- return ImageProvider.getInstance().getUiCustomIcon();
- }
- };
- }
+///** protected final Collection<EPackage> ePackages;
+//
+// /**
+// * Creates a new dialog to select the EMF Facet uiCustom (Browser customizations) to apply
+// *
+// * @param parentShell
+// * The parent shell for this dialog
+// * @param initialSelection
+// * The list of browser customization currently applied
+// * @param ePackages
+// * The list of EPackages used to filter the Browser Customizations to display. Only compatible browser customizations will be displayed to
+// * the user.
+// * This filter is only graphical (i.e. customizations which do not match these EPackages might still be returned by this dialog)
+// * @param manager
+// * The Customization
+// */
+// public PapyrusLoadBrowserCustomizationDialog(Shell parentShell, List<MetamodelView> initialSelection, Collection<EPackage> ePackages) {
+// this(parentShell, getElementSelector(ePackages), initialSelection, ePackages);
+// }
+//
+// protected PapyrusLoadBrowserCustomizationDialog(Shell parentShell, IElementSelector selector, List<MetamodelView> initialSelection, Collection<EPackage> ePackages) {
+// super(parentShell, selector);
+//
+// this.ePackages = ePackages;
+//
+// setInitialElementSelections(initialSelection);
+//
+// setOrdered(true);
+// setLabelProvider(createLabelProvider());
+// setTitle("Select browser customizations");
+// }
+//
+// /**
+// * {@inheritDoc}
+// *
+// * Adds the EMF Facet UICustom icon to the dialog
+// */
+// @Override
+// protected void configureShell(Shell shell) {
+// super.configureShell(shell);
+// shell.setImage(ImageProvider.getInstance().getUiCustomIcon());
+// }
+//
+// /**
+// * The IElementSelector used for the left panel of this dialog. This is a simple ReferenceSelector for available UICustoms
+// *
+// * @param ePackages
+// * The EPackages used to filter the compatible UICustom to display to the user
+// * @return
+// */
+// protected static IElementSelector getElementSelector(final Collection<EPackage> ePackages) {
+// ReferenceSelector selector = new ReferenceSelector(true) {
+//
+// @Override
+// public void createControls(Composite parent) {
+// super.createControls(parent);
+// installCompatibleCustomizationViewerFilter(treeViewer, ePackages);
+// }
+// };
+//
+// List<MetamodelView> registryAllCustomizations = CustomizationsCatalog.getInstance().getRegistryCustomizations();
+//
+// IStaticContentProvider semanticProvider = new StaticContentProvider(registryAllCustomizations.toArray());
+// IStaticContentProvider filteredProvider = new FilteredContentProvider(semanticProvider);
+//
+// selector.setContentProvider(filteredProvider);
+// selector.setLabelProvider(createLabelProvider());
+//
+// return selector;
+// }
+//
+// /**
+// * The ID of the "Restore defaults" button
+// */
+// public static final int RESTORE_ID = IDialogConstants.CLIENT_ID + 1;
+//
+// /**
+// * {@inheritDoc}
+// *
+// * Adds a "restore defaults" button
+// */
+// @Override
+// protected void createButtonsForButtonBar(Composite parent) {
+// createButton(parent, RESTORE_ID, "Restore defaults", false);
+// super.createButtonsForButtonBar(parent);
+// }
+//
+// /**
+// * {@inheritDoc}
+// *
+// * Adds support for the Restore Default button/action
+// */
+// @Override
+// protected void buttonPressed(int buttonId) {
+// if(buttonId == RESTORE_ID) {
+// restorePressed();
+// } else {
+// super.buttonPressed(buttonId);
+// }
+// }
+//
+// /**
+// * {@inheritDoc}
+// *
+// * Installs a filter for the compatible UICustom models to display to the user
+// */
+// @Override
+// public void create() {
+// super.create();
+// installCompatibleCustomizationViewerFilter(selectedElementsViewer, ePackages);
+// getShell().pack();
+// }
+//
+// /**
+// * Install the compatible UICustom filter to the given viewer
+// *
+// * @param viewer
+// * The viewer to filter
+// * @param ePackages
+// * The UICustom models will be displayed if they are compatible with one of these EPackages
+// */
+// protected static void installCompatibleCustomizationViewerFilter(StructuredViewer viewer, Collection<EPackage> ePackages) {
+// List<ViewerFilter> currentFilters = ListHelper.asList(viewer.getFilters());
+// currentFilters.add(createCompatibleCustomizationViewerFilter(ePackages));
+// viewer.setFilters(currentFilters.toArray(new ViewerFilter[currentFilters.size()]));
+// }
+//
+// /**
+// * Creates a filter for the compatible UICustom
+// *
+// * @param ePackages
+// * The UICustom models will be displayed if they are compatible with one of these EPackages
+// */
+// protected static ViewerFilter createCompatibleCustomizationViewerFilter(Collection<EPackage> ePackages) {
+// final Set<String> ePackageURIs = new HashSet<String>();
+//
+// for(EPackage ePackage : ePackages) {
+// ePackageURIs.add(ePackage.getNsURI());
+// final Set<EPackage> referencedPackages = ModelUtils.computeReferencedPackages(ePackage);
+// for(EPackage referencedEPackage : referencedPackages) {
+// ePackageURIs.add(referencedEPackage.getNsURI());
+// }
+// }
+//
+// return new ViewerFilter() {
+//
+// @Override
+// public boolean select(Viewer viewer, Object parentElement, Object element) {
+// if(element instanceof MetamodelView) {
+// MetamodelView customization = (MetamodelView)element;
+//
+// String nsURI = customization.getMetamodelURI();
+//
+// if(ePackageURIs.contains(nsURI)) {
+// return true;
+// }
+//
+// EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(nsURI);
+// while(ePackage != null) {
+// if(ePackageURIs.contains(ePackage.getNsURI())) {
+// return true;
+// }
+//
+// // allow customizations on Facets
+// if(ePackage instanceof FacetSet) {
+// FacetSet facetSet = (FacetSet)ePackage;
+// ePackage = facetSet.getExtendedPackage();
+// } else {
+// // allow customizations on sub-packages
+// ePackage = ePackage.getESuperPackage();
+// }
+// }
+//
+// return false;
+// }
+//
+// return true;
+// }
+//
+// };
+// }
+//
+// /**
+// * The "restore defaults" action
+// */
+// protected void restorePressed() {
+// List<MetamodelView> defaultCustomizations = CustomizationsCatalog.getInstance().getRegistryDefaultCustomizations();
+// Object[] filteredCustomizations = defaultCustomizations.toArray();
+//
+// removeAllAction();
+// addElements(filteredCustomizations);
+// selector.setSelectedElements(allElements.toArray());
+// }
+//
+// /**
+// * Returns the list of selected customizations (including the ones hidden by the compatible EPackage filter)
+// *
+// * @return
+// */
+// public List<MetamodelView> getSelectedCustomizations() {
+// Object[] result = super.getResult();
+// List<MetamodelView> customizations = new ArrayList<MetamodelView>();
+// for(Object element : result) {
+// if(element instanceof MetamodelView) {
+// customizations.add((MetamodelView)element);
+// }
+// }
+//
+// return customizations;
+// }
+//
+// //Copied from {@link org.eclipse.emf.facet.infra.browser.custom.ui.dialogs.LoadCustomizationsDialog#createLabelProvider()}
+// /**
+// * Creates a LabelProvider for EMF Facet MetamodelView elements
+// *
+// * @return the label provider for the Dialog
+// */
+// protected static ILabelProvider createLabelProvider() {
+// return new LabelProvider() {
+//
+// @Override
+// public String getText(final Object element) {
+// final MetamodelView metamodelView = (MetamodelView)element;
+// return metamodelView.getName();
+// }
+//
+// @Override
+// public Image getImage(final Object element) {
+// return ImageProvider.getInstance().getUiCustomIcon();
+// }
+// };
+// }
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dnd/CommonDropAdapterAssistant.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dnd/CommonDropAdapterAssistant.java
index 4e277698801..72c48ffc09f 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dnd/CommonDropAdapterAssistant.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/dnd/CommonDropAdapterAssistant.java
@@ -35,8 +35,8 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.LinkItem;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.ModelElementItem;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EObjectTreeElement;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EReferenceTreeElement;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
@@ -299,19 +299,19 @@ public class CommonDropAdapterAssistant extends org.eclipse.ui.navigator.CommonD
switch(dropAdapter.getCurrentOperation()) {
case DND.DROP_MOVE:
if(dropAdapter.getCurrentLocation() == ViewerDropAdapter.LOCATION_BEFORE) {
- if(target instanceof ModelElementItem) {
+ if(target instanceof EObjectTreeElement) {
commandList = getOrderChangeCommand(target, true);
}
} else if(dropAdapter.getCurrentLocation() == ViewerDropAdapter.LOCATION_AFTER) {
- if(target instanceof ModelElementItem) {
+ if(target instanceof EObjectTreeElement) {
commandList = getOrderChangeCommand(target, false);
}
} else if(dropAdapter.getCurrentLocation() == ViewerDropAdapter.LOCATION_ON) {
- if(target instanceof ModelElementItem) {
+ if(target instanceof EObjectTreeElement) {
commandList = getDropIntoCommand(target, null);
}
- if(target instanceof LinkItem) {
- commandList = getDropIntoCommand(((LinkItem)target).getParent(), ((LinkItem)target).getReference());
+ if(target instanceof EReferenceTreeElement) {
+ commandList = getDropIntoCommand(((EReferenceTreeElement)target).getParent(), ((EReferenceTreeElement)target).getEReference());
}
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java
index dd0df344599..34c59047e64 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java
@@ -35,13 +35,13 @@ import org.eclipse.emf.facet.custom.core.ICustomizationManager;
import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
import org.eclipse.emf.facet.custom.ui.internal.exported.dialog.ILoadCustomizationsDialog;
import org.eclipse.emf.facet.custom.ui.internal.exported.dialog.ILoadCustomizationsDialogFactory;
-import org.eclipse.emf.facet.infra.browser.Messages;
-import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
-import org.eclipse.emf.facet.infra.browser.custom.TypeView;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
-import org.eclipse.emf.facet.infra.facet.Facet;
-import org.eclipse.emf.facet.infra.facet.FacetSet;
-import org.eclipse.emf.facet.infra.facet.core.FacetSetCatalog;
+//import org.eclipse.emf.facet.infra.browser.Messages;
+//import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
+//import org.eclipse.emf.facet.infra.browser.custom.TypeView;
+//import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
+//import org.eclipse.emf.facet.infra.facet.Facet;
+//import org.eclipse.emf.facet.infra.facet.FacetSet;
+//import org.eclipse.emf.facet.infra.facet.core.FacetSetCatalog;
import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialogCallback;
import org.eclipse.emf.facet.util.ui.internal.exported.dialog.IDialogCallbackWithPreCommit;
import org.eclipse.jface.window.Window;
@@ -168,75 +168,75 @@ public class LoadBrowserCustomization extends AbstractHandler {
return ModelUtils.getModelSet();
}
- /**
- * load the facets
- *
- * @param customizations
- * list of customization
- * @param customizationManager
- * the Customization Manager
- */
- protected void loadFacetsForCustomizations(final List<MetamodelView> customizations, final CustomizationManager customizationManager) {
- final Set<Facet> referencedFacets = new HashSet<Facet>();
- final Collection<FacetSet> facetSets = FacetSetCatalog.getSingleton().getAllFacetSets();
-
- for(MetamodelView customization : customizations) {
- String metamodelURI = customization.getMetamodelURI();
- // find customized FacetSet
- FacetSet customizedFacetSet = null;
- if(metamodelURI != null) {
- for(FacetSet facetSet : facetSets) {
- if(metamodelURI.equals(facetSet.getNsURI())) {
- customizedFacetSet = facetSet;
- break;
- }
- }
- }
- if(customizedFacetSet == null) {
- continue;
- }
-
- // find customized Facets
- EList<TypeView> types = customization.getTypes();
- for(TypeView typeView : types) {
- String metaclassName = typeView.getMetaclassName();
- Facet facet = findFacetWithFullyQualifiedName(metaclassName, customizedFacetSet);
- if(facet != null) {
- referencedFacets.add(facet);
- } else {
- Activator.log.warn(NLS.bind(Messages.BrowserActionBarContributor_missingRequiredFacet, new Object[]{ metaclassName, customizedFacetSet.getName(), customization.getName() }));
- }
- }
-
- for(Facet referencedFacet : referencedFacets) {
- customizationManager.loadFacet(referencedFacet);
- }
- }
+// /**
+// * load the facets
+// *
+// * @param customizations
+// * list of customization
+// * @param customizationManager
+// * the Customization Manager
+// */
+// protected void loadFacetsForCustomizations(final List<MetamodelView> customizations, final CustomizationManager customizationManager) {
+// final Set<Facet> referencedFacets = new HashSet<Facet>();
+// final Collection<FacetSet> facetSets = FacetSetCatalog.getSingleton().getAllFacetSets();
+//
+// for(MetamodelView customization : customizations) {
+// String metamodelURI = customization.getMetamodelURI();
+// // find customized FacetSet
+// FacetSet customizedFacetSet = null;
+// if(metamodelURI != null) {
+// for(FacetSet facetSet : facetSets) {
+// if(metamodelURI.equals(facetSet.getNsURI())) {
+// customizedFacetSet = facetSet;
+// break;
+// }
+// }
+// }
+// if(customizedFacetSet == null) {
+// continue;
+// }
+//
+// // find customized Facets
+// EList<TypeView> types = customization.getTypes();
+// for(TypeView typeView : types) {
+// String metaclassName = typeView.getMetaclassName();
+// Facet facet = findFacetWithFullyQualifiedName(metaclassName, customizedFacetSet);
+// if(facet != null) {
+// referencedFacets.add(facet);
+// } else {
+// Activator.log.warn(NLS.bind(Messages.BrowserActionBarContributor_missingRequiredFacet, new Object[]{ metaclassName, customizedFacetSet.getName(), customization.getName() }));
+// }
+// }
+//
+// for(Facet referencedFacet : referencedFacets) {
+// customizationManager.loadFacet(referencedFacet);
+// }
+// }
//
// for modified facets
// customizationManager.getInstancesForMetaclasses().buildDerivationTree();
// customizationManager.getAppearanceConfiguration().touch();
// customizationManager.refreshDelayed(true);
- }
+ //}
- /**
- * fin a facet from
- *
- * @param metaclassName
- * @param customizedFacetSet
- * @return
- */
- private Facet findFacetWithFullyQualifiedName(final String metaclassName, final FacetSet customizedFacetSet) {
- EList<Facet> facets = customizedFacetSet.getFacets();
- for(Facet facet : facets) {
- String facetName = getMetaclassQualifiedName(facet);
- if(metaclassName.equals(facetName)) {
- return facet;
- }
- }
- return null;
- }
+// /**
+// * fin a facet from
+// *
+// * @param metaclassName
+// * @param customizedFacetSet
+// * @return
+// */
+// private Facet findFacetWithFullyQualifiedName(final String metaclassName, final FacetSet customizedFacetSet) {
+// EList<Facet> facets = customizedFacetSet.getFacets();
+// for(Facet facet : facets) {
+// String facetName = getMetaclassQualifiedName(facet);
+// if(metaclassName.equals(facetName)) {
+// return facet;
+// }
+// }
+// return null;
+// }
/** @return the qualified name of the given metaclass */
public static String getMetaclassQualifiedName(final EClassifier eClass) {
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/LinkItemMatchingItem.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/LinkItemMatchingItem.java
index a6e8223de46..9c82dfc4ee0 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/LinkItemMatchingItem.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/LinkItemMatchingItem.java
@@ -16,7 +16,7 @@ package org.eclipse.papyrus.views.modelexplorer.matching;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.LinkItem;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EReferenceTreeElement;
/***
* An IMatchingItem implementation that matches for LinkItems
@@ -35,9 +35,9 @@ public class LinkItemMatchingItem implements IMatchingItem {
}
public boolean matchingItemEquals(Object obj) {
- if(obj instanceof LinkItem) {
+ if(obj instanceof EReferenceTreeElement) {
if(ref != null && parent != null) {
- return parent.equals(((LinkItem)obj).getParent()) && ref.equals(((LinkItem)obj).getReference());
+ return parent.equals(((EReferenceTreeElement)obj).getParent()) && ref.equals(((EReferenceTreeElement)obj).getEReference());
}
}
return super.equals(obj);
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/ModelElementItemMatchingItem.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/ModelElementItemMatchingItem.java
index d4b00750cf5..404469afdb0 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/ModelElementItemMatchingItem.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/matching/ModelElementItemMatchingItem.java
@@ -15,7 +15,7 @@
package org.eclipse.papyrus.views.modelexplorer.matching;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.ModelElementItem;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EObjectTreeElement;
/***
* An IMatchingItem implementation that matches for ModelElementItem
@@ -31,8 +31,8 @@ public class ModelElementItemMatchingItem implements IMatchingItem {
}
public boolean matchingItemEquals(Object obj) {
- if(element != null && obj instanceof ModelElementItem) {
- return element.equals(((ModelElementItem)obj).getEObject());
+ if(element != null && obj instanceof EObjectTreeElement) {
+ return element.equals(((EObjectTreeElement)obj).getEObject());
}
return super.equals(obj);
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsOpen.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsOpen.java
index bcc7da7f1dc..cbc2c96f1e0 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsOpen.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsOpen.java
@@ -12,23 +12,26 @@
package org.eclipse.papyrus.views.modelexplorer.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.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+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;
/** Tests whether a Page is opened */
-public class IsOpen implements IJavaModelQuery<EObject, Boolean> {
+public class IsOpen implements IJavaQuery2<EObject, Boolean> {
- public Boolean evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+
+ public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
try {
- IPageManager pageManager = ServiceUtilsForEObject.getInstance().getIPageManager(context);
- return pageManager.isOpen(context);
+ IPageManager pageManager = ServiceUtilsForEObject.getInstance().getIPageManager(source);
+ return pageManager.isOpen(source);
} catch (ServiceException ex) {
//Ignore
}
return false;
+
}
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsPage.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsPage.java
index a946d4935dc..47ef97c2b35 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsPage.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsPage.java
@@ -12,20 +12,22 @@
package org.eclipse.papyrus.views.modelexplorer.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.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.infra.core.sasheditor.contentprovider.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
/** Tests whether an element is a page */
-public class IsPage implements IJavaModelQuery<EObject, Boolean> {
+public class IsPage implements IJavaQuery2<EObject, Boolean> {
- public Boolean evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+
+ public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
try {
- IPageManager pageManager = ServiceUtilsForEObject.getInstance().getIPageManager(context);
- return pageManager.allPages().contains(context);
+ IPageManager pageManager = ServiceUtilsForEObject.getInstance().getIPageManager(source);
+ return pageManager.allPages().contains(source);
} catch (ServiceException ex) {
//Ignore
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsReadOnly.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsReadOnly.java
index 79dc3c1c7d4..b7f391ec345 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsReadOnly.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsReadOnly.java
@@ -16,21 +16,23 @@ package org.eclipse.papyrus.views.modelexplorer.queries;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
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.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;
/**
* Create a query which will return true if the ressource is in read only mode.
*
*/
@Deprecated
-public class IsReadOnly implements IJavaModelQuery<EObject, Boolean> {
+public class IsReadOnly implements IJavaQuery2<EObject, Boolean> {
- public Boolean evaluate(EObject context, ParameterValueList parameterValues) throws ModelQueryExecutionException {
- EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(context);
+
+ public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(source);
if(editingDomain != null) {
- if(editingDomain.isReadOnly(context.eResource())) {
+ if(editingDomain.isReadOnly(source.eResource())) {
return true;
}
}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/META-INF/MANIFEST.MF b/plugins/views/properties/org.eclipse.papyrus.views.properties/META-INF/MANIFEST.MF
index ac92fbebb5a..6977af84421 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/META-INF/MANIFEST.MF
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/META-INF/MANIFEST.MF
@@ -38,7 +38,6 @@ Require-Bundle: org.eclipse.emf;bundle-version="2.6.0",
org.eclipse.papyrus.infra.tools;bundle-version="1.0.0",
org.eclipse.papyrus.infra.constraints;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.0",
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.emf.edit;bundle-version="2.8.0",
org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.300",

Back to the top