diff options
author | Camille Letavernier | 2016-01-13 14:57:07 +0000 |
---|---|---|
committer | Camille Letavernier | 2016-01-18 12:41:09 +0000 |
commit | e470aff3493a4d9c00ecaa22cae442625a50e2c5 (patch) | |
tree | bc5003fe2aa9d339a68fcfd535c45248c95bb42e /plugins | |
parent | 1305645a73413c2c73c3e2dad8e99c409279a342 (diff) | |
download | org.eclipse.papyrus-e470aff3493a4d9c00ecaa22cae442625a50e2c5.tar.gz org.eclipse.papyrus-e470aff3493a4d9c00ecaa22cae442625a50e2c5.tar.xz org.eclipse.papyrus-e470aff3493a4d9c00ecaa22cae442625a50e2c5.zip |
485539: [Performances - Facet Manager] FacetManager recomputes the
Facets for a given element too many times
https://bugs.eclipse.org/bugs/show_bug.cgi?id=485539
- Replace the custom property isVisible(EObject, EStructuralFeature)
with getVisibleReferences(EObject) and getVisibleAttributes(EObject).
This improves performances a lot, especially for complex metamodels such
as UML
Change-Id: I170b70774b8f6f19ded7fe1e824097b0c5cf7300
Signed-off-by: Camille Letavernier <camille.letavernier@cea.fr>
Diffstat (limited to 'plugins')
43 files changed, 1846 insertions, 860 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/.classpath b/plugins/customization/org.eclipse.papyrus.customization.properties/.classpath index 8a8f1668cdc..d9f32c1698a 100644 --- a/plugins/customization/org.eclipse.papyrus.customization.properties/.classpath +++ b/plugins/customization/org.eclipse.papyrus.customization.properties/.classpath @@ -1,7 +1,8 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry exported="true" kind="lib" path="bin" sourcepath="bin"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/.settings/org.eclipse.jdt.core.prefs b/plugins/customization/org.eclipse.papyrus.customization.properties/.settings/org.eclipse.jdt.core.prefs index 410244d65a6..62a08f4494d 100755 --- a/plugins/customization/org.eclipse.papyrus.customization.properties/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/customization/org.eclipse.papyrus.customization.properties/.settings/org.eclipse.jdt.core.prefs @@ -1,10 +1,10 @@ eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/META-INF/MANIFEST.MF b/plugins/customization/org.eclipse.papyrus.customization.properties/META-INF/MANIFEST.MF index da143c10589..b28b913d547 100644 --- a/plugins/customization/org.eclipse.papyrus.customization.properties/META-INF/MANIFEST.MF +++ b/plugins/customization/org.eclipse.papyrus.customization.properties/META-INF/MANIFEST.MF @@ -32,4 +32,4 @@ Bundle-Activator: org.eclipse.papyrus.customization.properties.Activator Bundle-ManifestVersion: 2
Bundle-Description: %pluginDescription
Bundle-SymbolicName: org.eclipse.papyrus.customization.properties;singleton:=true
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/UICustom/PropertiesContext.custom b/plugins/customization/org.eclipse.papyrus.customization.properties/UICustom/PropertiesContext.custom index 8f2eb210220..a9d2f9665f4 100644 --- a/plugins/customization/org.eclipse.papyrus.customization.properties/UICustom/PropertiesContext.custom +++ b/plugins/customization/org.eclipse.papyrus.customization.properties/UICustom/PropertiesContext.custom @@ -1,500 +1,575 @@ <?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:oclQuery="http://www.eclipse.org/papyrus/emf/facet/query/ocl/0.3.incubation/oclquery" name="Properties Context" nsURI="http://www.eclipse.org/papyrus/properties/contexts/custom" nsPrefix="propctx" documentation="" mustBeLoadedByDefault="true">
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomContext">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
- <facetOperations name="label" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+<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:oclQuery="http://www.eclipse.org/papyrus/emf/facet/query/ocl/0.3.incubation/oclquery"
+ name="Properties Context"
+ nsURI="http://www.eclipse.org/papyrus/properties/contexts/custom"
+ nsPrefix="propctx"
+ documentation=""
+ mustBeLoadedByDefault="true">
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomContext">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
+ <facetOperations
+ name="label"
+ lowerBound="1">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <value xsi:type="oclQuery:OclQuery" oclExpression="if name = null or name = '' then '<<Unnamed>>' else name endif">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ oclExpression="if name = null or name = '' then '<<Unnamed>>' else name endif">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
</value>
</cases>
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/views"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="'Views'">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/views"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="'Views'">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
</value>
</cases>
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/dataContexts"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="'Data contexts'">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/dataContexts"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="'Data contexts'">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
</facetOperations>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/emf/2002/Ecore#//EModelElement/eAnnotations"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/name"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/dependencies"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/dataContexts"/>
- <value xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.customization.properties.query.ShowContextQuery"/>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/prototype"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="not self.prototype.oclIsUndefined()">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <facetOperations name="image" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types#//Image"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <facetOperations
+ name="image"
+ lowerBound="1">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types#//Image"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/views"/>
- <value xsi:type="javaQuery:JavaQuery" canBeCached="true" implementationClassName="org.eclipse.papyrus.customization.properties.query.ViewsImageQuery"/>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/dataContexts"/>
- <value xsi:type="javaQuery:JavaQuery" canBeCached="true" implementationClassName="org.eclipse.papyrus.customization.properties.query.DataContextsImageQuery"/>
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
+ <cases>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/views"/>
+ <value
+ xsi:type="javaQuery:JavaQuery"
+ canBeCached="true"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.ViewsImageQuery"/>
+ </cases>
+ <cases>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/dataContexts"/>
+ <value
+ xsi:type="javaQuery:JavaQuery"
+ canBeCached="true"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.DataContextsImageQuery"/>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/image"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/image"/>
</facetOperations>
- <facetOperations name="collapseLink">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <facetOperations
+ name="collapseLink">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/tabs"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="true">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context/tabs"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="true">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
+ <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.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomDataContextRoot">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextRoot"/>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement/name"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextRoot"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextRoot/label"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextRoot"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextRoot/modelElementFactory"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextRoot"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomDataContextRoot">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextRoot"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomDataContextPackage">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextPackage"/>
- <facetOperations name="collapseLink">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomDataContextPackage">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextPackage"/>
+ <facetOperations
+ name="collapseLink">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextPackage/elements"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="true">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextPackage"/>
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
+ <cases>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextPackage/elements"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="true">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextPackage"/>
+ </value>
+ </cases>
+ <cases>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement/properties"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="true">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
+ <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.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomDataContextElement">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement"/>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomDataContextElement">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement"/>
+ <facetOperations
+ name="collapseLink">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement/name"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement/package"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement/supertypes"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement"/>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement/properties"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="true">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
</facetOperations>
- <facetOperations name="collapseLink">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <facetOperations
+ name="label"
+ lowerBound="1">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement/properties"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="true">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="name">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
</facetOperations>
- <facetOperations name="label" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="name">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//DataContextElement"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomProperty">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomProperty">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
+ <facetOperations
+ name="label"
+ lowerBound="1">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property/name"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property/label"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
- </value>
- </cases>
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property/type"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property/contextElement"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property/multiplicity"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property/description"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="if label.oclIsUndefined() or label = '' then name else label endif">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
</facetOperations>
- <facetOperations name="label" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="if label.oclIsUndefined() or label = '' then name else label endif">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomSection">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Section"/>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomSection">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Section"/>
+ <facetOperations
+ name="label"
+ lowerBound="1">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/constraints/0.9#//DisplayUnit/constraints"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/constraints/0.9#//DisplayUnit/elementMultiplicity"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Section/name"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Section/tab"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Section/sectionFile"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Property"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="if name = null or name = '' then '<<Unnamed>>' else name.concat(if tab.oclIsUndefined() then ' [<<Undefined>>]' else ' ['.concat(tab.label).concat(']') endif) endif">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Section"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
</facetOperations>
- <facetOperations name="label" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <facetOperations
+ name="collapseLink">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="if name = null or name = '' then '<<Unnamed>>' else name.concat(if tab.oclIsUndefined() then ' [<<Undefined>>]' else ' ['.concat(tab.label).concat(']') endif) endif">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Section"/>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Section/widget"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="true">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Section"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
</facetOperations>
- <facetOperations name="collapseLink">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Section/widget"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="true">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Section"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomTab">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomTab">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
+ <facetOperations
+ name="label"
+ lowerBound="1">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab/label"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab/id"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab/category"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab/image"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab/afterTab"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
- </value>
- </cases>
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab/sections"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab/indented"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab/priority"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="if label.oclIsUndefined() or label = '' then '<<Unnamed>>' else label endif">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
</facetOperations>
- <facetOperations name="label" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="if label.oclIsUndefined() or label = '' then '<<Unnamed>>' else label endif">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Tab"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomView">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomView">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
+ <facetOperations
+ name="collapseLink">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/constraints/0.9#//DisplayUnit/constraints"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
- </value>
- </cases>
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/constraints/0.9#//DisplayUnit/elementMultiplicity"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View/name"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View/context"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View/automaticContext"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View/datacontexts"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View/sections"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="true">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
</facetOperations>
- <facetOperations name="collapseLink">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <facetOperations
+ name="label"
+ lowerBound="1">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View/sections"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="true">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="if name = null or name = '' then '<<Unnamed>>' else name endif">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
</facetOperations>
- <facetOperations name="label" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="if name = null or name = '' then '<<Unnamed>>' else name endif">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//View"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
</custom:Customization>
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/UICustom/PropertiesUI.custom b/plugins/customization/org.eclipse.papyrus.customization.properties/UICustom/PropertiesUI.custom index c5797703ec2..7cdc1aa342e 100644 --- a/plugins/customization/org.eclipse.papyrus.customization.properties/UICustom/PropertiesUI.custom +++ b/plugins/customization/org.eclipse.papyrus.customization.properties/UICustom/PropertiesUI.custom @@ -1,261 +1,330 @@ <?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:oclQuery="http://www.eclipse.org/papyrus/emf/facet/query/ocl/0.3.incubation/oclquery" name="Properties UI" nsURI="http://www.eclipse.org/papyrus/properties/ui/custom" nsPrefix="propui" mustBeLoadedByDefault="true">
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomCompositeWidget">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget"/>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget/widgetType"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent/attributes"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+<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:oclQuery="http://www.eclipse.org/papyrus/emf/facet/query/ocl/0.3.incubation/oclquery"
+ name="Properties UI"
+ nsURI="http://www.eclipse.org/papyrus/properties/ui/custom"
+ nsPrefix="propui"
+ mustBeLoadedByDefault="true">
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomCompositeWidget">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <facetOperations name="collapseLink">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <facetOperations
+ name="collapseLink">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent/attributes"/>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent/attributes"/>
</cases>
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget/layout"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="true">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget"/>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget/layout"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="true">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget"/>
</value>
</cases>
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget/widgets"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="true">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget"/>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget/widgets"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="true">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
</facetOperations>
- <facetOperations name="label" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <facetOperations
+ name="label"
+ lowerBound="1">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="if widgetType = null then '<<Undefined>>' else widgetType.label endif">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="if widgetType = null then '<<Undefined>>' else widgetType.label endif">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//CompositeWidget"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomWidgetAttribute">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/ui/0.9#//WidgetAttribute"/>
- <facetOperations name="label" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomWidgetAttribute">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//WidgetAttribute"/>
+ <facetOperations
+ name="label"
+ lowerBound="1">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="if name = null or name = '' then '<<Undefined>>' else name endif">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//WidgetAttribute"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="if name = null or name = '' then '<<Undefined>>' else name endif">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//WidgetAttribute"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomReferenceAttribute">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/ui/0.9#//ReferenceAttribute"/>
- <facetOperations name="collapseLink">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomReferenceAttribute">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//ReferenceAttribute"/>
+ <facetOperations
+ name="collapseLink">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//ReferenceAttribute/value"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="true">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//ReferenceAttribute"/>
+ <case
+ xsi:type="ecore:EReference"
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//ReferenceAttribute/value"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ canBeCached="true"
+ oclExpression="true">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//ReferenceAttribute"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomLayout">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/ui/0.9#//Layout"/>
- <facetOperations name="label" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomLayout">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//Layout"/>
+ <facetOperations
+ name="label"
+ lowerBound="1">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <value xsi:type="oclQuery:OclQuery" oclExpression="if layoutType = null then '<<Undefined>>' else layoutType.label endif">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//Layout"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ oclExpression="if layoutType = null then '<<Undefined>>' else layoutType.label endif">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//Layout"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
</facetOperations>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//Layout/layoutType"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//Layout"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent/attributes"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomPropertyEditor">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomPropertyEditor">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
+ <facetOperations
+ name="label"
+ lowerBound="1">
+ <eType
+ xsi:type="ecore:EDataType"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters
+ name="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent/attributes"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor/property"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor/readOnly"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor/widgetType"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
- </value>
- </cases>
+ <query
+ xsi:type="custom:ETypedElementSwitchQuery">
<cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor/unresolvedProperty"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor/contentProviderClass"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor/showLabel"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EAttribute" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor/customLabel"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
+ <value
+ xsi:type="oclQuery:OclQuery"
+ oclExpression="if property.oclIsUndefined() then '<<Undefined>>' else if property.label.oclIsUndefined() or property.label = '' then property.name else _property.label endif endif">
+ <context
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
</value>
</cases>
</query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
</facetOperations>
- <facetOperations name="label" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <value xsi:type="oclQuery:OclQuery" oclExpression="if property.oclIsUndefined() then '<<Undefined>>' else if property.label.oclIsUndefined() or property.label = '' then property.name else _property.label endif endif">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomStandardWidget">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/ui/0.9#//StandardWidget"/>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent/attributes"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
- </value>
- </cases>
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//StandardWidget/widgetType"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//PropertyEditor"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomStandardWidget">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//StandardWidget"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
- <eClassifiers xsi:type="custom:EClassCustomization" name="CustomUIComponent">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent"/>
- <facetOperations name="isVisible" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- <eParameters name="eStructuralFeature">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
- </eParameters>
- <query xsi:type="custom:ETypedElementSwitchQuery">
- <cases>
- <case xsi:type="ecore:EReference" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent/attributes"/>
- <value xsi:type="oclQuery:OclQuery" canBeCached="true" oclExpression="false">
- <context xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent"/>
- </value>
- </cases>
- </query>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="CustomUIComponent">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/properties/ui/0.9#//UIComponent"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.customization.properties.query.GetVisibleFeaturesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
- <extendedFacets href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <extendedFacets
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
</eClassifiers>
</custom:Customization>
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/query/GetVisibleFeaturesQuery.java b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/query/GetVisibleFeaturesQuery.java new file mode 100644 index 00000000000..4542011bab2 --- /dev/null +++ b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/query/GetVisibleFeaturesQuery.java @@ -0,0 +1,119 @@ +/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.customization.properties.query; + +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.papyrus.customization.properties.editor.actions.ToggleDataContextAction; +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.infra.constraints.ConstraintsPackage; +import org.eclipse.papyrus.views.properties.contexts.Context; +import org.eclipse.papyrus.views.properties.contexts.ContextsPackage; +import org.eclipse.papyrus.views.properties.contexts.util.ContextsSwitch; +import org.eclipse.papyrus.views.properties.ui.UiPackage; + +/** + * @author Camille Letavernier + * + */ +public class GetVisibleFeaturesQuery implements IJavaQuery2<EObject, List<EReference>> { + + static Set<EReference> allExcludedReferences = new HashSet<EReference>(); + + static { + allExcludedReferences.add(ConstraintsPackage.Literals.DISPLAY_UNIT__CONSTRAINTS); + allExcludedReferences.add(EcorePackage.Literals.EMODEL_ELEMENT__EANNOTATIONS); + + allExcludedReferences.add(ContextsPackage.Literals.CONTEXT__DEPENDENCIES); + allExcludedReferences.add(ContextsPackage.Literals.DATA_CONTEXT_ROOT__MODEL_ELEMENT_FACTORY); + allExcludedReferences.add(ContextsPackage.Literals.DATA_CONTEXT_ELEMENT__PACKAGE); + allExcludedReferences.add(ContextsPackage.Literals.DATA_CONTEXT_ELEMENT__SUPERTYPES); + allExcludedReferences.add(ContextsPackage.Literals.PROPERTY__CONTEXT_ELEMENT); + allExcludedReferences.add(ContextsPackage.Literals.SECTION__TAB); + allExcludedReferences.add(ContextsPackage.Literals.TAB__AFTER_TAB); + allExcludedReferences.add(ContextsPackage.Literals.TAB__SECTIONS); + allExcludedReferences.add(ContextsPackage.Literals.VIEW__CONTEXT); + allExcludedReferences.add(ContextsPackage.Literals.VIEW__DATACONTEXTS); + + allExcludedReferences.add(UiPackage.Literals.COMPOSITE_WIDGET__WIDGET_TYPE); + allExcludedReferences.add(UiPackage.Literals.UI_COMPONENT__ATTRIBUTES); + allExcludedReferences.add(UiPackage.Literals.LAYOUT__LAYOUT_TYPE); + allExcludedReferences.add(UiPackage.Literals.PROPERTY_EDITOR__PROPERTY); + allExcludedReferences.add(UiPackage.Literals.PROPERTY_EDITOR__WIDGET_TYPE); + allExcludedReferences.add(UiPackage.Literals.PROPERTY_EDITOR__UNRESOLVED_PROPERTY); + allExcludedReferences.add(UiPackage.Literals.STANDARD_WIDGET__WIDGET_TYPE); + } + + /** + * @see org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2#evaluate(org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2, org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager) + * + * @param source + * @param parameterValues + * @param facetManager + * @return + * @throws DerivedTypedElementException + */ + @Override + public List<EReference> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException { + if (source.eClass().getEPackage() == ContextsPackage.eINSTANCE) { + return new ContextsSwitch<List<EReference>>() { + @Override + public List<EReference> caseContext(Context object) { + return filter(object.eClass(), filterContextReferences(object)); + } + + @Override + public java.util.List<EReference> defaultCase(EObject object) { + return filter(object.eClass(), ref -> true); + }; + + }.doSwitch(source); + } else if (source.eClass().getEPackage() == UiPackage.eINSTANCE) { + return filter(source.eClass(), ref -> true); + } + + return Collections.emptyList(); + } + + protected Predicate<EReference> filterContextReferences(Context object) { + return ref -> { + if (ref == ContextsPackage.Literals.CONTEXT__DATA_CONTEXTS) { // Show DataContexts only if the corresponding action is enabled + return ToggleDataContextAction.showDataContext; + } else if (ref == ContextsPackage.Literals.CONTEXT__PROTOTYPE) { // Show the Prototype reference only if it is set + return object.getPrototype() != null; + } + return true; + }; + } + + private List<EReference> filter(EClass eClass, Predicate<EReference> filter) { + return eClass.getEAllReferences().stream() + .filter(ref -> !allExcludedReferences.contains(ref)) + .filter(filter) + .collect(Collectors.toList()); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.classpath index 2d1a4302f04..b862a296d38 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.classpath +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.classpath @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?>
<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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.settings/org.eclipse.jdt.core.prefs index 4759947300a..62a08f4494d 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.settings/org.eclipse.jdt.core.prefs @@ -1,10 +1,10 @@ eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF index 3c02f96adb6..a8d56779409 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF @@ -22,4 +22,4 @@ Bundle-Name: %Bundle-Name Bundle-Activator: org.eclipse.papyrus.emf.facet.custom.core.internal.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.custom.core;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/ICustomizationManager.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/ICustomizationManager.java index 297243fe9aa..332ae9dc16e 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/ICustomizationManager.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/ICustomizationManager.java @@ -59,7 +59,7 @@ public interface ICustomizationManager { */
<T> T getCustomValueOf(EObject eObject,
FacetOperation customProperty, Class<T> classs)
- throws CustomizationException;
+ throws CustomizationException;
/**
* This method is used to get the value of a customization property for a
@@ -78,7 +78,7 @@ public interface ICustomizationManager { <T> T getCustomValueOf(EObject eObject,
ETypedElement structuralFeature,
FacetOperation customProperty, Class<T> classs)
- throws CustomizationException;
+ throws CustomizationException;
/**
* This method returns the resourceSet used to manage the customization
@@ -88,4 +88,14 @@ public interface ICustomizationManager { IFacetManager getFacetManager();
+ /**
+ * Multi-valued version of {@link #getCustomValueOf(EObject, FacetOperation, Class)}
+ *
+ * @param eObject
+ * @param visibleReferences
+ * @param class1
+ * @return
+ */
+ <T> List<T> getCustomValuesOf(EObject eObject, FacetOperation customProperty, Class<T> class1) throws CustomizationException;;
+
}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationManager.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationManager.java index bf12983c637..02816817be2 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationManager.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationManager.java @@ -55,14 +55,16 @@ public class CustomizationManager implements ICustomizationManager { this.facetManager.getManagedFacetSets().remove(customization);
}
+ @Override
public List<Customization> getManagedCustomizations() {
return new CustomizationsDelegatingList(this.facetManager.getManagedFacetSets());
}
+ @Override
public <T> T getCustomValueOf(final EObject eObject,
final FacetOperation customizationProperty,
final Class<T> classs)
- throws CustomizationException {
+ throws CustomizationException {
// Begin precondition checking section
/*
* The scope of a customization property is not available yet in new customization meta-model
@@ -86,11 +88,12 @@ public class CustomizationManager implements ICustomizationManager { return result;
}
+ @Override
public <T> T getCustomValueOf(final EObject eObject,
final ETypedElement eTypedElement,
final FacetOperation customizationProperty,
final Class<T> classs)
- throws CustomizationException {
+ throws CustomizationException {
// Begin precondition checking section
if (eObject == null) {
throw new IllegalArgumentException("The parameter 'eObject' must not be null."); //$NON-NLS-1$
@@ -157,6 +160,7 @@ public class CustomizationManager implements ICustomizationManager { }
}
+ @Override
public ResourceSet getResourceSet() {
return this.facetManager.getResourceSet();
}
@@ -174,7 +178,28 @@ public class CustomizationManager implements ICustomizationManager { }
}
+ @Override
public IFacetManager getFacetManager() {
return this.facetManager;
}
+
+ /**
+ * @see org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager#getCustomValuesOf(org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation, java.lang.Class)
+ *
+ * @param eObject
+ * @param customProperty
+ * @param class1
+ * @return
+ * @throws CustomizationException
+ */
+ @Override
+ public <T> List<T> getCustomValuesOf(EObject eObject, FacetOperation customizationProperty, Class<T> classs) throws CustomizationException {
+ List<T> result = null;
+ try {
+ result = this.facetManager.getOrInvokeMultiValued(eObject, customizationProperty, classs);
+ } catch (final Exception e) {
+ throw new CustomizationException(e);
+ }
+ return result;
+ }
}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/.classpath index 2d1a4302f04..b862a296d38 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/.classpath +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/.classpath @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?>
<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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/.settings/org.eclipse.jdt.core.prefs index 4759947300a..62a08f4494d 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/.settings/org.eclipse.jdt.core.prefs @@ -1,10 +1,10 @@ eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/META-INF/MANIFEST.MF index 40375517a3a..e895e11360e 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/META-INF/MANIFEST.MF +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/META-INF/MANIFEST.MF @@ -25,4 +25,4 @@ Bundle-Name: %Bundle-Name Bundle-Activator: org.eclipse.papyrus.emf.facet.custom.ui.internal.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.custom.ui;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet index 0399612b056..93197289336 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet @@ -307,6 +307,26 @@ <query
xsi:type="query:FalseLiteralQuery"/>
</facetOperations>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.emf.facet.custom.ui.internal.query.DefaultVisibleReferencesQuery"/>
+ </facetOperations>
+ <facetOperations
+ name="visibleAttributes"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EAttribute"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.emf.facet.custom.ui.internal.query.DefaultVisibleAttributesQuery"/>
+ </facetOperations>
</eClassifiers>
<eClassifiers
xsi:type="efacet:Facet"
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/IContentPropertiesHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/IContentPropertiesHandler.java index 1215c4bbfd7..6ae256b8abf 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/IContentPropertiesHandler.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/IContentPropertiesHandler.java @@ -21,7 +21,34 @@ import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperati * @noimplement This interface is not intended to be implemented by clients.
*/
public interface IContentPropertiesHandler {
+
+ /**
+ * The isVisible customization operation
+ *
+ * Since Papyrus 1.2.0, this operation is only used for Objects (Not Features)
+ *
+ * @return
+ */
FacetOperation getIsVisible();
+ /**
+ * Return the collapseLink customization operation
+ *
+ * @return
+ */
public FacetOperation getCollapseLink();
+
+ /**
+ * Return the getVisibleAttributes customization operation
+ *
+ * @return
+ */
+ public FacetOperation getVisibleAttributes();
+
+ /**
+ * Return the getVisibleReferences customization operation
+ *
+ * @return
+ */
+ public FacetOperation getVisibleReferences();
}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedTreeContentProvider.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedTreeContentProvider.java index c6e86d7115a..73052bca244 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedTreeContentProvider.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedTreeContentProvider.java @@ -30,7 +30,6 @@ 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.emf.ecore.ETypedElement; import org.eclipse.jface.viewers.Viewer; import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager; import org.eclipse.papyrus.emf.facet.custom.core.exception.CustomizationException; @@ -140,6 +139,7 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv return result; } + @Override public Object[] getElements(final Object inputElement) { // Reconcile the (possibly changed) list of root elements with our tree element proxies @@ -161,7 +161,7 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv } for (final Object element : elements) { - if (!isVisible(element, null)) { + if (!isVisible(element)) { continue; } @@ -189,6 +189,7 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv return eObjectProxy; } + @Override public Object[] getChildren(final Object parentElement) { Object[] result; if (parentElement == null) { @@ -320,6 +321,7 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv return children; } + @Override public Object getParent(final Object element) { Object result = null; if (element instanceof TreeElement) { @@ -329,28 +331,31 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv return result; } + @Override public boolean hasChildren(final Object element) { return getChildren(element).length > 0; } + @Override public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) { if (oldInput != newInput) { cache.clear(); } } + @Override public ICustomizationManager getCustomizationManager() { return this.customManager; } - public boolean isVisible(final Object object, final ETypedElement eTypedElement) { + public boolean isVisible(final Object object) { Boolean result = Boolean.TRUE; if (object instanceof EObject) { final EObject eObject = (EObject) object; try { - result = this.customManager.getCustomValueOf(eObject, eTypedElement, this.contentHandler.getIsVisible(), Boolean.class); + result = this.customManager.getCustomValueOf(eObject, this.contentHandler.getIsVisible(), Boolean.class); } catch (final CustomizationException e) { Logger.logError(e, Activator.getDefault()); } @@ -376,7 +381,7 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv private void createReferences(final EObjectTreeElement treeElement, Collection<EStructuralFeature> facetFeatures, Collection<Object> children) { final EObject eObject = treeElement.getEObject(); - for (EReference next : eObject.eClass().getEAllReferences()) { + for (EReference next : getVisibleReferences(eObject)) { createReference(treeElement, eObject, next, children); } for (EStructuralFeature next : facetFeatures) { @@ -387,26 +392,24 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv } private void createReference(EObjectTreeElement treeElement, EObject eObject, EReference eReference, Collection<Object> children) { - if (isVisible(eObject, eReference)) { - if (collapseLink(eObject, eReference)) { - if (eReference.getUpperBound() != 1) { - collectMultiValuedReferenceChildren(eReference, eObject, treeElement, children); - } else { - Object child = getSingleValuedReferenceChild(eReference, eObject, treeElement); - if (child != null) { - children.add(child); - } - } + if (collapseLink(eObject, eReference)) { + if (eReference.getUpperBound() != 1) { + collectMultiValuedReferenceChildren(eReference, eObject, treeElement, children); } else { - children.add(getEReferenceProxy(eReference, treeElement)); + Object child = getSingleValuedReferenceChild(eReference, eObject, treeElement); + if (child != null) { + children.add(child); + } } + } else { + children.add(getEReferenceProxy(eReference, treeElement)); } } private void createAttributes(final EObjectTreeElement treeElement, Collection<EStructuralFeature> facetFeatures, Collection<? super TreeElement> children) { final EObject eObject = treeElement.getEObject(); - for (EAttribute next : eObject.eClass().getEAllAttributes()) { + for (EAttribute next : getVisibleAttributes(eObject)) { createAttribute(treeElement, eObject, next, children); } for (EStructuralFeature next : facetFeatures) { @@ -416,36 +419,48 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv } } + private List<EAttribute> getVisibleAttributes(EObject eObject) { + List<EAttribute> result = null; + try { + result = this.customManager.getCustomValuesOf(eObject, this.contentHandler.getVisibleAttributes(), EAttribute.class); + } catch (final CustomizationException e) { + Logger.logError(e, Activator.getDefault()); + } + + return result == null ? Collections.emptyList() : result; + } + + private List<EReference> getVisibleReferences(EObject eObject) { + List<EReference> result = null; + try { + result = this.customManager.getCustomValuesOf(eObject, this.contentHandler.getVisibleReferences(), EReference.class); + } catch (final CustomizationException e) { + Logger.logError(e, Activator.getDefault()); + } + + return result == null ? Collections.emptyList() : result; + } + private void createAttribute(EObjectTreeElement treeElement, EObject eObject, EAttribute eAttribute, Collection<? super TreeElement> children) { - if (isVisible(eObject, eAttribute)) { - TreeElement eAttributeTreeElement = getEAttributeProxy(eAttribute, treeElement); - if (eAttributeTreeElement != null) { - children.add(eAttributeTreeElement); - } + TreeElement eAttributeTreeElement = getEAttributeProxy(eAttribute, treeElement); + if (eAttributeTreeElement != null) { + children.add(eAttributeTreeElement); } } private EReferenceTreeElement createReferenceProxy(final EReference reference, final EObjectTreeElement parent) { - final EObject eObject = parent.getEObject(); - if (isVisible(eObject, reference)) { - final EReferenceTreeElement referenceProxy = TreeproxyFactory.eINSTANCE.createEReferenceTreeElement(); - referenceProxy.setEReference(reference); - referenceProxy.setParent(parent); - return referenceProxy; - } - return null; + final EReferenceTreeElement referenceProxy = TreeproxyFactory.eINSTANCE.createEReferenceTreeElement(); + referenceProxy.setEReference(reference); + referenceProxy.setParent(parent); + return referenceProxy; } private EAttributeTreeElement createAttributeProxy(final EAttribute attribute, final EObjectTreeElement parent) { - final EObject eObject = parent.getEObject(); - if (isVisible(eObject, attribute)) { - final EAttributeTreeElement attributeProxy = TreeproxyFactory.eINSTANCE.createEAttributeTreeElement(); - attributeProxy.setEAttribute(attribute); - attributeProxy.setParent(parent); - return attributeProxy; - } - return null; + final EAttributeTreeElement attributeProxy = TreeproxyFactory.eINSTANCE.createEAttributeTreeElement(); + attributeProxy.setEAttribute(attribute); + attributeProxy.setParent(parent); + return attributeProxy; } private Object getSingleValuedReferenceChild(final EReference eReference, final EObject eObject, final TreeElement parent) { @@ -502,6 +517,7 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv return (EReferenceTreeElement) cache.get(cacheElement); } + @Override public void dispose() { cache.clear(); rootElements = null; diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/PropertiesHandler.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/PropertiesHandler.java index 482e8939219..a33fef2cef2 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/PropertiesHandler.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/PropertiesHandler.java @@ -52,6 +52,8 @@ public class PropertiesHandler implements IContentPropertiesHandler, private static final String IS_ITALIC = "isItalic"; //$NON-NLS-1$
private static final String COLLAPSE_LINK = "collapseLink"; //$NON-NLS-1$
private static final String IS_VISIBLE = "isVisible"; //$NON-NLS-1$
+ private static final String VISIBLE_REFERENCES = "visibleReferences"; //$NON-NLS-1$
+ private static final String VISIBLE_ATTRIBUTES = "visibleAttributes"; //$NON-NLS-1$
private static final String IS_UNDERLINED = "isUnderlined"; //$NON-NLS-1$
private static final String IS_STRUCKTHROUGH = "isStruckthrough"; //$NON-NLS-1$
private static final String TOP_L_OVERLAY = "topLeftOverlay"; //$NON-NLS-1$
@@ -126,56 +128,67 @@ public class PropertiesHandler implements IContentPropertiesHandler, }
+ @Override
public FacetOperation getCollapseLink() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.COLLAPSE_LINK);
}
+ @Override
public FacetOperation getLabelProperty() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.LABEL);
}
+ @Override
public FacetOperation getBackgroundProperty() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.BACKGROUND);
}
+ @Override
public FacetOperation getForegroundProperty() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.FOREGROUND);
}
+ @Override
public FacetOperation getFontNameProperty() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.FONT);
}
+ @Override
public FacetOperation getFontSizeProperty() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.FONT_SIZE);
}
+ @Override
public FacetOperation getIsBoldProperty() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.IS_BOLD);
}
+ @Override
public FacetOperation getIsItalicProperty() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.IS_ITALIC);
}
+ @Override
public FacetOperation getIsVisible() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.IS_VISIBLE);
}
+ @Override
public FacetOperation getIsUnderlinedProperty() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.IS_UNDERLINED);
}
+ @Override
public FacetOperation getIsStruckthroughProperty() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.IS_STRUCKTHROUGH);
@@ -211,6 +224,7 @@ public class PropertiesHandler implements IContentPropertiesHandler, PropertiesHandler.BOTTOM_R_OVERLAY);
}
+ @Override
public FacetOperation getSelectionProperty() {
return getPropertyByName(PropertiesHandler.CUSTOM,
PropertiesHandler.SELECTION);
@@ -306,4 +320,26 @@ public class PropertiesHandler implements IContentPropertiesHandler, return getPropertyByName(PropertiesHandler.TT_CUSTOM,
PropertiesHandler.SHADOW);
}
+
+ /**
+ * @see org.eclipse.papyrus.emf.facet.custom.ui.IContentPropertiesHandler#getVisibleAttributes()
+ *
+ * @return
+ */
+ @Override
+ public FacetOperation getVisibleAttributes() {
+ return getPropertyByName(PropertiesHandler.CUSTOM,
+ PropertiesHandler.VISIBLE_ATTRIBUTES);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.emf.facet.custom.ui.IContentPropertiesHandler#getVisibleReferences()
+ *
+ * @return
+ */
+ @Override
+ public FacetOperation getVisibleReferences() {
+ return getPropertyByName(PropertiesHandler.CUSTOM,
+ PropertiesHandler.VISIBLE_REFERENCES);
+ }
}
\ No newline at end of file diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/query/DefaultVisibleAttributesQuery.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/query/DefaultVisibleAttributesQuery.java new file mode 100644 index 00000000000..68912cf4308 --- /dev/null +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/query/DefaultVisibleAttributesQuery.java @@ -0,0 +1,46 @@ +/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.emf.facet.custom.ui.internal.query; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EObject; +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; + +/** + * @author Camille Letavernier + * + */ +public class DefaultVisibleAttributesQuery implements IJavaQuery2<EObject, List<EAttribute>> { + + /** + * @see org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2#evaluate(org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2, org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager) + * + * @param source + * @param parameterValues + * @param facetManager + * @return + * @throws DerivedTypedElementException + */ + @Override + public List<EAttribute> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException { + return Collections.emptyList(); + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/query/DefaultVisibleReferencesQuery.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/query/DefaultVisibleReferencesQuery.java new file mode 100644 index 00000000000..c224ee07c8e --- /dev/null +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/query/DefaultVisibleReferencesQuery.java @@ -0,0 +1,60 @@ +/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.emf.facet.custom.ui.internal.query; + +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +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; + +/** + * @author Camille Letavernier + * + */ +public class DefaultVisibleReferencesQuery implements IJavaQuery2<EObject, List<EReference>> { + + /** + * @see org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2#evaluate(org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2, org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager) + * + * @param source + * @param parameterValues + * @param facetManager + * @return + * @throws DerivedTypedElementException + */ + @Override + public List<EReference> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException { + return source.eClass().getEAllReferences().stream().filter( + ref -> !isEmpty(ref, source) // + ).collect(Collectors.toList()); + } + + private boolean isEmpty(EReference reference, EObject source) { + Object value = source.eGet(reference); + if (value == null) { + return true; + } + if (value instanceof Collection) { + return ((Collection<?>) value).isEmpty(); + } + return false; + } + +} diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.classpath index 45f024e850e..b862a296d38 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.classpath +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.classpath @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.jdt.core.prefs index 73da3815343..a0d51c8b4db 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/.settings/org.eclipse.jdt.core.prefs @@ -1,14 +1,14 @@ eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/META-INF/MANIFEST.MF index dd68c13fe81..dc10e6b24d9 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/META-INF/MANIFEST.MF +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.core/META-INF/MANIFEST.MF @@ -23,4 +23,4 @@ Bundle-Name: %Bundle-Name Bundle-Activator: org.eclipse.papyrus.emf.facet.efacet.core.internal.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.efacet.core;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.ui/src/org/eclipse/papyrus/emf/facet/efacet/ui/internal/view/FacetUIUtils.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.ui/src/org/eclipse/papyrus/emf/facet/efacet/ui/internal/view/FacetUIUtils.java new file mode 100644 index 00000000000..467b04019a3 --- /dev/null +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.ui/src/org/eclipse/papyrus/emf/facet/efacet/ui/internal/view/FacetUIUtils.java @@ -0,0 +1,109 @@ +/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST and others.
+ *
+ * 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.emf.facet.efacet.ui.internal.view;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.emf.facet.efacet.core.IFacetSetCatalogManagerFactory;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+
+/**
+ * @author Camille Letavernier
+ *
+ */
+//Moved from FacetUtils to clarify
+public class FacetUIUtils {
+
+ /**
+ * This methods returns all the known (registered) eTypedElements.
+ *
+ * @param resourceSet
+ * the eTypedElement search will be done in/using this resourceSet
+ * @return all the known (registered) eTypedElements
+ */
+ public static Set<? extends ETypedElement> getETypedElements(
+ final ResourceSet resourceSet) {
+ final Set<ETypedElement> result = new HashSet<ETypedElement>();
+ final Collection<Object> ePackages = EPackage.Registry.INSTANCE
+ .values();
+ for (Object object : ePackages) {
+ EPackage ePackage = null;
+ if (object instanceof EPackage) {
+ ePackage = (EPackage) object;
+ } else if (object instanceof EPackage.Descriptor) {
+ final EPackage.Descriptor descriptor = (EPackage.Descriptor) object;
+ ePackage = descriptor.getEPackage();
+ }
+ if (ePackage != null) {
+ result.addAll(getETypedElements(ePackage));
+ }
+ }
+ result.addAll(getFacetETypedElements(resourceSet));
+ return result;
+ }
+
+ /**
+ * @since 0.3
+ */
+ public static Set<? extends ETypedElement> getFacetETypedElements(
+ final ResourceSet resourceSet) {
+ final Set<ETypedElement> result = new HashSet<ETypedElement>();
+ final Collection<FacetSet> facetSets = IFacetSetCatalogManagerFactory.DEFAULT
+ .getOrCreateFacetSetCatalogManager(resourceSet)
+ .getRegisteredFacetSets();
+ for (FacetSet facetSet : facetSets) {
+ result.addAll(getETypedElements(facetSet));
+ }
+ return result;
+ }
+
+ public static List<ETypedElement> getETypedElements(final EPackage ePackage) {
+ final List<ETypedElement> result = new ArrayList<ETypedElement>();
+ for (EClassifier eClassifier : ePackage.getEClassifiers()) {
+ result.addAll(getETypedElements(eClassifier));
+ }
+ for (EPackage subPackage : ePackage.getESubpackages()) {
+ result.addAll(getETypedElements(subPackage));
+ }
+ return result;
+ }
+
+ /**
+ * @since 0.3
+ */
+ public static List<ETypedElement> getETypedElements(
+ final EClassifier eClassifier) {
+ final List<ETypedElement> result = new ArrayList<ETypedElement>();
+ if (eClassifier instanceof Facet) {
+ final Facet facet = (Facet) eClassifier;
+ result.addAll(facet.getFacetElements());
+ result.addAll(facet.getFacetOperations());
+ } else if (eClassifier instanceof EClass) {
+ final EClass eClass = (EClass) eClassifier;
+ result.addAll(eClass.getEAllStructuralFeatures());
+ result.addAll(eClass.getEAllOperations());
+ }
+ return result;
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.ui/src/org/eclipse/papyrus/emf/facet/efacet/ui/internal/view/NavigationView.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.ui/src/org/eclipse/papyrus/emf/facet/efacet/ui/internal/view/NavigationView.java index 4704beeb09c..ddf7256cd5d 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.ui/src/org/eclipse/papyrus/emf/facet/efacet/ui/internal/view/NavigationView.java +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.ui/src/org/eclipse/papyrus/emf/facet/efacet/ui/internal/view/NavigationView.java @@ -252,7 +252,7 @@ public class NavigationView extends ViewPart implements INavigationView { final GridLayout groupLayout = new GridLayout();
queryGroup.setLayout(groupLayout);
final Collection<ETypedElement> eTypedElements = new ArrayList<ETypedElement>(
- FacetUtils.getETypedElements(getResourceSet()));
+ FacetUIUtils.getETypedElements(getResourceSet()));
final Collection<? extends EObject> knownEPackages = IFacetSetCatalogManagerFactory.DEFAULT
.getOrCreateFacetSetCatalogManager(this.getResourceSet())
.getRegisteredFacetSets();
@@ -264,7 +264,7 @@ public class NavigationView extends ViewPart implements INavigationView { getCustomizationManager(),
knownEPackages);
this.navSelection.setAvailableETypedElements(eTypedElements);
- }
+ }
private void createContextGroup(final Composite parent) {
final Group contextGroup = new Group(parent, SWT.NONE);
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.classpath index 2d1a4302f04..b862a296d38 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.classpath +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.classpath @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?>
<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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.settings/org.eclipse.jdt.core.prefs index 4759947300a..62a08f4494d 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/.settings/org.eclipse.jdt.core.prefs @@ -1,10 +1,10 @@ eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/META-INF/MANIFEST.MF index 620bacf0b36..a1cd783babc 100644 --- a/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/META-INF/MANIFEST.MF +++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.core/META-INF/MANIFEST.MF @@ -18,4 +18,4 @@ Bundle-Name: %Bundle-Name Bundle-Activator: org.eclipse.papyrus.emf.facet.query.java.core.internal.plugin.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.query.java.core;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java index 7a42d4e8eb0..addfeb98d2b 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/utils/DiagramUtils.java @@ -14,7 +14,6 @@ *****************************************************************************/ package org.eclipse.papyrus.infra.gmfdiag.common.utils; -import java.util.Collection; import java.util.Collections; import java.util.LinkedList; import java.util.List; @@ -81,9 +80,8 @@ public class DiagramUtils { * @return The diagram's owner */ public static EObject getOwner(Diagram diagram) { - Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE); - if (style != null) { - PapyrusViewStyle pvs = (PapyrusViewStyle) style; + PapyrusViewStyle pvs = getPapyrusViewStyle(diagram); + if (pvs != null) { EObject value = pvs.getOwner(); if (value != null) { return value; @@ -102,71 +100,84 @@ public class DiagramUtils { * The new diagram's owner */ public static void setOwner(Diagram diagram, EObject owner) { - Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE); - if (style != null) { - PapyrusViewStyle pvs = (PapyrusViewStyle) style; + PapyrusViewStyle pvs = getPapyrusViewStyle(diagram); + if (pvs != null) { pvs.setOwner(owner); } else { - PapyrusViewStyle pvs = (PapyrusViewStyle) diagram.createStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE); + pvs = (PapyrusViewStyle) diagram.createStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE); pvs.setOwner(owner); } } /** + * Returns the PapyrusViewStyle owned by this diagram (if any) + * + * @param diagram + * @return + */ + public static final PapyrusViewStyle getPapyrusViewStyle(Diagram diagram) { + for (Style ownedStyle : (List<Style>) diagram.getStyles()) { // Access all styles directly to avoid CSS computation, and use instanceof (Rather than reflexive EMF) + if (ownedStyle instanceof PapyrusViewStyle) { + return (PapyrusViewStyle) ownedStyle; + } + } + return null; + } + + /** * Gets the prototype of a diagram - * Check if the selected viewpoint contains - * 1. the diagram model kind - * 2. an ancestor of the diagram model kind - * 3. a descendant of the diagram model kind - * + * Check if the selected viewpoint contains + * 1. the diagram model kind + * 2. an ancestor of the diagram model kind + * 3. a descendant of the diagram model kind + * * @param diagram * A diagram * @return The diagram's prototype */ public static ViewPrototype getPrototype(Diagram diagram) { - Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE); - if (style != null && style instanceof PapyrusViewStyle) { - PapyrusViewStyle pvs = (PapyrusViewStyle) style; + PapyrusViewStyle pvs = getPapyrusViewStyle(diagram); + if (pvs != null) { PapyrusView diagramConfig = pvs.getConfiguration(); - - // Check if the selected viewpoint contains the diagram model kind + + // Check if the selected viewpoint contains the diagram model kind if (diagramConfig != null) { if (PolicyChecker.getCurrent().isInViewpoint(diagramConfig)) { - return ViewPrototype.get(diagramConfig); + return ViewPrototype.get(diagramConfig); } - - // Check if the selected viewpoint contains an ancestor of the diagram model kind + + // Check if the selected viewpoint contains an ancestor of the diagram model kind PapyrusView diagramParentView = diagramConfig.getParent(); while (diagramParentView != null && !PolicyChecker.getCurrent().isInViewpoint(diagramParentView)) { diagramParentView = diagramParentView.getParent(); } - if (diagramParentView != null){ + if (diagramParentView != null) { return ViewPrototype.get(diagramParentView); } - - // Check if the selected viewpoint contains a descendant of the diagram model kind + + // Check if the selected viewpoint contains a descendant of the diagram model kind String diagramConfigName = diagramConfig.getName(); - if (diagramConfigName!= null){ // the model kind name is used as a "semantic" key to test equality + if (diagramConfigName != null) { // the model kind name is used as a "semantic" key to test equality EList<ModelKind> modelKinds = PolicyChecker.getCurrent().getViewpoint().getModelKinds(); for (ModelKind modelKind : modelKinds) { - if (modelKind instanceof PapyrusView){ + if (modelKind instanceof PapyrusView) { PapyrusView papyrusView = (PapyrusView) modelKind; - + if (diagramConfigName.equals(papyrusView.getName())) { ViewPrototype.get(papyrusView); } - + PapyrusView parentPapyrusView = papyrusView.getParent(); while (parentPapyrusView != null && !diagramConfigName.equals(parentPapyrusView.getName())) { parentPapyrusView = parentPapyrusView.getParent(); } - if (parentPapyrusView != null){ + if (parentPapyrusView != null) { return ViewPrototype.get(papyrusView); } } - } + } } - + } return ViewPrototype.get(diagram.getType(), pvs.getOwner(), diagram.getElement()); @@ -191,12 +202,11 @@ public class DiagramUtils { * The new diagram's prototype */ public static void setPrototype(Diagram diagram, ViewPrototype prototype) { - Style style = diagram.getStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE); - if (style != null) { - PapyrusViewStyle pvs = (PapyrusViewStyle) style; + PapyrusViewStyle pvs = getPapyrusViewStyle(diagram); + if (pvs != null) { pvs.setConfiguration(prototype.getConfiguration()); } else { - PapyrusViewStyle pvs = (PapyrusViewStyle) diagram.createStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE); + pvs = (PapyrusViewStyle) diagram.createStyle(StylePackage.Literals.PAPYRUS_VIEW_STYLE); pvs.setConfiguration(prototype.getConfiguration()); } } 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 bc4c1539533..c6446db5d4b 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 @@ -1,57 +1,106 @@ <?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" documentation="Display contained diagram and their icons" mustBeLoadedByDefault="true" rank="1">
- <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"/>
+<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"
+ documentation="Display contained diagram and their icons"
+ mustBeLoadedByDefault="true"
+ rank="1">
+ <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="eStructuralFeature">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
</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"/>
+ <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
+ name="GetVisibleReferences"
+ upperBound="-1"
+ documentation="Return the list of visible references (Hide everything)">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries.EmptyListQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
</eClassifiers>
- <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"/>
+ <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="//DiagramContainer.1/DiagramsRefContent"/>
+ <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="//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"/>
- <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
+ 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 -->
- <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"/>
+ <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/EmptyListQuery.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/EmptyListQuery.java new file mode 100644 index 00000000000..25f2721ac63 --- /dev/null +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/src/org/eclipse/papyrus/infra/gmfdiag/modelexplorer/queries/EmptyListQuery.java @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.gmfdiag.modelexplorer.queries; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +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; + +/** + * @author Camille Letavernier + * + */ +public class EmptyListQuery implements IJavaQuery2<EObject, List<Object>> { + + /** + * @see org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2#evaluate(org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2, org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager) + * + * @param source + * @param parameterValues + * @param facetManager + * @return + * @throws DerivedTypedElementException + */ + public List<Object> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException { + return Collections.emptyList(); + } + +} 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 index 65b116ae2c8..a19b5ddd8d3 100644 --- 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 @@ -20,11 +20,16 @@ import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterVal import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; +/** + * + * @deprecated Since Papyrus 1.2.0: Bug 485539. + */ +@Deprecated public class NotVisibleStructuralFeatureQuery implements IJavaQuery2<Diagram, Boolean> { public Boolean evaluate(final Diagram context, final IParameterValueList2 parameterValues, final IFacetManager facetManager) - throws DerivedTypedElementException { + throws DerivedTypedElementException { ParameterValue parameterValue = parameterValues.getParameterValueByName("eStructuralFeature"); EStructuralFeature eStructuralFeature = (EStructuralFeature) parameterValue.getValue(); // if eStructural feature ==null this is root model explorer. diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/.classpath b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/.classpath index 9070d33ae66..ad32c83a788 100644 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/.classpath +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/.classpath @@ -1,8 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> - <classpathentry exported="true" kind="lib" path="bin" sourcepath="bin"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/.settings/org.eclipse.jdt.core.prefs index f08be2b06c4..94d61f00da6 100644 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/.settings/org.eclipse.jdt.core.prefs @@ -1,10 +1,10 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.6 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 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 0d4f07f3d5b..9c049b82753 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 @@ -5,8 +5,7 @@ Export-Package: org.eclipse.papyrus.infra.nattable.modelexplorer, org.eclipse.papyrus.infra.nattable.modelexplorer.providers,
org.eclipse.papyrus.infra.nattable.modelexplorer.queries
Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .,
- bin
+Bundle-ClassPath: .
Bundle-Name: %Bundle-Name
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.ui,
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 d04b67ceace..ae104ad5fa3 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 @@ -1,56 +1,103 @@ <?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="PapyrusTable" documentation="Display contained table and their icons" mustBeLoadedByDefault="true">
- <eClassifiers xsi:type="custom:EClassCustomization" name="Table" documentation="Representation of table in model explorer">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
- <facetOperations name="GetTableIcon" documentation="Return the path to the icon of the corresponding table">
- <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"/>
+<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="PapyrusTable"
+ documentation="Display contained table and their icons"
+ mustBeLoadedByDefault="true">
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="Table"
+ documentation="Representation of table in model explorer">
+ <extendedMetaclass
+ href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
+ <facetOperations
+ name="GetTableIcon"
+ documentation="Return the path to the icon of the corresponding table">
+ <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.nattable.modelexplorer.queries.GetTableIcon"/>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/image"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.GetTableIcon"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/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.nattable.modelexplorer.queries.NotVisibleStructuralFeatureQuery"/>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <facetOperations
+ name="visibleReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.EmptyListQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
</eClassifiers>
- <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"/>
+ <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="//TableContainer.1/TablesRefContent"/>
+ <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="//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.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">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
- <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.GetContainedTables"/>
+ <facetOperations
+ name="TablesRefContent"
+ upperBound="-1"
+ documentation="Get the collection of all contained tables">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.GetContainedTables"/>
</facetOperations>
- <!-- facetOperations name="TablesRefCollapse">
- <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.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"/>
+ <customizedFacet
+ href="platform:/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/EmptyListQuery.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/EmptyListQuery.java new file mode 100644 index 00000000000..daebd204495 --- /dev/null +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/EmptyListQuery.java @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.nattable.modelexplorer.queries; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +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; + +/** + * @author Camille Letavernier + * + */ +public class EmptyListQuery implements IJavaQuery2<EObject, List<Object>> { + + /** + * @see org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2#evaluate(org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2, org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager) + * + * @param source + * @param parameterValues + * @param facetManager + * @return + * @throws DerivedTypedElementException + */ + public List<Object> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException { + return Collections.emptyList(); + } + +} diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java index be6eec2772c..a202b2a772e 100755 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java @@ -19,12 +19,17 @@ 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; +/** + * + * @deprecated Since Papyrus 1.2.0: Bug 485539. + */ +@Deprecated public class NotVisibleStructuralFeatureQuery implements IJavaQuery2<Table, Boolean> { @Override public Boolean evaluate(final Table context, final IParameterValueList2 parameterValues, final IFacetManager facetManager) - throws DerivedTypedElementException { + throws DerivedTypedElementException { ParameterValue parameterValue = parameterValues.getParameterValueByName("eStructuralFeature"); EStructuralFeature eStructuralFeature = (EStructuralFeature) parameterValue.getValue(); // if eStructural feature ==null this is root model explorer. 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 b6e30a3c628..46123c6914f 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 @@ -1,30 +1,70 @@ <?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" name="SimpleUML" documentation="Display structure of UML base model" mustBeLoadedByDefault="true" rank="0">
- <eClassifiers xsi:type="custom:EClassCustomization" name="Element">
- <extendedMetaclass href="http://www.eclipse.org/uml2/5.0.0/UML#//Element"/>
- <facetOperations name="DisplayOnlyContainamentReferences">
- <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"/>
+<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="SimpleUML"
+ documentation="Display structure of UML base model"
+ mustBeLoadedByDefault="true"
+ rank="0">
+ <eClassifiers
+ xsi:type="custom:EClassCustomization"
+ name="Element">
+ <extendedMetaclass
+ href="http://www.eclipse.org/uml2/5.0.0/UML#//Element"/>
+ <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="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.DisplayUMLStructuralFeature"/>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.uml.modelexplorer.queries.GetImageQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/image"/>
</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="eObject">
- <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <facetOperations
+ name="CollapseContaimentRef">
+ <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.uml.modelexplorer.queries.GetImageQuery"/>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/image"/>
+ <query
+ xsi:type="query:TrueLiteralQuery"
+ canBeCached="true"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
</facetOperations>
- <facetOperations name="CollapseContaimentRef">
- <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.uml.modelexplorer.queries.DisplayUMLStructuralFeature"/>
- <override xsi:type="efacet:FacetOperation" href="../../../plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/collapseLink"/>
+ <facetOperations
+ name="DisplayOnlyContainmentReferences"
+ upperBound="-1">
+ <eType
+ xsi:type="ecore:EClass"
+ href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+ <query
+ xsi:type="javaQuery:JavaQuery"
+ implementationClassName="org.eclipse.papyrus.uml.modelexplorer.queries.GetVisibleUMLReferencesQuery"/>
+ <override
+ xsi:type="efacet:FacetOperation"
+ href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/visibleReferences"/>
</facetOperations>
</eClassifiers>
</custom:Customization>
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/DisplayUMLStructuralFeature.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/DisplayUMLStructuralFeature.java index 0f80ebdcffb..af9eb19e265 100644 --- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/DisplayUMLStructuralFeature.java +++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/DisplayUMLStructuralFeature.java @@ -28,7 +28,8 @@ import org.eclipse.uml2.uml.UMLPackage; /** * this query is used to return false, if the given object is a references that is not containment or if it is a attribute. * it return true if the the feature is also a facetReferences - * + * @deprecated Since Papyrus 1.2.0 (Bug 485539), the isVisible query is not used for Features anymore. + * Use {@link GetVisibleReferencesQuery} instead */ public class DisplayUMLStructuralFeature extends IsContainmentStructuralFeature implements IJavaQuery2<EObject, Boolean> { @Override diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetVisibleUMLReferencesQuery.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetVisibleUMLReferencesQuery.java new file mode 100644 index 00000000000..13a429017d4 --- /dev/null +++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/queries/GetVisibleUMLReferencesQuery.java @@ -0,0 +1,70 @@ +/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.uml.modelexplorer.queries; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +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.IParameterValueList2; +import org.eclipse.papyrus.views.modelexplorer.queries.GetVisibleReferencesQuery; +import org.eclipse.uml2.uml.ElementImport; +import org.eclipse.uml2.uml.PackageImport; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * @author Camille Letavernier + * + */ +public class GetVisibleUMLReferencesQuery extends GetVisibleReferencesQuery { + + private static final Set<EReference> excludedReferences = getExcludedReferences(); + + private static final Set<EReference> getExcludedReferences() { + Set<EReference> result = new HashSet<>(); + result.add(UMLPackage.Literals.MULTIPLICITY_ELEMENT__LOWER_VALUE); + result.add(UMLPackage.Literals.MULTIPLICITY_ELEMENT__UPPER_VALUE); + result.add(UMLPackage.Literals.PACKAGE__PROFILE_APPLICATION); + result.add(UMLPackage.Literals.BEHAVIOR__POSTCONDITION); + result.add(UMLPackage.Literals.BEHAVIOR__PRECONDITION); + result.add(UMLPackage.Literals.OPERATION__BODY_CONDITION); + return result; + } + + /** + * @see org.eclipse.papyrus.views.modelexplorer.queries.GetVisibleReferencesQuery#evaluate(org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2, org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager) + * + * @param source + * @param parameterValues + * @param facetManager + * @return + * @throws DerivedTypedElementException + */ + @Override + public List<EReference> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException { + List<EReference> result = new ArrayList<EReference>(super.evaluate(source, parameterValues, facetManager)); + if (source instanceof PackageImport) { + result.add(UMLPackage.Literals.PACKAGE_IMPORT__IMPORTED_PACKAGE); + } else if (source instanceof ElementImport) { + result.add(UMLPackage.Literals.ELEMENT_IMPORT__IMPORTED_ELEMENT); + } + result.removeAll(excludedReferences); + return result; + } +} diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/GetVisibleReferencesQuery.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/GetVisibleReferencesQuery.java new file mode 100644 index 00000000000..c6bae2725e8 --- /dev/null +++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/GetVisibleReferencesQuery.java @@ -0,0 +1,61 @@ +/***************************************************************************** + * Copyright (c) 2016 CEA LIST and others. + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.views.modelexplorer.queries; + +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EcorePackage; +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; + +/** + * @author Camille Letavernier + * + */ +public class GetVisibleReferencesQuery implements IJavaQuery2<EObject, List<EReference>> { + + /** + * @see org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2#evaluate(org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2, org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager) + * + * @param source + * @param parameterValues + * @param facetManager + * @return + * @throws DerivedTypedElementException + */ + @Override + public List<EReference> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException { + return source.eClass().getEAllReferences().stream().filter( + ref -> ref != EcorePackage.Literals.EMODEL_ELEMENT__EANNOTATIONS && ref.isContainment() && !isEmpty(ref, source) // + ).collect(Collectors.toList()); + } + + private boolean isEmpty(EReference reference, EObject source) { + Object value = source.eGet(reference); + if (value == null) { + return true; + } + if (value instanceof Collection) { + return ((Collection<?>) value).isEmpty(); + } + return false; + } + +} diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsContainmentStructuralFeature.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsContainmentStructuralFeature.java index e96fa3a6ec9..b749c7be8e0 100644 --- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsContainmentStructuralFeature.java +++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/queries/IsContainmentStructuralFeature.java @@ -28,12 +28,15 @@ import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; * this query is used to return false, if the given object is a references that is not containment or if it is a attribute. * it return true if the the feature is also a facetReferences * + * @deprecated Since Papyrus 1.2.0 (Bug 485539), the isVisible query is not used for Features anymore. + * Use {@link GetVisibleReferencesQuery} instead + * */ +@Deprecated public class IsContainmentStructuralFeature implements IJavaQuery2<EObject, Boolean> { - public Boolean evaluate(final EObject context, - final IParameterValueList2 parameterValues, - final IFacetManager facetManager) - throws DerivedTypedElementException { + + @Override + public Boolean evaluate(final EObject context, final IParameterValueList2 parameterValues, final IFacetManager facetManager) throws DerivedTypedElementException { ParameterValue parameterValue = parameterValues.getParameterValueByName("eStructuralFeature"); EStructuralFeature eStructuralFeature = (EStructuralFeature) parameterValue.getValue(); // if eStructural feature ==null this is root model explorer. @@ -41,19 +44,15 @@ public class IsContainmentStructuralFeature implements IJavaQuery2<EObject, Bool if (eStructuralFeature == null) { return true; } - // This is an UML element? + // This is a UML element? if (context instanceof EObject) { // the eStructure is a containmentReference or Facet Reference? if (eStructuralFeature instanceof EReference) { - if (((EReference) eStructuralFeature).equals(EcorePackage.eINSTANCE.getEModelElement_EAnnotations())) { - return false; - } - if (((EReference) (eStructuralFeature)).isContainment() || (eStructuralFeature instanceof FacetReference)) { - return true; - } - else { + if (eStructuralFeature == EcorePackage.Literals.EMODEL_ELEMENT__EANNOTATIONS) { return false; } + + return ((EReference) eStructuralFeature).isContainment() || eStructuralFeature instanceof FacetReference; } // this is not a ref like EAttribute else { |