Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java4
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/.classpath2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/META-INF/MANIFEST.MF10
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/Activator.java27
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/PapyrusEditor2.java42
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.facet.queries/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.facet.queries/plugin.xml2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/.classpath2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/Model/NewChild.ecore8
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/MenuAction.java6
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/impl/MenuActionImpl.java18
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/impl/NewchildPackageImpl.java2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src/org/eclipse/papyrus/infra/emf/newchild/menu/FillMenuAction.java4
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src/org/eclipse/papyrus/infra/emf/newchild/runtime/NewchildManager.java2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF12
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java242
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/messages/Messages.java4
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/EMFLabelProvider.java16
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/MoDiscoContentProvider.java6
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/strategy/ContainmentBrowseStrategy.java7
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/strategy/SemanticEMFContentProvider.java11
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFFileUtil.java12
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java2
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/META-INF/MANIFEST.MF5
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/META-INF/MANIFEST.MF5
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF7
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/IPapyrusEditPart.java12
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/ScalableCompartmentFigure.java12
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/NotationHelper.java3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/messages/Messages.java2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/RestrictedAbstractEditPartProvider.java12
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/shape/ProviderNotificationManager.java12
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/copy/ConnectionEndpointTracker.java12
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.xml3
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/queries/GetStyleSheets.java18
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/queries/IsStyleSheetContainer.java10
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/.project2
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF14
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml18
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom49
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotation.uiCustom58
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.facetSet12
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.querySet17
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.uiCustom17
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/handlers/AbstractDiagramCommandHandler.java12
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/messages/Messages.java12
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/DiagramsRefCollapseQuery.java36
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/EmptyReferenceAndAttributeNotVisibleQuery.java55
-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.java17
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java43
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java28
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/META-INF/MANIFEST.MF1
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/Messages.java12
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/utils/Messages.java12
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF1
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml11
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java21
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java14
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF5
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/ImportAxisInNattableManager.java12
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/painter/PapyrusSortableHeaderTextPainter.java12
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java12
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/.project2
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/META-INF/MANIFEST.MF3
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml4
-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.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQueryConstraint.java12
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java12
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/Activator.java12
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/Activator.java12
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/META-INF/MANIFEST.MF5
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/EditorLookForEditorShell.java49
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.newchild/META-INF/MANIFEST.MF1
-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/infra/services/org.eclipse.papyrus.infra.services.validation/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/IPapyrusDiagnostician.java12
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/ValidationTool.java6
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/handler/AbstractCommandHandler.java7
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/preferences/Initializer.java12
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/preferences/PreferencePage.java12
92 files changed, 1254 insertions, 955 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
index cb18390bbad..9c96ac90e00 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/EMFLogicalModel.java
@@ -22,9 +22,9 @@ import org.eclipse.papyrus.infra.core.Activator;
/**
* An IModel which is an abstraction for a set of consistent EMF Resources
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public abstract class EMFLogicalModel extends AbstractBaseModel implements IEMFModel {
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/.classpath b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/.classpath
index 2d1a4302f04..e4f6d5b98a9 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/.classpath
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/.classpath
@@ -2,6 +2,6 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
+ <classpathentry excluding="org/eclipse/papyrus/infra/emf/editor/providers/CustomizableContentProvider.java|org/eclipse/papyrus/infra/emf/editor/part/PapyrusEditor.java" kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/META-INF/MANIFEST.MF b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/META-INF/MANIFEST.MF
index fa9531aaa33..91de32497ed 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/META-INF/MANIFEST.MF
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/META-INF/MANIFEST.MF
@@ -6,16 +6,12 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.resources;bundle-version="3.7.100",
org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.200",
org.eclipse.papyrus.infra.emf.newchild;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.browser.custom;bundle-version="0.1.0",
- org.eclipse.emf.facet.infra.browser;bundle-version="0.1.0",
- org.eclipse.emf.facet.infra.browser.custom.core;bundle-version="0.1.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.0",
org.eclipse.papyrus.views.properties;bundle-version="1.0.0",
org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
org.eclipse.emf.transaction;bundle-version="1.4.0",
- org.eclipse.emf.facet.efacet.core;bundle-version="0.2.0",
- org.eclipse.emf.facet.custom.core;bundle-version="0.2.0",
- org.eclipse.emf.facet.custom.ui;bundle-version="0.2.0",
+ org.eclipse.papyrus.emf.facet.efacet.core;bundle-version="0.2.0",
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="0.2.0",
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="0.2.0",
org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/Activator.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/Activator.java
index 12280dfe151..f748633905e 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/Activator.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/Activator.java
@@ -1,6 +1,5 @@
package org.eclipse.papyrus.infra.emf.editor;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -16,7 +15,7 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
- private CustomizationManager fCustomizationManager;
+// private CustomizationManager fCustomizationManager;
public static LogHelper log;
@@ -58,18 +57,18 @@ public class Activator extends AbstractUIPlugin {
return plugin;
}
- /**
- *
- * @return the customization manager in charge to adapt element in modisco
- */
- public CustomizationManager getCustomizationManager() {
- return org.eclipse.papyrus.infra.emf.Activator.getDefault().getCustomizationManager();
- // if(this.fCustomizationManager == null) {
- // this.fCustomizationManager = new CustomizationManager();
- // init(this.fCustomizationManager);
- // }
- // return this.fCustomizationManager;
- }
+// /**
+// *
+// * @return the customization manager in charge to adapt element in modisco
+// */
+// public CustomizationManager getCustomizationManager() {
+// return org.eclipse.papyrus.infra.emf.Activator.getDefault().getCustomizationManager();
+// // if(this.fCustomizationManager == null) {
+// // this.fCustomizationManager = new CustomizationManager();
+// // init(this.fCustomizationManager);
+// // }
+// // return this.fCustomizationManager;
+// }
// private void init(final CustomizationManager customizationManager) {
// customizationManager.setShowContainer(false);
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/PapyrusEditor2.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/PapyrusEditor2.java
index a68b236df09..1ead2651e20 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/PapyrusEditor2.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.editor/src/org/eclipse/papyrus/infra/emf/editor/part/PapyrusEditor2.java
@@ -21,13 +21,6 @@ import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory
import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
-import org.eclipse.emf.facet.custom.core.ICustomizationCatalogManager;
-import org.eclipse.emf.facet.custom.core.ICustomizationCatalogManagerFactory;
-import org.eclipse.emf.facet.custom.core.ICustomizationManager;
-import org.eclipse.emf.facet.custom.core.ICustomizationManagerFactory;
-import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
-import org.eclipse.emf.facet.custom.ui.ICustomizedContentProviderFactory;
-import org.eclipse.emf.facet.custom.ui.IResolvingCustomizedLabelProviderFactory;
import org.eclipse.emf.transaction.TransactionalCommandStack;
import org.eclipse.emf.transaction.impl.TransactionalCommandStackImpl;
import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl;
@@ -38,7 +31,13 @@ import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationCatalogManager;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.papyrus.emf.facet.custom.ui.ICustomizedContentProviderFactory;
+import org.eclipse.papyrus.infra.emf.Activator;
import org.eclipse.papyrus.infra.emf.editor.actions.MoDiscoDropAdapter;
+import org.eclipse.papyrus.infra.emf.providers.EMFLabelProvider;
import org.eclipse.papyrus.infra.widgets.editors.AbstractEditor;
import org.eclipse.papyrus.infra.widgets.editors.ICommitListener;
import org.eclipse.papyrus.infra.widgets.editors.StringEditor;
@@ -268,21 +267,23 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
}
protected ICustomizationManager getCustomizationManager() {
- if(customizationManager == null) {
- customizationManager = ICustomizationManagerFactory.DEFAULT.getOrCreateICustomizationManager(getResourceSet());
- }
- return customizationManager;
+ return org.eclipse.papyrus.infra.emf.Activator.getDefault().getCustomizationManager();
+// if(customizationManager == null) {
+// customizationManager = ICustomizationManagerFactory.DEFAULT.getOrCreateICustomizationManager(getResourceSet());
+// }
+// return customizationManager;
}
protected void initializeCustomizationCatalogManager() {
- ICustomizationCatalogManager customCatalog = ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(getResourceSet());
- List<Customization> allCustomizations = customCatalog.getRegisteredCustomizations();
- for(Customization customization : allCustomizations) {
- if(customization.isMustBeLoadedByDefault()) {
- System.out.println("Apply default customization: " + customization.getName());
- getCustomizationManager().getManagedCustomizations().add(customization);
- }
- }
+// ICustomizationCatalogManager customCatalog = ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(getResourceSet());
+// ICustomizationCatalogManager customCatalog = Activator.getDefault().getCustomizationManager()
+// List<Customization> allCustomizations = customCatalog.getRegisteredCustomizations();
+// for(Customization customization : allCustomizations) {
+// if(customization.isMustBeLoadedByDefault()) {
+// System.out.println("Apply default customization: " + customization.getName());
+// getCustomizationManager().getManagedCustomizations().add(customization);
+// }
+// }
}
protected IStructuredContentProvider createContentProvider() {
@@ -294,7 +295,8 @@ public class PapyrusEditor2 extends EcoreEditor implements ITabbedPropertySheetP
}
protected ILabelProvider createLabelProvider() {
- return IResolvingCustomizedLabelProviderFactory.DEFAULT.createCustomizedLabelProvider(getCustomizationManager());
+// return IResolvingCustomizedLabelProviderFactory.DEFAULT.createCustomizedLabelProvider(getCustomizationManager());
+ return new EMFLabelProvider();
}
public void commandStackChanged(EventObject event) {
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.facet.queries/META-INF/MANIFEST.MF b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.facet.queries/META-INF/MANIFEST.MF
index 4896b65aded..427198735f2 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.facet.queries/META-INF/MANIFEST.MF
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.facet.queries/META-INF/MANIFEST.MF
@@ -1,7 +1,5 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.emf.facet.infra.query;bundle-version="0.2.0",
- org.eclipse.emf.facet.infra.query.core;bundle-version="0.2.0",
org.eclipse.emf.edit
Export-Package: org.eclipse.papyrus.infra.emf.facet.queries,
org.eclipse.papyrus.infra.emf.facet.queries.factory,
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.facet.queries/plugin.xml b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.facet.queries/plugin.xml
index 17777e8084b..d130206d366 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.facet.queries/plugin.xml
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.facet.queries/plugin.xml
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
+ <!-- TODO: EMF-FACET update query
<extension
point="org.eclipse.emf.facet.infra.query.factory">
<factory
class="org.eclipse.papyrus.infra.emf.facet.queries.factory.ParametricQueryFactory">
</factory>
</extension>
+ -->
<extension
point="org.eclipse.emf.ecore.generated_package">
<package
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/.classpath b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/.classpath
index 9c0318f0fd2..2ca72baf8d0 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/.classpath
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/.classpath
@@ -3,6 +3,6 @@
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
+ <classpathentry excluding="org/eclipse/papyrus/infra/emf/newchild/action/ExtendedTypeAction.java" kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/META-INF/MANIFEST.MF b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/META-INF/MANIFEST.MF
index ed7580abbed..cc5f072c16c 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/META-INF/MANIFEST.MF
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/META-INF/MANIFEST.MF
@@ -12,12 +12,10 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore,
- org.eclipse.emf.facet.infra.query,
org.eclipse.uml2.uml,
org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.emf.edit.ui;bundle-version="2.7.0",
org.eclipse.papyrus.infra.constraints;bundle-version="1.0.0",
- org.eclipse.papyrus.infra.queries.core.configuration;bundle-version="1.0.0",
org.eclipse.papyrus.infra.extendedtypes;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/Model/NewChild.ecore b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/Model/NewChild.ecore
index 493eff5c51c..1c9adaa45e3 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/Model/NewChild.ecore
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/Model/NewChild.ecore
@@ -1,8 +1,6 @@
<?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="newchild"
- nsURI="http://www.eclipse.org/papyrus/newchild" nsPrefix="newchild">
+<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="newchild" nsURI="http://www.eclipse.org/papyrus/newchild" nsPrefix="newchild">
<eClassifiers xsi:type="ecore:EClass" name="NewchildConfiguration">
<eStructuralFeatures xsi:type="ecore:EReference" name="roots" upperBound="-1"
eType="#//MenuRoot" containment="true"/>
@@ -28,7 +26,7 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MenuAction" eSuperTypes="#//MenuItem">
<eStructuralFeatures xsi:type="ecore:EReference" name="elementType" lowerBound="1"
- eType="ecore:EClass platform:/plugin/org.eclipse.papyrus.infra.extendedtypes/model/ExtendedTypes.ecore#//ExtendedElementTypeConfiguration"/>
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Separator" eSuperTypes="#//MenuItem"/>
<eClassifiers xsi:type="ecore:EClass" name="MenuGroup" eSuperTypes="#//MenuContainer">
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/MenuAction.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/MenuAction.java
index 60bc05ea88d..6766c4354a1 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/MenuAction.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/MenuAction.java
@@ -6,7 +6,7 @@
*/
package org.eclipse.papyrus.infra.emf.newchild;
-import org.eclipse.papyrus.infra.extendedtypes.ExtendedElementTypeConfiguration;
+import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
@@ -39,7 +39,7 @@ public interface MenuAction extends MenuItem {
* @model required="true"
* @generated
*/
- ExtendedElementTypeConfiguration getElementType();
+ EObject getElementType();
/**
* Sets the value of the '{@link org.eclipse.papyrus.infra.emf.newchild.MenuAction#getElementType <em>Element Type</em>}' reference.
@@ -49,6 +49,6 @@ public interface MenuAction extends MenuItem {
* @see #getElementType()
* @generated
*/
- void setElementType(ExtendedElementTypeConfiguration value);
+ void setElementType(EObject value);
} // MenuAction
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/impl/MenuActionImpl.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/impl/MenuActionImpl.java
index a203aee2996..91786674b8a 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/impl/MenuActionImpl.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/impl/MenuActionImpl.java
@@ -8,11 +8,11 @@ package org.eclipse.papyrus.infra.emf.newchild.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.papyrus.infra.emf.newchild.MenuAction;
import org.eclipse.papyrus.infra.emf.newchild.NewchildPackage;
-import org.eclipse.papyrus.infra.extendedtypes.ExtendedElementTypeConfiguration;
/**
@@ -37,7 +37,7 @@ public class MenuActionImpl extends MenuItemImpl implements MenuAction {
* @generated
* @ordered
*/
- protected ExtendedElementTypeConfiguration elementType;
+ protected EObject elementType;
/**
* <!-- begin-user-doc -->
@@ -63,10 +63,10 @@ public class MenuActionImpl extends MenuItemImpl implements MenuAction {
* <!-- end-user-doc -->
* @generated
*/
- public ExtendedElementTypeConfiguration getElementType() {
+ public EObject getElementType() {
if (elementType != null && elementType.eIsProxy()) {
InternalEObject oldElementType = (InternalEObject)elementType;
- elementType = (ExtendedElementTypeConfiguration)eResolveProxy(oldElementType);
+ elementType = (EObject)eResolveProxy(oldElementType);
if (elementType != oldElementType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, NewchildPackage.MENU_ACTION__ELEMENT_TYPE, oldElementType, elementType));
@@ -80,7 +80,7 @@ public class MenuActionImpl extends MenuItemImpl implements MenuAction {
* <!-- end-user-doc -->
* @generated
*/
- public ExtendedElementTypeConfiguration basicGetElementType() {
+ public EObject basicGetElementType() {
return elementType;
}
@@ -89,8 +89,8 @@ public class MenuActionImpl extends MenuItemImpl implements MenuAction {
* <!-- end-user-doc -->
* @generated
*/
- public void setElementType(ExtendedElementTypeConfiguration newElementType) {
- ExtendedElementTypeConfiguration oldElementType = elementType;
+ public void setElementType(EObject newElementType) {
+ EObject oldElementType = elementType;
elementType = newElementType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NewchildPackage.MENU_ACTION__ELEMENT_TYPE, oldElementType, elementType));
@@ -120,7 +120,7 @@ public class MenuActionImpl extends MenuItemImpl implements MenuAction {
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case NewchildPackage.MENU_ACTION__ELEMENT_TYPE:
- setElementType((ExtendedElementTypeConfiguration)newValue);
+ setElementType((EObject)newValue);
return;
}
super.eSet(featureID, newValue);
@@ -135,7 +135,7 @@ public class MenuActionImpl extends MenuItemImpl implements MenuAction {
public void eUnset(int featureID) {
switch (featureID) {
case NewchildPackage.MENU_ACTION__ELEMENT_TYPE:
- setElementType((ExtendedElementTypeConfiguration)null);
+ setElementType((EObject)null);
return;
}
super.eUnset(featureID);
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/impl/NewchildPackageImpl.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/impl/NewchildPackageImpl.java
index 0591570a678..9ccb48e3608 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/impl/NewchildPackageImpl.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src-gen/org/eclipse/papyrus/infra/emf/newchild/impl/NewchildPackageImpl.java
@@ -529,7 +529,7 @@ public class NewchildPackageImpl extends EPackageImpl implements NewchildPackage
initEAttribute(getMenu_Icon(), theEcorePackage.getEString(), "icon", null, 0, 1, Menu.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(menuActionEClass, MenuAction.class, "MenuAction", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getMenuAction_ElementType(), theExtendedtypesPackage.getExtendedElementTypeConfiguration(), null, "elementType", null, 1, 1, MenuAction.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getMenuAction_ElementType(), theEcorePackage.getEObject(), null, "elementType", null, 1, 1, MenuAction.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(separatorEClass, Separator.class, "Separator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src/org/eclipse/papyrus/infra/emf/newchild/menu/FillMenuAction.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src/org/eclipse/papyrus/infra/emf/newchild/menu/FillMenuAction.java
index 6356c504748..cc0e0b5b4d2 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src/org/eclipse/papyrus/infra/emf/newchild/menu/FillMenuAction.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src/org/eclipse/papyrus/infra/emf/newchild/menu/FillMenuAction.java
@@ -16,8 +16,6 @@ import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.papyrus.infra.emf.newchild.MenuAction;
-import org.eclipse.papyrus.infra.emf.newchild.action.ExtendedTypeAction;
-import org.eclipse.papyrus.infra.emf.newchild.util.MenuHelper;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
@@ -43,7 +41,7 @@ public class FillMenuAction implements FillElement {
}
public void fill(IMenuManager menuManager) {
- MenuHelper.add(parentGroup, menuManager, new ExtendedTypeAction(selectedEObject, menuAction.getElementType(), domain));
+// MenuHelper.add(parentGroup, menuManager, new ExtendedTypeAction(selectedEObject, menuAction.getElementType(), domain));
}
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src/org/eclipse/papyrus/infra/emf/newchild/runtime/NewchildManager.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src/org/eclipse/papyrus/infra/emf/newchild/runtime/NewchildManager.java
index 2b9e2d949cd..d2ad63f0d1b 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src/org/eclipse/papyrus/infra/emf/newchild/runtime/NewchildManager.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.newchild/src/org/eclipse/papyrus/infra/emf/newchild/runtime/NewchildManager.java
@@ -77,7 +77,7 @@ public class NewchildManager {
constraintEngine = new MenuConstraintEngine();
try {
//TODO : Load that from extension point
- NewchildConfiguration configuration = (NewchildConfiguration)EMFHelper.loadEMFModel(null, URI.createPlatformPluginURI("org.eclipse.papyrus.infra.emf.newchild/Model/NewchildConfiguration.xmi", true));
+ NewchildConfiguration configuration = (NewchildConfiguration)EMFHelper.loadEMFModel(null, URI.createPlatformPluginURI("/org.eclipse.papyrus.emf.facet.editor/newChild/NewchildConfiguration.xmi", true));
constraintEngine.addConfiguration(configuration);
} catch (IOException ex) {
Activator.log.error(ex);
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
index b4c9fd570ce..d2c37127ece 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
@@ -9,17 +9,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.databinding;bundle-version="1.4.1",
org.eclipse.core.databinding.property;bundle-version="1.4.0",
org.eclipse.emf.databinding;bundle-version="1.2.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.0",
- org.eclipse.emf.facet.infra.facet;bundle-version="0.2.0",
- org.eclipse.emf.facet.infra.browser.custom;bundle-version="0.2.0",
- org.eclipse.emf.facet.infra.facet.core;bundle-version="0.2.0",
- org.eclipse.emf.facet.infra.browser.custom.core;bundle-version="0.2.0",
org.eclipse.papyrus.infra.tools;bundle-version="1.0.0",
org.eclipse.emf.transaction;bundle-version="1.4.0",
org.eclipse.emf.ecore.xmi,
- org.eclipse.emf.facet.custom.metamodel;bundle-version="0.2.0",
- org.eclipse.emf.facet.custom.ui;bundle-version="0.2.0",
- org.eclipse.emf.facet.util.emf.core,
com.ibm.icu;bundle-version="4.4.2",
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
@@ -28,7 +20,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.gmf.runtime.common.core;bundle-version="1.7.0",
org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0",
org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.7.0",
- com.google.guava;bundle-version="11.0.0"
+ com.google.guava;bundle-version="11.0.0",
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="0.2.0",
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="0.4.0"
Export-Package: org.eclipse.papyrus.infra.emf,
org.eclipse.papyrus.infra.emf.adapters,
org.eclipse.papyrus.infra.emf.commands,
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java
index bb975328e95..726b40881f0 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java
@@ -25,15 +25,15 @@ 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.facet.infra.browser.custom.MetamodelView;
-import org.eclipse.emf.facet.infra.browser.custom.TypeView;
-import org.eclipse.emf.facet.infra.browser.custom.core.CustomizationsCatalog;
-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.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationCatalogManager;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationCatalogManagerFactory;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManagerFactory;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -56,7 +56,9 @@ public class Activator extends AbstractUIPlugin {
*/
public static LogHelper log;
- private CustomizationManager fCustomizationManager;
+ private ICustomizationManager fCustomizationManager;
+ //temp resourceSet
+ private ResourceSet facetRecsourceSet= new ResourceSetImpl();
/**
* The constructor
@@ -100,9 +102,9 @@ public class Activator extends AbstractUIPlugin {
*
* @return the customization manager in charge to adapt element in modisco
*/
- public CustomizationManager getCustomizationManager() {
+ public ICustomizationManager getCustomizationManager() {
if(this.fCustomizationManager == null) {
- this.fCustomizationManager = new CustomizationManager();
+ this.fCustomizationManager = ICustomizationManagerFactory.DEFAULT.getOrCreateICustomizationManager(facetRecsourceSet);
init(this.fCustomizationManager);
}
return this.fCustomizationManager;
@@ -112,21 +114,23 @@ public class Activator extends AbstractUIPlugin {
* Saves the current Customization Manager settings to the preferences
*/
public void saveCustomizationManagerState() {
- IDialogSettings dialogSettings = getBrowserCustomizationDialogSettings();
-
- List<MetamodelView> appliedCustomizations = getCustomizationManager().getRegisteredCustomizations();
-
- for(MetamodelView customization : CustomizationsCatalog.getInstance().getRegistryCustomizations()) {
-
- boolean isApplied = appliedCustomizations.contains(customization);
- String settingKey = getSettingKey(customization);
-
- dialogSettings.put(settingKey, isApplied);
- }
+// IDialogSettings dialogSettings = getBrowserCustomizationDialogSettings();
+//
+// List<MetamodelView> appliedCustomizations = getCustomizationManager().getRegisteredCustomizations();
+//
+// for(MetamodelView customization : CustomizationsCatalog.getInstance().getRegistryCustomizations()) {
+//
+// boolean isApplied = appliedCustomizations.contains(customization);
+// String settingKey = getSettingKey(customization);
+//
+// dialogSettings.put(settingKey, isApplied);
+// }
}
- private String getSettingKey(MetamodelView customization) {
- return customization.getLocation();
+ private String getSettingKey(Customization customization) {
+ // do not exist anymore
+ //return customization.getLocation();
+ return "";
}
protected IDialogSettings getBrowserCustomizationDialogSettings() {
@@ -139,12 +143,12 @@ public class Activator extends AbstractUIPlugin {
return settings;
}
- private void init(final CustomizationManager customizationManager) {
+ private void init(final ICustomizationManager customizationManager) {
// the appearance can be customized here:
- customizationManager.setShowDerivedLinks(true);
+ //customizationManager.setShowDerivedLinks(true);
//to hide the blue arrow overlay
- customizationManager.setDecorateExternalResources(false);
+ //customizationManager.setDecorateExternalResources(false);
IDialogSettings settings = getBrowserCustomizationDialogSettings();
@@ -152,29 +156,31 @@ public class Activator extends AbstractUIPlugin {
// load customizations defined as default through the customization
// extension
- List<MetamodelView> registryDefaultCustomizations = CustomizationsCatalog.getInstance().getRegistryDefaultCustomizations();
- List<MetamodelView> registryAllCustomizations = CustomizationsCatalog.getInstance().getRegistryCustomizations();
-
- List<MetamodelView> appliedCustomizations = new LinkedList<MetamodelView>();
-
- for(MetamodelView customization : registryAllCustomizations) {
- String settingKey = getSettingKey(customization);
-
- boolean isActive = false;
- if(settings.get(settingKey) == null) { //Never customized
- isActive = registryDefaultCustomizations.contains(customization); //Loaded by default
- } else {
- isActive = settings.getBoolean(settingKey);
- }
-
- if(isActive) {
- customizationManager.registerCustomization(customization);
- appliedCustomizations.add(customization);
- }
- }
-
- customizationManager.loadCustomizations();
- loadFacetsForCustomizations(appliedCustomizations, customizationManager);
+ ICustomizationCatalogManager customCatalog = ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(customizationManager.getResourceSet());
+ //no possibility to get default customization
+ //List<MetamodelView> registryDefaultCustomizations = customCatalog.;
+ List<Customization> registryAllCustomizations = customCatalog.getRegisteredCustomizations();
+
+ List<Customization> appliedCustomizations = new LinkedList<Customization>();
+//
+// for(Customization customization : registryAllCustomizations) {
+// String settingKey = getSettingKey(customization);
+//
+// boolean isActive = false;
+// if(settings.get(settingKey) == null) { //Never customized
+// isActive = registryDefaultCustomizations.contains(customization); //Loaded by default
+// } else {
+// isActive = settings.getBoolean(settingKey);
+// }
+//
+// if(isActive) {
+// customizationManager.registerCustomization(customization);
+// appliedCustomizations.add(customization);
+// }
+// }
+
+// customizationManager.loadCustomizations();
+// loadFacetsForCustomizations(appliedCustomizations, customizationManager);
} catch (Throwable e) {
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Error initializing customizations", e)); //$NON-NLS-1$
@@ -190,18 +196,18 @@ public class Activator extends AbstractUIPlugin {
* Restores the default Customization Manager configuration
*/
public void restoreDefaultCustomizationManager() {
- CustomizationManager manager = getCustomizationManager();
+ ICustomizationManager manager = getCustomizationManager();
DialogSettings settings = (DialogSettings)getDialogSettings();
settings.removeSection(CUSTOMIZATION_MANAGER_SECTION);
- List<MetamodelView> registryDefaultCustomizations = CustomizationsCatalog.getInstance().getRegistryDefaultCustomizations();
-
- manager.clearCustomizations();
- for(MetamodelView customization : registryDefaultCustomizations) {
- manager.registerCustomization(customization);
- }
- manager.loadCustomizations();
+// List<MetamodelView> registryDefaultCustomizations = CustomizationsCatalog.getInstance().getRegistryDefaultCustomizations();
+//
+// manager.clearCustomizations();
+// for(MetamodelView customization : registryDefaultCustomizations) {
+// manager.registerCustomization(customization);
+// }
+// manager.loadCustomizations();
}
/**
@@ -212,67 +218,67 @@ public class Activator extends AbstractUIPlugin {
* @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(String.format("Missing required facet \"%s\" in FacetSet \"%s\" for customization \"%s\"", 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;
- }
+// 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(String.format("Missing required facet \"%s\" in FacetSet \"%s\" for customization \"%s\"", 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;
+// }
/** @return the qualified name of the given metaclass */
public static String getMetaclassQualifiedName(final EClassifier eClass) {
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/messages/Messages.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/messages/Messages.java
index 77ff3cbd56b..6e02b835316 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/messages/Messages.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/messages/Messages.java
@@ -1,4 +1,5 @@
-/*
+
+/*************************************************************
* Copyright (c) 2012, 2014 CEA and others.
*
* All rights reserved. This program and the accompanying materials
@@ -11,6 +12,7 @@
* Christian W. Damus (CEA) - bug 323802
*
*/
+
package org.eclipse.papyrus.infra.emf.messages;
import org.eclipse.osgi.util.NLS;
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/EMFLabelProvider.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/EMFLabelProvider.java
index 37d1de1321d..c6e0ac7cb6f 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/EMFLabelProvider.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/EMFLabelProvider.java
@@ -18,10 +18,12 @@ import java.util.Set;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelLabelProvider;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.ITreeElement;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.TreeElement;
+import org.eclipse.papyrus.emf.facet.custom.ui.internal.CustomizedLabelProvider;
+import org.eclipse.papyrus.emf.facet.custom.ui.internal.DecoratingCustomizedLabelProvider;
+import org.eclipse.papyrus.emf.facet.custom.ui.internal.ResolvingCustomizedLabelProvider;
import org.eclipse.papyrus.infra.emf.Activator;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.services.labelprovider.service.IDetailLabelProvider;
@@ -36,7 +38,7 @@ import org.eclipse.swt.graphics.Image;
*
* @author Camille Letavernier
*/
-public class EMFLabelProvider extends CustomizableModelLabelProvider implements IDetailLabelProvider, IQualifierLabelProvider {
+public class EMFLabelProvider extends ResolvingCustomizedLabelProvider implements IDetailLabelProvider, IQualifierLabelProvider {
protected ILabelProvider baseEMFLabelProvider;
@@ -44,7 +46,7 @@ public class EMFLabelProvider extends CustomizableModelLabelProvider implements
* Creates a new EMFObjectLabelProvider.
*/
public EMFLabelProvider() {
- super(Activator.getDefault().getCustomizationManager()); //Note: CustomizableModelLabelProvider doesn't use the CustomizationManager. It relies on the content provider's CustomizationManager
+ super(new DecoratingCustomizedLabelProvider(Activator.getDefault().getCustomizationManager())); //Note: CustomizableModelLabelProvider doesn't use the CustomizationManager. It relies on the content provider's CustomizationManager
baseEMFLabelProvider = new StandardEMFLabelProvider();
}
@@ -57,7 +59,7 @@ public class EMFLabelProvider extends CustomizableModelLabelProvider implements
return ""; //$NON-NLS-1$
}
- if(element instanceof ITreeElement) {
+ if(element instanceof TreeElement) {
return super.getText(element);
}
@@ -105,7 +107,7 @@ public class EMFLabelProvider extends CustomizableModelLabelProvider implements
*/
@Override
public Image getImage(Object element) {
- if(element instanceof ITreeElement) {
+ if(element instanceof TreeElement) {
return super.getImage(element);
}
@@ -148,7 +150,7 @@ public class EMFLabelProvider extends CustomizableModelLabelProvider implements
if(selectedEObject.size() == 1 || hasCommonImage(selectedEObject)) {
return getImage(selectedEObject.toArray()[0]);
} else {
- final EClass common = org.eclipse.emf.facet.util.emf.core.internal.EMFUtils.computeLeastCommonSupertype(getEClasses(selectedEObject));
+ final EClass common = org.eclipse.papyrus.emf.facet.util.emf.core.internal.EMFUtils.computeLeastCommonSupertype(getEClasses(selectedEObject));
if(!common.isAbstract()) {
//FIXME : the label provider service should manage this case
final Object instance = common.getEPackage().getEFactoryInstance().create(common);
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/MoDiscoContentProvider.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/MoDiscoContentProvider.java
index de352fc6f25..508d197435a 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/MoDiscoContentProvider.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/MoDiscoContentProvider.java
@@ -15,7 +15,7 @@ import java.util.Iterator;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelContentProvider;
+import org.eclipse.papyrus.emf.facet.custom.ui.internal.CustomizedTreeContentProvider;
import org.eclipse.papyrus.infra.core.resource.AbstractBaseModel;
import org.eclipse.papyrus.infra.core.resource.IModel;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
@@ -30,7 +30,7 @@ import org.eclipse.papyrus.infra.emf.Activator;
* @deprecated Use SemanticUMLContentProvider instead
*/
@Deprecated
-public class MoDiscoContentProvider extends CustomizableModelContentProvider {
+public class MoDiscoContentProvider extends CustomizedTreeContentProvider {
/** The ModelSet containing all the models. This is the initial input. */
protected ModelSet modelSet;
@@ -69,7 +69,7 @@ public class MoDiscoContentProvider extends CustomizableModelContentProvider {
* @return
*/
@Override
- public EObject[] getRootElements(Object inputElement) {
+ protected EObject[] getRootElements(Object inputElement) {
try {
if(!(inputElement instanceof ServicesRegistry)) {
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/strategy/ContainmentBrowseStrategy.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/strategy/ContainmentBrowseStrategy.java
index 889ca013750..d64446720d5 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/strategy/ContainmentBrowseStrategy.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/strategy/ContainmentBrowseStrategy.java
@@ -19,7 +19,6 @@ import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.facet.infra.facet.FacetReference;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
@@ -66,9 +65,9 @@ public class ContainmentBrowseStrategy extends ProviderBasedBrowseStrategy {
//Only browse Containment references and Facet references
if(semanticElement instanceof EReference) {
- if(semanticElement instanceof FacetReference) {
- return true;
- }
+ //if(semanticElement instanceof FacetReference) {
+ // return true;
+ //}
return ((EReference)semanticElement).isContainment() && !((EReference)semanticElement).isDerived();
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/strategy/SemanticEMFContentProvider.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/strategy/SemanticEMFContentProvider.java
index 948eba885eb..c875500d8fd 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/strategy/SemanticEMFContentProvider.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/strategy/SemanticEMFContentProvider.java
@@ -23,8 +23,9 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelContentProvider;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager;
+import org.eclipse.papyrus.emf.facet.custom.core.internal.CustomizationManager;
+import org.eclipse.papyrus.emf.facet.custom.ui.internal.CustomizedTreeContentProvider;
import org.eclipse.papyrus.infra.emf.Activator;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.widgets.providers.IAdaptableContentProvider;
@@ -32,7 +33,7 @@ import org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
-public class SemanticEMFContentProvider extends CustomizableModelContentProvider implements IAdaptableContentProvider, IHierarchicContentProvider, IStaticContentProvider {
+public class SemanticEMFContentProvider extends CustomizedTreeContentProvider implements IAdaptableContentProvider, IHierarchicContentProvider, IStaticContentProvider {
protected EObject[] roots;
@@ -50,7 +51,7 @@ public class SemanticEMFContentProvider extends CustomizableModelContentProvider
super(Activator.getDefault().getCustomizationManager());
}
- public SemanticEMFContentProvider(EObject editedEObject, EStructuralFeature feature, EObject[] roots, CustomizationManager customizationManager) {
+ public SemanticEMFContentProvider(EObject editedEObject, EStructuralFeature feature, EObject[] roots, ICustomizationManager customizationManager) {
super(customizationManager);
this.roots = roots;
@@ -78,7 +79,7 @@ public class SemanticEMFContentProvider extends CustomizableModelContentProvider
this(null, null, roots);
}
- public SemanticEMFContentProvider(EObject[] roots, CustomizationManager customizationManager) {
+ public SemanticEMFContentProvider(EObject[] roots, ICustomizationManager customizationManager) {
this(null, null, roots, customizationManager);
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFFileUtil.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFFileUtil.java
index 93727584221..b66b1cadeb2 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFFileUtil.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFFileUtil.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.emf.utils;
import java.io.File;
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java
index 3abfeb91979..20553b3c9bc 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java
@@ -46,7 +46,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.XMIResource;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.facet.custom.ui.CustomizedContentProviderUtils;
+import org.eclipse.papyrus.emf.facet.custom.ui.CustomizedContentProviderUtils;
import org.eclipse.papyrus.infra.core.resource.IReadOnlyHandler;
import org.eclipse.papyrus.infra.core.resource.IReadOnlyHandler2;
import org.eclipse.papyrus.infra.core.services.ServiceException;
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/META-INF/MANIFEST.MF
index 3d1bbaf1ca2..44438439ce9 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/META-INF/MANIFEST.MF
@@ -14,9 +14,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.gmfdiag.css.model;bundle-version="1.0.0",
org.eclipse.papyrus.infra.gmfdiag.css;bundle-version="1.0.0",
org.eclipse.papyrus.infra.emf.appearance;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.0",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
- org.eclipse.e4.ui.css.core;bundle-version="0.10.2"
+ org.eclipse.e4.ui.css.core;bundle-version="0.10.2",
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="0.4.0",
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="0.4.0"
Export-Package: org.eclipse.papyrus.infra.gmfdiag.css.configuration.ha
ndler
Bundle-Vendor: Eclipse Modeling Project
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/META-INF/MANIFEST.MF
index cbe029e2689..3c7307be1fd 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/META-INF/MANIFEST.MF
@@ -18,8 +18,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.gmfdiag.properties;bundle-version="1.0.0",
org.eclipse.papyrus.infra.gmfdiag.css.model;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.0",
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0"
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="0.4.0",
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="0.4.0"
Export-Package: org.eclipse.papyrus.infra.gmfdiag.css.properties.creation,
org.eclipse.papyrus.infra.gmfdiag.css.properties.databinding,
org.eclipse.papyrus.infra.gmfdiag.css.properties.provider
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
index 0b335ff402e..2df85a9ff59 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/META-INF/MANIFEST.MF
@@ -4,7 +4,6 @@ Export-Package: org.eclipse.papyrus.infra.gmfdiag.common,
org.eclipse.papyrus.infra.gmfdiag.common.commands,
org.eclipse.papyrus.infra.gmfdiag.common.commands.requests,
org.eclipse.papyrus.infra.gmfdiag.common.databinding.custom,
- org.eclipse.papyrus.infra.gmfdiag.common.decoration,
org.eclipse.papyrus.infra.gmfdiag.common.editpart,
org.eclipse.papyrus.infra.gmfdiag.common.editpolicies,
org.eclipse.papyrus.infra.gmfdiag.common.figure.edge,
@@ -36,7 +35,6 @@ Require-Bundle: org.eclipse.emf.edit.ui;bundle-version="2.5.0",
org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.1",
org.eclipse.papyrus.infra.services.edit;bundle-version="1.0.0",
com.google.guava;bundle-version="11.0.0",
org.eclipse.papyrus.infra.tools;bundle-version="1.0.0",
@@ -53,8 +51,11 @@ Require-Bundle: org.eclipse.emf.edit.ui;bundle-version="2.5.0",
org.apache.batik.xml;bundle-version="[1.6.0,1.7.0)",
org.eclipse.gmf.tooling.runtime,
com.ibm.icu,
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="0.4.0",
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="0.4.0",
org.eclipse.papyrus.infra.services.decoration;bundle-version="1.0.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.uml.tools
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java
index c6a468f8cf9..38622685327 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java
@@ -20,6 +20,7 @@ import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
/**
* A replacement for CreateCommand that avoids that takes into account the incorrect
@@ -46,7 +47,7 @@ public class CreateViewCommand extends CreateCommand {
}
// Try to adapt the descriptor ElementAdapter in EObject
- EObject element = (EObject)viewDescriptor.getElementAdapter().getAdapter(EObject.class);
+ EObject element = EMFHelper.getEObject((EObject)viewDescriptor.getElementAdapter());
IElementType elementType = (IElementType)viewDescriptor.getElementAdapter().getAdapter(IElementType.class);
SemanticElementAdapter semanticAdapter = new SemanticElementAdapter(element, elementType);
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/IPapyrusEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/IPapyrusEditPart.java
index cf3aa85306f..22304031a38 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/IPapyrusEditPart.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/IPapyrusEditPart.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.editpart;
import org.eclipse.draw2d.IFigure;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/ScalableCompartmentFigure.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/ScalableCompartmentFigure.java
index 2da87f5bd15..c0b5f252473 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/ScalableCompartmentFigure.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/ScalableCompartmentFigure.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.figure.node;
import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/NotationHelper.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/NotationHelper.java
index 6f1d4dbb9c0..7d783690bec 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/NotationHelper.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/NotationHelper.java
@@ -14,6 +14,7 @@ package org.eclipse.papyrus.infra.gmfdiag.common.helper;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
/**
* A Helper class related to the GMF Notation metamodel.
@@ -39,7 +40,7 @@ public class NotationHelper {
if(adapter != null) {
return (View)adapter;
}
- adapter = adaptable.getAdapter(EObject.class);
+ adapter = EMFHelper.getEObject(adaptable);
if(adapter instanceof View) {
return (View)adapter;
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/messages/Messages.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/messages/Messages.java
index 80509fc4975..f12616652e3 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/messages/Messages.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/messages/Messages.java
@@ -1,4 +1,4 @@
-/*
+/****************************************
* Copyright (c) 2013, 2014 CEA and others.
*
* All rights reserved. This program and the accompanying materials
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/RestrictedAbstractEditPartProvider.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/RestrictedAbstractEditPartProvider.java
index 96a55ef542e..56687cad171 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/RestrictedAbstractEditPartProvider.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/providers/RestrictedAbstractEditPartProvider.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.providers;
/*****************************************************************************
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/shape/ProviderNotificationManager.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/shape/ProviderNotificationManager.java
index 6f9060a6556..e1fcd6942d1 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/shape/ProviderNotificationManager.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/service/shape/ProviderNotificationManager.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.service.shape;
import org.eclipse.emf.ecore.EObject;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/copy/ConnectionEndpointTracker.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/copy/ConnectionEndpointTracker.java
index ff2c99b22d0..92e86ed183d 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/copy/ConnectionEndpointTracker.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/copy/ConnectionEndpointTracker.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.common.snap.copy;
import java.util.ArrayList;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/META-INF/MANIFEST.MF
index ef692dd6a9f..298de66c314 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/META-INF/MANIFEST.MF
@@ -7,8 +7,6 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.ui,
org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.query;bundle-version="0.1.1",
- org.eclipse.emf.facet.infra.query.core;bundle-version="0.1.1",
org.eclipse.uml2.uml;bundle-version="4.0.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.xml
index 50ca457e82b..c9e52fff7e0 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.xml
@@ -8,7 +8,7 @@
<extension point="org.eclipse.emf.ecore.generated_package">
<package class="org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage" genModel="Model/StyleSheets.genmodel" uri="http://www.eclipse.org/papyrus/infra/gmfdiag/css"/>
</extension>
-
+ <!-- TODO: EMF-FACET update queries
<extension point="org.eclipse.emf.facet.infra.facet.registration">
<facetset file="Model/StyleSheets.facetSet"/>
</extension>
@@ -20,4 +20,5 @@
file="Model/StyleSheets.uiCustom"
loadByDefault="false"/>
</extension>
+ -->
</plugin>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/queries/GetStyleSheets.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/queries/GetStyleSheets.java
index 0c5aa54bab6..84725cf69f9 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/queries/GetStyleSheets.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/queries/GetStyleSheets.java
@@ -1,19 +1,7 @@
package org.eclipse.papyrus.infra.gmfdiag.css.model.queries;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-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.gmfdiag.css.stylesheets.StyleSheet;
-import org.eclipse.uml2.uml.Element;
-
-public class GetStyleSheets implements
+//TODO: EMF-FACET update query
+public class GetStyleSheets {/**implements
IJavaModelQuery<Element, Collection<StyleSheet>> {
public Collection<StyleSheet> evaluate(Element context,
@@ -40,6 +28,6 @@ public class GetStyleSheets implements
}
}
return result;
- }
+ }**/
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/queries/IsStyleSheetContainer.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/queries/IsStyleSheetContainer.java
index b7f3c6e5258..ce9222de163 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/queries/IsStyleSheetContainer.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/queries/IsStyleSheetContainer.java
@@ -1,11 +1,7 @@
package org.eclipse.papyrus.infra.gmfdiag.css.model.queries;
+//TODO: EMF-FACET update 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.uml2.uml.Element;
-
-public class IsStyleSheetContainer implements IJavaModelQuery<Element, Boolean> {
+public class IsStyleSheetContainer {/**implements IJavaModelQuery<Element, Boolean> {
public Boolean evaluate(Element context, ParameterValueList args)
throws ModelQueryExecutionException {
@@ -15,6 +11,6 @@ public class IsStyleSheetContainer implements IJavaModelQuery<Element, Boolean>
//Only the first root element is a StyleSheet container
return context.eResource().getContents().get(0) == context;
- }
+ }*/
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/.project b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/.project
index a0c4da3f4cb..59c30c16c77 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/.project
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/.project
@@ -22,7 +22,7 @@
</buildCommand>
</buildSpec>
<natures>
- <nature>org.eclipse.emf.facet.common.ProjectNature</nature>
+ <nature>org.eclipse.papyrus.emf.facet.common.ProjectNature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
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 f10847acb64..92b11cb8c0b 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
@@ -3,7 +3,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
com.google.guava;bundle-version="11.0.0",
org.eclipse.papyrus.views.modelexplorer;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.query.core,
org.eclipse.gmf.runtime.notation,
org.eclipse.emf.transaction,
org.eclipse.gmf.runtime.common.core,
@@ -12,16 +11,23 @@ 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,
+ org.eclipse.emf.ecore,
+ org.eclipse.papyrus.emf.facet.efacet.core,
+ org.eclipse.papyrus.emf.facet.efacet,
+ org.eclipse.papyrus.emf.facet.efacet.metamodel,
+ org.eclipse.papyrus.emf.facet.custom.metamodel
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
-Bundle-Name: %pluginName
Bundle-Localization: plugin
-Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.modelexplorer.Acti
vator
+Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.modelexplorer;s
ingleton:=true
Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.eclipse.papyrus.emf.facet.custom.ui
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml
index d3eb801f9d1..90d477a5bca 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/plugin.xml
@@ -2,27 +2,34 @@
<?eclipse version="3.4"?>
<plugin>
- <extension point="org.eclipse.emf.facet.infra.query.registration">
+
+<extension point="org.eclipse.papyrus.emf.facet.util.emf.core.modeldeclaration">
+ <modeldeclaration file="resources/PapyrusDiagram.custom"/>
+</extension>
+
+ <!-- TODO: EMF-FACET
+ <extension point="org.eclipse.papyrus.emf.facet.infra.query.registration">
<modelqueryset file="resources/PapyrusNotationFacet.querySet">
</modelqueryset>
</extension>
- <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <extension point="org.eclipse.papyrus.emf.facet.infra.browser.custom.core.registration">
<browserCustomization
file="resources/PapyrusNotation.uiCustom"
loadByDefault="true"/>
</extension>
- <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <extension point="org.eclipse.papyrus.emf.facet.infra.browser.custom.core.registration">
<browserCustomization
file="resources/PapyrusNotationFacet.uiCustom"
loadByDefault="true"/>
</extension>
<extension
- point="org.eclipse.emf.facet.infra.facet.registration">
+ point="org.eclipse.papyrus.emf.facet.infra.facet.registration">
<facetset
file="resources/PapyrusNotationFacet.facetSet">
</facetset>
</extension>
+ -->
<extension
point="org.eclipse.ui.handlers">
<handler
@@ -78,5 +85,6 @@
properties="isDiagram"
type="org.eclipse.jface.viewers.IStructuredSelection">
</propertyTester>
- </extension>
+ </extension>
+
</plugin>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom
new file mode 100644
index 00000000000..9298e47f8af
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom
@@ -0,0 +1,49 @@
+<?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/papyrus/emf/facet/custom/0.2.incubation/custom" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:efacet="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet" xmlns:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" xmlns:query="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet/query" name="PapyrusDiagram">
+ <eClassifiers xsi:type="custom:EClassCustomization" name="Diagram" documentation="Representation of diagram in model explorer">
+ <extendedMetaclass href="http://www.eclipse.org/gmf/runtime/1.0.2/notation#//Diagram"/>
+ <facetOperations name="GetDiagramIcon" documentation="Return the path to the icon of the corresponding diagram">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types#//Image"/>
+ <eParameters name="eObject">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ </eParameters>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.GetDiagramIcon"/>
+ <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/image"/>
+ </facetOperations>
+ <facetOperations name="NotVisibleStructuralFeature">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eParameters name="eStructuralFeature">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"/>
+ </eParameters>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.NotVisibleStructuralFeatureQuery"/>
+ <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ </facetOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="custom:EClassCustomization" name="EObject" documentation="representation around EObject displayed in model explorer">
+ <extendedMetaclass href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <facetElements xsi:type="efacet:FacetReference" name="diagrams" upperBound="-1" defaultValueLiteral="" derived="true">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/gmf/runtime/1.0.2/notation#//Diagram"/>
+ <query xsi:type="query:OperationCallQuery" operation="//EObject/DiagramsRefContent"/>
+ </facetElements>
+ <facetOperations name="DiagramsRefVisibility" documentation="Return true if the element contains diagrams">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eParameters name="eStructuralFeature">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"/>
+ </eParameters>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.IsDiagramContainer"/>
+ <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ </facetOperations>
+ <facetOperations name="DiagramsRefContent" upperBound="-1" documentation="Get the collection of all contained diagrams">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/gmf/runtime/1.0.2/notation#//Diagram"/>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.GetContainedDiagrams"/>
+ </facetOperations>
+ <facetOperations name="DiagramsRefCollapse">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eParameters name="eStructuralFeature">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"/>
+ </eParameters>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.DiagramsRefCollapseQuery"/>
+ <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
+ </facetOperations>
+ </eClassifiers>
+</custom:Customization>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotation.uiCustom b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotation.uiCustom
deleted file mode 100644
index 95854b45505..00000000000
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotation.uiCustom
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<uicustom:MetamodelView
- xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8"
- metamodelURI="http://www.eclipse.org/gmf/runtime/1.0.2/notation">
- <types metaclassName="notation.Diagram">
- <references
- referenceName="diagram">
- <customizedFeatures>
- <defaultValue
- xsi:type="uicustom:StaticFeatureValue"
- value="false"/>
- </customizedFeatures>
- </references>
- <references
- referenceName="styles">
- <customizedFeatures>
- <defaultValue
- xsi:type="uicustom:StaticFeatureValue"
- value="false"/>
- </customizedFeatures>
- </references>
- <references
- referenceName="element">
- <customizedFeatures>
- <defaultValue
- xsi:type="uicustom:StaticFeatureValue"
- value="false"/>
- </customizedFeatures>
- </references>
- <references
- referenceName="children">
- <customizedFeatures>
- <defaultValue
- xsi:type="uicustom:StaticFeatureValue"
- value="false"/>
- </customizedFeatures>
- </references>
- <references
- referenceName="edges">
- <customizedFeatures>
- <defaultValue
- xsi:type="uicustom:StaticFeatureValue"
- value="false"/>
- </customizedFeatures>
- </references>
- <references
- referenceName="eAnnotations">
- <customizedFeatures>
- <defaultValue
- xsi:type="uicustom:StaticFeatureValue"
- value="false"/>
- </customizedFeatures>
- </references>
- </types>
-</uicustom:MetamodelView>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.facetSet b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.facetSet
deleted file mode 100644
index 8f07e727e5f..00000000000
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.facetSet
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<facet:FacetSet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:facet="http://www.eclipse.org/EmfFacet/infra/facet/0.8.incubation" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="PapyrusNotationFacet" nsURI="http://org.eclipse.org/papyrus/notation/modelExplorer/Facet" nsPrefix="PapyrusNotationFacet">
- <eClassifiers xsi:type="facet:Facet" name="DiagramContainer" abstract="true">
- <eSuperTypes href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
- <eStructuralFeatures xsi:type="facet:FacetReference" name="diagrams" upperBound="-1" volatile="true" unsettable="true">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/gmf/runtime/1.0.2/notation#//Diagram"/>
- <valueQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusNotationFacet#GetContainedDiagrams"/>
- </eStructuralFeatures>
- <conditionQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusNotationFacet#IsDiagramContainer"/>
- </eClassifiers>
- <extendedPackage href="http://www.eclipse.org/emf/2002/Ecore#/"/>
-</facet:FacetSet>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.querySet b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.querySet
deleted file mode 100644
index 847d46eeef0..00000000000
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.querySet
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<query:ModelQuerySet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="PapyrusNotationFacet" description="A set of queries to manage the diagrams in the ModelExplorer">
- <associatedMetamodels href="http://www.eclipse.org/emf/2002/Ecore#/"/>
- <associatedMetamodels href="http://www.eclipse.org/gmf/runtime/1.0.2/notation#/"/>
- <queries xsi:type="query:JavaModelQuery" name="IsDiagramContainer" description="Return true if the element contains diagrams" implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.IsDiagramContainer">
- <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
- <scope href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
- </queries>
- <queries xsi:type="query:JavaModelQuery" name="GetContainedDiagrams" description="Get the collection of all contained diagrams" upperBound="-1" implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.GetContainedDiagrams">
- <returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/gmf/runtime/1.0.2/notation#//Diagram"/>
- <scope href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
- </queries>
- <queries xsi:type="query:JavaModelQuery" name="GetDiagramIcon" description="Return the path to the icon of the corresponding diagram" implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.GetDiagramIcon">
- <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <scope href="http://www.eclipse.org/gmf/runtime/1.0.2/notation#//Diagram"/>
- </queries>
-</query:ModelQuerySet>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.uiCustom b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.uiCustom
deleted file mode 100644
index dd2dc5e6f92..00000000000
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotationFacet.uiCustom
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<uicustom:MetamodelView xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8" metamodelURI="http://org.eclipse.org/papyrus/notation/modelExplorer/Facet">
- <types metaclassName="PapyrusNotationFacet.DiagramContainer">
- <references referenceName="diagrams">
- <customizedFeatures>
- <valueCases>
- <value xsi:type="uicustom:StaticFeatureValue" value="false"/>
- <condition xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusNotationFacet#IsDiagramContainer"/>
- </valueCases>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- <customizedFeatures customizedFeature="collapseLink">
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
- </customizedFeatures>
- </references>
- </types>
-</uicustom:MetamodelView>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/handlers/AbstractDiagramCommandHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/handlers/AbstractDiagramCommandHandler.java
index caaaa7064e7..990710d0f18 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/handlers/AbstractDiagramCommandHandler.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/handlers/AbstractDiagramCommandHandler.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.modelexplorer.handlers;
import java.util.ArrayList;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/messages/Messages.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/messages/Messages.java
index 60dd97996b0..ed2f87db4b4 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/messages/Messages.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/messages/Messages.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.modelexplorer.messages;
import org.eclipse.osgi.util.NLS;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/DiagramsRefCollapseQuery.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/DiagramsRefCollapseQuery.java
new file mode 100644
index 00000000000..54eff54577b
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/DiagramsRefCollapseQuery.java
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
+import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
+
+public class DiagramsRefCollapseQuery implements IJavaQuery2<EObject, Boolean> {
+ public Boolean evaluate(final EObject context,
+ final IParameterValueList2 parameterValues,
+ final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+ ParameterValue parameterValue= (ParameterValue)parameterValues.getParameterValueByName("eStructuralFeature");
+ EStructuralFeature eStructuralFeature=(EStructuralFeature)parameterValue.getValue();
+ if((eStructuralFeature instanceof FacetReference)&&("diagrams".equals((eStructuralFeature).getName()))){
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/EmptyReferenceAndAttributeNotVisibleQuery.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/EmptyReferenceAndAttributeNotVisibleQuery.java
new file mode 100644
index 00000000000..34b6cd87a8e
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/EmptyReferenceAndAttributeNotVisibleQuery.java
@@ -0,0 +1,55 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
+import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
+
+public class EmptyReferenceAndAttributeNotVisibleQuery implements IJavaQuery2<EObject, Boolean> {
+ public Boolean evaluate(final EObject context,
+ final IParameterValueList2 parameterValues,
+ final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+// ParameterValue parameterValue= (ParameterValue)parameterValues.getParameterValueByName("eStructuralFeature");
+// EStructuralFeature eStructuralFeature=(EStructuralFeature)parameterValue.getValue();
+// if(!(eStructuralFeature instanceof FacetReference)){
+// if( eStructuralFeature instanceof EAttribute){
+// return false;
+// }
+// System.err.println(context.eGet(eStructuralFeature));
+// if( eStructuralFeature instanceof EReference){
+// if( context.eGet(eStructuralFeature)==null){
+// return false;
+// }
+//
+// if( context.eGet(eStructuralFeature) instanceof Collection){
+// if(((Collection)context.eGet(eStructuralFeature)).size()==0){
+// return false;
+// }
+// }
+// }
+// }
+// return true;
+ return false;
+ }
+}
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..c5c535df52d 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.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
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..23b836b4cf5 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
@@ -8,20 +8,25 @@
*
* Contributors:
* Atos - Initial API and implementation
+ * Patrick Tessier (CEA LIST) Modification
*
*/
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.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage;
+import org.eclipse.papyrus.emf.facet.custom.ui.ImageUtils;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
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, IImage> {
- public String evaluate(final Diagram context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
- return "/" + getEditorRegistry(context).getEditorURLIcon(context); //$NON-NLS-1$
+
+ public IImage evaluate(Diagram source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ return ImageUtils.wrap(org.eclipse.emf.common.util.URI.createPlatformPluginURI(getEditorRegistry(source).getEditorURLIcon(source), true).toString()); //$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..23e6be9f436 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
@@ -15,33 +15,44 @@ package org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries;
import java.util.Iterator;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
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.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
+import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
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);
- if(roots == null) {
- return false;
- }
- while(roots.hasNext()) {
- EObject root = roots.next();
- if(root instanceof Diagram) {
- if(EcoreUtil.equals(((Diagram)root).getElement(), context)) {
- return true;
+ public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ ParameterValue parameterValue= (ParameterValue)parameterValues.getParameterValueByName("eStructuralFeature");
+ EStructuralFeature eStructuralFeature=(EStructuralFeature)parameterValue.getValue();
+ if((eStructuralFeature instanceof FacetReference)&&("diagrams".equals((eStructuralFeature).getName()))){
+
+ Iterator<EObject> roots = NavigatorUtils.getNotationRoots(source);
+ if(roots == null) {
+ return false;
+ }
+
+ while(roots.hasNext()) {
+ EObject root = roots.next();
+ if(root instanceof Diagram) {
+ if(EcoreUtil.equals(((Diagram)root).getElement(), source)) {
+ return true;
+ }
}
}
+ return false;
}
- return false;
+ return true;
}
-}
+} \ No newline at end of file
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java
new file mode 100644
index 00000000000..cbd575de018
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
+
+public class NotVisibleStructuralFeatureQuery implements IJavaQuery2<Diagram, Boolean> {
+ public Boolean evaluate(final Diagram context,
+ final IParameterValueList2 parameterValues,
+ final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+ return false;
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/META-INF/MANIFEST.MF b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/META-INF/MANIFEST.MF
index cdd065a20bd..5984fdcf341 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/META-INF/MANIFEST.MF
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/META-INF/MANIFEST.MF
@@ -10,7 +10,6 @@ Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.core.expressions;bundle-version="3.4.300",
org.eclipse.papyrus.views.modelexplorer;bundle-version="1.0.0",
org.eclipse.ui.navigator;bundle-version="3.5.100",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.0",
org.eclipse.core.runtime;bundle-version="3.7.0",
org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0",
org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/Messages.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/Messages.java
index f3856b82a50..a9af823ee6f 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/Messages.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/Messages.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.navigation;
import org.eclipse.osgi.util.NLS;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/utils/Messages.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/utils/Messages.java
index e23e6d04c5e..fa534ae8843 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/utils/Messages.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.navigation/src/org/eclipse/papyrus/infra/gmfdiag/navigation/utils/Messages.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.navigation.utils;
import org.eclipse.osgi.util.NLS;
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF
index ffe59c92ab5..e5016117c69 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF
@@ -2,7 +2,6 @@ Manifest-Version: 1.0
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.papyrus.views.modelexplorer;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.query.core,
org.eclipse.gmf.runtime.notation,
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml
index 01a4149096f..67dca5e4697 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml
@@ -1,20 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
- <extension point="org.eclipse.emf.facet.infra.query.registration">
+ <!-- TODO: EMF-FACET update uicustom and queries
+ <extension point="org.eclipse.papyrus.emf.facet.infra.query.registration">
<modelqueryset file="resources/PapyrusTablesFacet.querySet">
</modelqueryset>
</extension>
- <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <extension point="org.eclipse.papyrus.emf.facet.infra.browser.custom.core.registration">
<browserCustomization file="resources/PapyrusTables.uiCustom" loadByDefault="true"/>
</extension>
- <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <extension point="org.eclipse.papyrus.emf.facet.infra.browser.custom.core.registration">
<browserCustomization file="resources/PapyrusTablesFacet.uiCustom" loadByDefault="true"/>
</extension>
- <extension point="org.eclipse.emf.facet.infra.facet.registration">
+ <extension point="org.eclipse.papyrus.emf.facet.infra.facet.registration">
<facetset file="resources/PapyrusTablesFacet.facetSet">
</facetset>
- </extension>
+ </extension-->
<extension point="org.eclipse.ui.handlers">
<handler class="org.eclipse.papyrus.infra.nattable.modelexplorer.handlers.RenameTableHandler" commandId="org.eclipse.ui.edit.rename">
<activeWhen>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java
index 381d6a2bff0..b493d924f04 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java
@@ -11,22 +11,11 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.nattable.modelexplorer.queries;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-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.papyrus.infra.nattable.model.nattable.Table;
-import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
-import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
-
+//TODO: EMF-FACET update query
/** Get the collection of all contained tables */
-public class GetContainedTables extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Collection<Table>> {
+public class GetContainedTables {/*
+ extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Collection<Table>> {
+
@Override
public Collection<Table> evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
@@ -45,5 +34,5 @@ public class GetContainedTables extends AbstractEditorContainerQuery implements
}
}
return result;
- }
+ }**/
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java
index 6a39028161e..25b549ed7ca 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java
@@ -15,19 +15,15 @@ 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.papyrus.infra.nattable.model.nattable.Table;
import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
-import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
-
-public class IsTableContainer extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Boolean> {
-
+//TODO: EMF-FACET update query
+public class IsTableContainer {/*extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Boolean> {
+*/
/**
* Return true if the element is a Diagram Container
*/
- @Override
+ /*@Override
public Boolean evaluate(final EObject context, ParameterValueList parameterValues) throws ModelQueryExecutionException {
Iterator<EObject> roots = NavigatorUtils.getNotationRoots(context);
if(roots == null) {
@@ -42,5 +38,5 @@ public class IsTableContainer extends AbstractEditorContainerQuery implements IJ
}
}
return false;
- }
+ }*/
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
index 4d5061bd4b3..9dbe6dc68e9 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
@@ -11,7 +11,6 @@ Require-Bundle: org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
org.eclipse.papyrus.infra.nattable.model;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.1",
org.eclipse.papyrus.infra.tools;bundle-version="1.0.0",
org.eclipse.emf.edit.ui,
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
@@ -20,7 +19,9 @@ Require-Bundle: org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
org.eclipse.papyrus.infra.services.edit;bundle-version="1.0.0",
org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="1.0.0",
org.apache.commons.lang,
- com.google.guava;bundle-version="11.0.0"
+ com.google.guava;bundle-version="11.0.0",
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="0.4.0",
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="0.4.0"
Export-Package: org.eclipse.papyrus.infra.nattable,
org.eclipse.papyrus.infra.nattable.celleditor,
org.eclipse.papyrus.infra.nattable.celleditor.config,
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/ImportAxisInNattableManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/ImportAxisInNattableManager.java
index aa65257b2a7..a686f2dc08a 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/ImportAxisInNattableManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/ImportAxisInNattableManager.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.nattable.manager;
import java.io.File;
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/painter/PapyrusSortableHeaderTextPainter.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/painter/PapyrusSortableHeaderTextPainter.java
index 87051275623..14dcfa556ce 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/painter/PapyrusSortableHeaderTextPainter.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/painter/PapyrusSortableHeaderTextPainter.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.nattable.painter;
import org.apache.commons.lang.StringUtils;
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
index 6dc82b8469e..8def89fed89 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.nattable.provider;
/*****************************************************************************
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/.project b/plugins/infra/org.eclipse.papyrus.infra.constraints/.project
index 543b13908d2..ed51e8e7431 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/.project
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/.project
@@ -22,7 +22,7 @@
</buildCommand>
</buildSpec>
<natures>
- <nature>org.eclipse.emf.facet.common.ProjectNature</nature>
+ <nature>org.eclipse.papyrus.emf.facet.common.ProjectNature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.constraints/META-INF/MANIFEST.MF
index 78628eb3ccf..da5e62cf952 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/META-INF/MANIFEST.MF
@@ -16,9 +16,6 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore,
org.eclipse.ui;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.papyrus.infra.emf;bundle-version="1.0.0",
org.eclipse.papyrus.infra.tools;bundle-version="1.0.0";visibility:=reexport,
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml b/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml
index adcf796f3ba..09aea95ab04 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml
@@ -19,13 +19,15 @@
</package>
</extension>
+ <!-- TODO: EMF-FACET update uicustom
<extension
- point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ point="org.eclipse.papyrus.emf.facet.infra.browser.custom.core.registration">
<browserCustomization
file="custom/constraints.uiCustom"
loadByDefault="true">
</browserCustomization>
</extension>
+ -->
<extension
point="org.eclipse.papyrus.infra.constraints.ConstraintEnvironment">
<environment
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.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQueryConstraint.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQueryConstraint.java
index 46d85a2dc53..68090043b71 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQueryConstraint.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQueryConstraint.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.constraints.constraints;
import org.eclipse.papyrus.infra.constraints.Activator;
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java
index 77a29b7f127..29a373244d1 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.constraints.providers;
import org.eclipse.papyrus.infra.constraints.runtime.ConstraintsManager;
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/Activator.java b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/Activator.java
index 8692f17824c..58b7983bcf3 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/Activator.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/Activator.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.extendedtypes.emf;
import org.eclipse.papyrus.infra.core.log.LogHelper;
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/Activator.java b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/Activator.java
index 712e63367a5..96da7016787 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/Activator.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes/src/org/eclipse/papyrus/infra/extendedtypes/Activator.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.extendedtypes;
import org.eclipse.papyrus.infra.core.log.LogHelper;
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/META-INF/MANIFEST.MF
index 900b3f2a8a6..f0b94ae6f9f 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/META-INF/MANIFEST.MF
@@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.emf.transaction,
org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
org.eclipse.ui,
org.eclipse.ui.ide;bundle-version="3.8.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.papyrus.infra.core.log;bundle-version="1.0.0",
org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
@@ -23,7 +22,9 @@ Require-Bundle: org.eclipse.emf.transaction,
org.eclipse.ui.navigator;bundle-version="3.5.200",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
org.eclipse.core.filesystem;bundle-version="1.3.200",
- org.eclipse.papyrus.infra.services.openelement;bundle-version="1.0.0"
+ org.eclipse.papyrus.infra.services.openelement;bundle-version="1.0.0",
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="0.4.0",
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="0.4.0"
Bundle-Vendor: %providerName
Bundle-Version: 1.0.0.qualifier
Bundle-ManifestVersion: 2
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/EditorLookForEditorShell.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/EditorLookForEditorShell.java
index ef1fbc2cb1a..79aa3d7ed94 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/EditorLookForEditorShell.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/EditorLookForEditorShell.java
@@ -13,10 +13,12 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.hyperlink.ui;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
@@ -36,7 +38,7 @@ import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.emf.providers.MoDiscoContentProvider;
+import org.eclipse.papyrus.infra.emf.providers.strategy.SemanticEMFContentProvider;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
import org.eclipse.papyrus.infra.hyperlink.Activator;
@@ -51,7 +53,6 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
-
//TODO: Refactor. Remove the diagram creation listener, and use a Dialog (Which is blocker) instead of a Shell
public class EditorLookForEditorShell extends AbstractLookForEditorShell {
@@ -227,10 +228,46 @@ public class EditorLookForEditorShell extends AbstractLookForEditorShell {
}
treeViewer.setLabelProvider(labelProvider);
- // treeViewer.setContentProvider(new CustomAdapterFactoryContentProvider(adapterFactory));
- // treeViewer.setContentProvider(new SemanticEMFContentProvider(amodel)); //This content provider will only display the selected element, instead of the root element
- treeViewer.setContentProvider(new MoDiscoContentProvider()); //FIXME: Use a standard, non-deprecated content provider.
- //treeViewer.setInput(model.eResource());
+ // treeViewer.setContentProvider(new
+ // CustomAdapterFactoryContentProvider(adapterFactory));
+ // treeViewer.setContentProvider(new
+ // SemanticEMFContentProvider(amodel)); //This content provider will
+ // only display the selected element, instead of the root element
+ // FIXME: Use a standard, non-deprecated content
+ treeViewer.setContentProvider(new SemanticEMFContentProvider() {
+
+ @Override
+ public boolean hasChildren(Object element) {
+ return super.getChildren(element).length > 0;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.emf.providers.MoDiscoContentProvider#getChildren(java.lang.Object)
+ *
+ * @param parentElement
+ * @return
+ */
+ //in some case we return diagram twice!
+ //TODO the best correction we be able to manage applied facet, because if we get diagram twice it is probably because there are 2 facets with the same behavior applied
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ List<Object> alreadyVisited = new ArrayList<Object>();
+ List<Object> returnedChildren = new ArrayList<Object>();
+ Object[] children = super.getChildren(parentElement);
+ for(Object current : children) {
+ if(current instanceof IAdaptable) {
+ EObject el = EMFHelper.getEObject(current);
+ if(!alreadyVisited.contains(el)) {
+ returnedChildren.add(current);
+ alreadyVisited.add(el);
+ }
+ }
+ }
+ return returnedChildren.toArray();
+ }
+ });
+ // treeViewer.setInput(model.eResource());
treeViewer.setInput(registry);
// install diagramlist
diff --git a/plugins/infra/org.eclipse.papyrus.infra.newchild/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.newchild/META-INF/MANIFEST.MF
index dd0d850549f..64cad83022d 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.newchild/META-INF/MANIFEST.MF
+++ b/plugins/infra/org.eclipse.papyrus.infra.newchild/META-INF/MANIFEST.MF
@@ -5,7 +5,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.emf.ecore,
org.eclipse.osgi,
org.eclipse.emf.ecore.xmi,
- org.eclipse.papyrus.infra.queries.core.configuration;bundle-version="1.0.0";visibility:=reexport,
org.eclipse.papyrus.infra.extendedtypes;bundle-version="1.0.0";visibility:=reexport,
org.eclipse.papyrus.infra.services.resourceloading;bundle-version="1.0.0",
org.eclipse.emf.transaction,
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..bf3169f63b8 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.papyrus.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/infra/services/org.eclipse.papyrus.infra.services.validation/META-INF/MANIFEST.MF b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/META-INF/MANIFEST.MF
index 1466cc5fd0e..35e5d14e224 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/META-INF/MANIFEST.MF
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/META-INF/MANIFEST.MF
@@ -7,14 +7,12 @@ Require-Bundle: org.eclipse.ui,
org.apache.commons.lang;bundle-version="2.3.0",
org.eclipse.emf.edit.ui;bundle-version="2.6.0",
org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.0.100",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.0",
org.eclipse.papyrus.infra.services.decoration;bundle-version="1.0.0",
org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
org.eclipse.papyrus.infra.core.log;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.emf;bundle-version="1.0.0",
- org.eclipse.emf.facet.infra.facet;bundle-version="0.3.0",
org.eclipse.papyrus.infra.services.markerlistener;bundle-version="1.0.0",
org.eclipse.uml2.uml;bundle-version="4.1.0"
Export-Package: org.eclipse.papyrus.infra.services.validation,
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/IPapyrusDiagnostician.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/IPapyrusDiagnostician.java
index a9dda91fb94..8b0f4a6d2be 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/IPapyrusDiagnostician.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/IPapyrusDiagnostician.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.services.validation;
import java.util.Map;
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/ValidationTool.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/ValidationTool.java
index 663b18ac062..833162524db 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/ValidationTool.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/ValidationTool.java
@@ -26,7 +26,6 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.facet.infra.browser.uicore.internal.model.LinkItem;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker;
import org.eclipse.papyrus.infra.services.markerlistener.providers.IMarkerProvider;
@@ -89,13 +88,14 @@ public class ValidationTool {
// element has no eObject. try parent
if(getEObject() == null) {
// TODO: is it possible to access the children in another way (without internal access?)
- if(element instanceof LinkItem) {
+ //TODO: EMF-FACET update link-item
+ /**if(element instanceof LinkItem) {
List<?> items = ((LinkItem)element).getChildrenElements();
if(items.size() > 0 && items.get(0) instanceof EObject) {
// element = items[0];
setEObject((EObject)items.get(0));
}
- }
+ }**/
}
}
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/handler/AbstractCommandHandler.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/handler/AbstractCommandHandler.java
index 1521c484fe0..61a73d76cbf 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/handler/AbstractCommandHandler.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/handler/AbstractCommandHandler.java
@@ -26,6 +26,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.papyrus.infra.emf.utils.BusinessModelResolver;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.ui.PlatformUI;
/**
@@ -78,7 +79,7 @@ public abstract class AbstractCommandHandler extends AbstractHandler {
// Treat non-null selected object (try to adapt and return EObject)
if(selection != null) {
if(selection instanceof IAdaptable) {
- selection = ((IAdaptable)selection).getAdapter(EObject.class);
+ selection = EMFHelper.getEObject(selection);
}
Object businessObject = BusinessModelResolver.getInstance().getBusinessModel(selection);
@@ -112,14 +113,14 @@ public abstract class AbstractCommandHandler extends AbstractHandler {
for(Object current : structuredSelection.toArray()) {
// Adapt current selection to EObject
if(current instanceof IAdaptable) {
- selectedEObjects.add((EObject)((IAdaptable)current).getAdapter(EObject.class));
+ selectedEObjects.add(EMFHelper.getEObject(current));
}
}
} else { // Not a IStructuredSelection
if(selection != null) {
// Adapt current selection to EObject
if(selection instanceof IAdaptable) {
- selectedEObjects.add((EObject)((IAdaptable)selection).getAdapter(EObject.class));
+ selectedEObjects.add(EMFHelper.getEObject(selection));
}
}
}
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/preferences/Initializer.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/preferences/Initializer.java
index 5cc01628d1d..195887997a8 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/preferences/Initializer.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/preferences/Initializer.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.services.validation.preferences;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/preferences/PreferencePage.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/preferences/PreferencePage.java
index 550dfb260bb..4646d599aa9 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/preferences/PreferencePage.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/preferences/PreferencePage.java
@@ -1,3 +1,15 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ /*****************************************************************************/
package org.eclipse.papyrus.infra.services.validation.preferences;
import org.eclipse.emf.common.notify.Notification;

Back to the top