Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-02-27 14:57:35 +0000
committerptessier2014-02-27 14:57:35 +0000
commit236cb1a4af4d3fdbb27e6d70ef7e0d99c98c4dcc (patch)
treecfc121106875cd8b28d3cf7df43d7c0af5035339 /plugins/infra
parent40c0e4e6ea47a0c5c1821d61490e67b05af257b5 (diff)
downloadorg.eclipse.papyrus-236cb1a4af4d3fdbb27e6d70ef7e0d99c98c4dcc.tar.gz
org.eclipse.papyrus-236cb1a4af4d3fdbb27e6d70ef7e0d99c98c4dcc.tar.xz
org.eclipse.papyrus-236cb1a4af4d3fdbb27e6d70ef7e0d99c98c4dcc.zip
[EMF Facet] Papyrus should progressively support EMF Facet 0.2
merge PapyrusNotation.uiCustom to PapyrusNotation.custom
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/META-INF/MANIFEST.MF29
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotation.custom99
-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.uiCustom17
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/DiagramsRefCollapseQuery.java24
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/EmptyReferenceAndAttributeNotVisibleQuery.java43
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java31
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java16
9 files changed, 153 insertions, 176 deletions
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 cfa41143655..e2f8f23b03f 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
@@ -1,26 +1,23 @@
Manifest-Version: 1.0
-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.gmf.runtime.notation,
- org.eclipse.emf.transaction,
- org.eclipse.gmf.runtime.common.core,
- org.eclipse.gmf.runtime.emf.commands.core,
- org.eclipse.core.expressions,
- 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.emf.facet.query.java.core
+Require-Bundle: org.eclipse.ui,org.eclipse.core.runtime,com.google.gua
+ va;bundle-version="11.0.0",org.eclipse.papyrus.views.modelexplorer;bu
+ ndle-version="1.0.0",org.eclipse.gmf.runtime.notation,org.eclipse.emf
+ .transaction,org.eclipse.gmf.runtime.common.core,org.eclipse.gmf.runt
+ ime.emf.commands.core,org.eclipse.core.expressions,org.eclipse.gmf.ru
+ ntime.emf.type.core,org.eclipse.papyrus.infra.core.sasheditor;bundle-
+ version="1.0.0",org.eclipse.papyrus.infra.gmfdiag.commands;bundle-ver
+ sion="1.0.0",org.eclipse.papyrus.infra.core;bundle-version="1.0.0",or
+ g.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
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
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotation.custom b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotation.custom
index a737d8541cf..ba90b170ae9 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotation.custom
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusNotation.custom
@@ -1,70 +1,45 @@
<?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="PapyrusNotation">
- <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/uml2/4.0.0/Types#//String"/>
- <query
- xsi:type="javaQuery:JavaQuery"
- implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.GetDiagramIcon"/>
+<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="PapyrusNotation">
+ <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/uml2/4.0.0/Types#//String"/>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.GetDiagramIcon"/>
+ </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/GetContainedDiagrams"/>
+ <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="IsDiagramContainer"
- documentation="Return true if the element contains 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 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="GetContainedDiagrams"
- 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 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.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/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..f6e9082f73c
--- /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,24 @@
+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..1ce4085dd2b
--- /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,43 @@
+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/IsDiagramContainer.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/IsDiagramContainer.java
index 01233b103db..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,10 +15,13 @@ 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.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;
@@ -31,19 +34,25 @@ public class IsDiagramContainer extends AbstractEditorContainerQuery implements
*/
public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
- Iterator<EObject> roots = NavigatorUtils.getNotationRoots(source);
- if(roots == null) {
- return false;
- }
+ ParameterValue parameterValue= (ParameterValue)parameterValues.getParameterValueByName("eStructuralFeature");
+ EStructuralFeature eStructuralFeature=(EStructuralFeature)parameterValue.getValue();
+ if((eStructuralFeature instanceof FacetReference)&&("diagrams".equals((eStructuralFeature).getName()))){
- while(roots.hasNext()) {
- EObject root = roots.next();
- if(root instanceof Diagram) {
- if(EcoreUtil.equals(((Diagram)root).getElement(), source)) {
- return true;
+ 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..307f4ee864c
--- /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,16 @@
+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;
+ }
+}

Back to the top