Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-03-27 12:46:35 -0400
committerptessier2014-03-27 12:46:35 -0400
commit501982f8212a21792102b0a0c85c489217d780d7 (patch)
treed03e581628489b6f64646868e4f9af17cf64b46e /plugins
parente4b3dd45e9cac59f753eab6c7e3ecf192fae591f (diff)
downloadorg.eclipse.papyrus-501982f8212a21792102b0a0c85c489217d780d7.tar.gz
org.eclipse.papyrus-501982f8212a21792102b0a0c85c489217d780d7.tar.xz
org.eclipse.papyrus-501982f8212a21792102b0a0c85c489217d780d7.zip
386118: [EMF Facet] Papyrus should progressively support EMF Facet 0.2
https://bugs.eclipse.org/bugs/show_bug.cgi?id=386118
Diffstat (limited to 'plugins')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/plugin.xml187
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/plugin.xml188
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom12
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/DisplayDiagramRef.java59
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java8
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTable.custom13
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/DisplayTablesRef.java58
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java7
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/TablesRefCollapseQuery.java2
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/SimpleUML.custom4
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java7
11 files changed, 522 insertions, 23 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/plugin.xml b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/plugin.xml
index 27a0f14f477..9f55afabaa6 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/plugin.xml
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.sdk.ui/plugin.xml
@@ -19,5 +19,190 @@
<extension point="org.eclipse.papyrus.emf.facet.widgets.celleditors.compositeEditorFactories">
<compositeEditorFactory class="org.eclipse.papyrus.emf.facet.custom.sdk.ui.internal.widgets.celleditors.composite.ImageCompositeFactory"/>
</extension>
-
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.custom.sdk.ui.internal.util.handler.CreateEClassCustomizationHandler"
+ id="org.eclipse.papyrus.emf.facet.custom.sdk.ui.CreateEClassCustomization"
+ name="%command.custo.name">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.custom.sdk.ui.internal.util.handler.CreateFacetCustomizationHandler"
+ id="org.eclipse.papyrus.emf.facet.custom.sdk.ui.CreateFacetCustomization"
+ name="%command.custo.name.1">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.custom.sdk.ui.internal.util.handler.AddCustomizationPropertyInEClassHandler"
+ id="org.eclipse.papyrus.emf.facet.custom.sdk.ui.AddCustomization"
+ name="%command.custo.name.2">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.custom.sdk.ui.internal.util.handler.AddCaseQueryHandler"
+ id="org.eclipse.papyrus.emf.facet.custom.sdk.ui.AddCaseQuery"
+ name="%command.custo.name.3">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="true"
+ locationURI="popup:org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomEditorID?before=edit">
+ <menu
+ label="%menu.custo.label">
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.custom.sdk.ui.CreateEClassCustomization"
+ icon="icons/full/obj16/CustomModelFile.gif"
+ label="%command.custo.name"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.custom.sdk.ui.CreateFacetCustomization"
+ icon="icons/full/obj16/CustomModelFile.gif"
+ label="%command.custo.name.1"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.custom.sdk.ui.AddCustomization"
+ icon="icons/full/obj16/CustomModelFile.gif"
+ label="%command.custo.name.2"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.custom.sdk.ui.AddCaseQuery"
+ icon="icons/querySet.gif"
+ label="%command.custo.name.3"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menu>
+ <menu
+ label="%menu.label">
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.createFacetSetInFacetSet"
+ icon="icons/FacetSet.gif"
+ label="%command.name"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.createFacetInFacetSet"
+ icon="icons/facet.gif"
+ label="%command.name.0"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addAttributeInFacet"
+ icon="icons/FacetAttribute.gif"
+ label="%command.name.1"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addOperationInFacet"
+ icon="icons/FacetOperation.gif"
+ label="%command.name.2"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addReferenceInFacet"
+ icon="icons/FacetReference.gif"
+ label="%command.name.4"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addParameterInOperation"
+ icon="icons/ParameterValue.gif"
+ label="%command.name.3"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetSet"
+ icon="icons/FacetSet.gif"
+ label="%command.name.5"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacet"
+ icon="icons/facet.gif"
+ label="%command.name.6"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetAttribute"
+ icon="icons/FacetAttribute.gif"
+ label="%command.name.7"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetOperation"
+ icon="icons/FacetOperation.gif"
+ label="%command.name.8"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetOperationParameter"
+ icon="icons/ParameterValue.gif"
+ label="%command.name.9"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetReference"
+ icon="icons/FacetReference.gif"
+ label="%command.name.10"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menu>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.eclipse.papyrus.emf.facet.custom.sdk.ui.internal.Startup"></startup>
+ </extension>
</plugin>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/plugin.xml b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/plugin.xml
index 6b3480cce13..cff58e6e921 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/plugin.xml
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/plugin.xml
@@ -13,5 +13,191 @@
-->
<plugin>
<extension-point id="queryFactoryDialogRegistration" name="%extension-point.name" schema="schema/queryFactoryDialogRegistration.exsd"/>
-
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="true"
+ locationURI="popup:org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.presentation.EFacetEditorID?before=edit">
+ <menu
+ label="%menu.label">
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.createFacetSetInFacetSet"
+ icon="icons/FacetSet.gif"
+ label="%command.name"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.createFacetInFacetSet"
+ icon="icons/facet.gif"
+ label="%command.name.0"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addAttributeInFacet"
+ icon="icons/FacetAttribute.gif"
+ label="%command.name.1"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addOperationInFacet"
+ icon="icons/FacetOperation.gif"
+ label="%command.name.2"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addReferenceInFacet"
+ icon="icons/FacetReference.gif"
+ label="%command.name.4"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addParameterInOperation"
+ icon="icons/ParameterValue.gif"
+ label="%command.name.3"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetSet"
+ icon="icons/FacetSet.gif"
+ label="%command.name.5"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacet"
+ icon="icons/facet.gif"
+ label="%command.name.6"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetAttribute"
+ icon="icons/FacetAttribute.gif"
+ label="%command.name.7"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetOperation"
+ icon="icons/FacetOperation.gif"
+ label="%command.name.8"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetOperationParameter"
+ icon="icons/ParameterValue.gif"
+ label="%command.name.9"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetReference"
+ icon="icons/FacetReference.gif"
+ label="%command.name.10"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menu>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation.CreateFacetSetInFacetSetHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.createFacetSetInFacetSet"
+ name="%command.name">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation.CreateFacetInFacetSetHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.createFacetInFacetSet"
+ name="%command.name.0">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation.AddAttributeInFacetHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addAttributeInFacet"
+ name="%command.name.1">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation.AddOperationInFacetHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addOperationInFacet"
+ name="%command.name.2">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation.AddReferenceInFacetHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addReferenceInFacet"
+ name="%command.name.4">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.creation.AddParameterInOperationHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.addParameterInOperation"
+ name="%command.name.3">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition.EditFacetSetHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetSet"
+ name="%command.name.5">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition.EditFacetHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacet"
+ name="%command.name.6">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition.EditFacetAttributeHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetAttribute"
+ name="%command.name.7">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition.EditFacetOperationHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetOperation"
+ name="%command.name.8">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition.EditFacetOperationParameterHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetOperationParameter"
+ name="%command.name.9">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.handler.edition.EditFacetReferenceHandler"
+ id="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.editFacetReference"
+ name="%command.name.10">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.eclipse.papyrus.emf.facet.efacet.sdk.ui.internal.Startup">
+ </startup>
+ </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
index 6d0807de1a6..776714a0ea2 100644
--- 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
@@ -19,11 +19,17 @@
<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">
+ <eClassifiers xsi:type="efacet:Facet" name="DiagramContainer" documentation="this element represent a container of diagram" conformanceTypedElement="//DiagramContainer/isDiagramContainer">
<extendedMetaclass href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <facetOperations name="isDiagramContainer" documentation="test if the element references diagrams">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.IsDiagramContainer"/>
+ </facetOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="custom:FacetCustomization" name="DiagramContainer" documentation="Representation of a diagram container">
<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"/>
+ <query xsi:type="query:OperationCallQuery" operation="//DiagramContainer.1/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"/>
@@ -45,5 +51,7 @@
<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>
+ <extendedFacets href="../../../plugin/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom#//DiagramContainer"/>
+ <customizedFacet href="../../../plugin/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom#//DiagramContainer"/>
</eClassifiers>
</custom:Customization>
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/DisplayDiagramRef.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/DisplayDiagramRef.java
new file mode 100644
index 00000000000..814c6cf53c5
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/DisplayDiagramRef.java
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2011 Atos.
+ *
+ * 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:
+ * Atos - Initial API and implementation
+ *
+ */
+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.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
+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 DisplayDiagramRef extends AbstractEditorContainerQuery implements IJavaQuery2<EObject, Boolean> {
+
+ /**
+ * Return true if the element is a Diagram Container and the Ereference is diagrams
+ */
+
+ 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(DiagramUtils.getOwner((Diagram) root), source)) {
+ return true;
+ }
+ }
+ }
+ 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/IsDiagramContainer.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java
index 348eff81323..026a7992aca 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
@@ -31,14 +31,10 @@ import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQu
public class IsDiagramContainer extends AbstractEditorContainerQuery implements IJavaQuery2<EObject, Boolean> {
/**
- * Return true if the element is a Diagram Container
+ * Return true if the element is a Diagram Container
*/
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;
@@ -53,7 +49,5 @@ public class IsDiagramContainer extends AbstractEditorContainerQuery implements
}
}
return false;
- }
- return true;
}
} \ No newline at end of file
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTable.custom b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTable.custom
index 591f2c9a5c1..ce3b78ed3e2 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTable.custom
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTable.custom
@@ -19,18 +19,24 @@
<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">
+ <eClassifiers xsi:type="efacet:Facet" name="TableContainer" documentation="this is a container of table" conformanceTypedElement="//TableContainer/isTableContainer">
<extendedMetaclass href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <facetOperations name="isTableContainer" documentation="test if it references table">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.IsTableContainer"/>
+ </facetOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="custom:FacetCustomization" name="TableContainer" documentation="representation of a container of table" extendedFacets="//TableContainer">
<facetElements xsi:type="efacet:FacetReference" name="tables" upperBound="-1" defaultValueLiteral="" derived="true">
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
- <query xsi:type="query:OperationCallQuery" operation="//EObject/TablesRefContent"/>
+ <query xsi:type="query:OperationCallQuery" operation="//TableContainer.1/TablesRefContent"/>
</facetElements>
<facetOperations name="TablesRefVisibility" documentation="Return true if the element contains tables">
<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.nattable.modelexplorer.queries.IsTableContainer"/>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.DisplayTablesRef"/>
<override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
</facetOperations>
<facetOperations name="TablesRefContent" upperBound="-1" documentation="Get the collection of all contained tables">
@@ -45,5 +51,6 @@
<query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.TablesRefCollapseQuery"/>
<override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
</facetOperations>
+ <customizedFacet href="../../../plugin/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTable.custom#//TableContainer"/>
</eClassifiers>
</custom:Customization>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/DisplayTablesRef.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/DisplayTablesRef.java
new file mode 100644
index 00000000000..40c3c19cad3
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/DisplayTablesRef.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2011 Atos.
+ *
+ * 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:
+ * Atos - Initial API and implementation
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.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.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.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
+
+public class DisplayTablesRef extends AbstractEditorContainerQuery implements IJavaQuery2<EObject, Boolean> {
+
+ /**
+ * Return true if the element is a Table Container and the the Ereference is diagrams
+ */
+
+ 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) && ("tables".equals((eStructuralFeature).getName()))) {
+
+ Iterator<EObject> roots = NavigatorUtils.getNotationRoots(source);
+ if (roots == null) {
+ return false;
+ }
+
+ while (roots.hasNext()) {
+ EObject root = roots.next();
+ if (root instanceof Table) {
+ if (EcoreUtil.equals(((Table) root).getOwner(), source)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ return true;
+ }
+} \ No newline at end of file
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 f878ddf7ba4..f9a39dbedf9 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
@@ -34,9 +34,6 @@ public class IsTableContainer extends AbstractEditorContainerQuery implements IJ
*/
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) {
@@ -51,8 +48,6 @@ public class IsTableContainer extends AbstractEditorContainerQuery implements IJ
}
}
}
- return false;
- }
- return true;
+ return false;
}
} \ No newline at end of file
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/TablesRefCollapseQuery.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/TablesRefCollapseQuery.java
index 6560c8c3a64..785437fc257 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/TablesRefCollapseQuery.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/TablesRefCollapseQuery.java
@@ -27,7 +27,7 @@ public class TablesRefCollapseQuery implements IJavaQuery2<EObject, Boolean> {
throws DerivedTypedElementException {
ParameterValue parameterValue= (ParameterValue)parameterValues.getParameterValueByName("eStructuralFeature");
EStructuralFeature eStructuralFeature=(EStructuralFeature)parameterValue.getValue();
- if((eStructuralFeature instanceof FacetReference)&&("diagrams".equals((eStructuralFeature).getName()))){
+ if((eStructuralFeature instanceof FacetReference)&&("tables".equals((eStructuralFeature).getName()))){
return true;
}
return false;
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/SimpleUML.custom b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/SimpleUML.custom
index 1c575d13891..b6e30a3c628 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/SimpleUML.custom
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/SimpleUML.custom
@@ -12,8 +12,8 @@
</facetOperations>
<facetOperations name="GetElementIcon">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types#//Image"/>
- <eParameters name="eStructuralElement">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"/>
+ <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.uml.modelexplorer.queries.GetImageQuery"/>
<override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/image"/>
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java
index 8293016477b..ce4d3dd48cd 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetImageQuery.java
@@ -13,6 +13,7 @@
package org.eclipse.papyrus.uml.modelexplorer.queries;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage;
@@ -21,6 +22,7 @@ import org.eclipse.papyrus.emf.facet.custom.ui.internal.custompt.ImageWrapper;
import org.eclipse.papyrus.emf.facet.custom.ui.internal.query.ImageQuery;
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.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.uml.tools.utils.ElementUtil;
@@ -36,6 +38,11 @@ public class GetImageQuery implements IJavaQuery2<Element, IImage> {
//@Override
public IImage evaluate(Element source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ ParameterValue parameterValue= (ParameterValue)parameterValues.getParameterValueByName("eObject");
+ if(parameterValue.getValue() instanceof EStructuralFeature){
+ return ImageQuery.getEObjectImage((EStructuralFeature)parameterValue.getValue());
+ }
+
String iconPath = "";
if(!source.getAppliedStereotypes().isEmpty()) {
Stereotype first_stereotype = source.getAppliedStereotypes().get(0);

Back to the top