diff options
author | rschnekenbu | 2014-04-15 14:06:23 +0000 |
---|---|---|
committer | rschnekenbu | 2014-04-16 09:18:05 +0000 |
commit | c277ce22b94b8eca96ae2c269a720759d8671494 (patch) | |
tree | 30f1b6c7383b8ebda2af56e63dfd86356eb690cb | |
parent | 32aa7981aec97e876e49fe7b5ae6551ee180fd98 (diff) | |
download | org.eclipse.papyrus-c277ce22b94b8eca96ae2c269a720759d8671494.tar.gz org.eclipse.papyrus-c277ce22b94b8eca96ae2c269a720759d8671494.tar.xz org.eclipse.papyrus-c277ce22b94b8eca96ae2c269a720759d8671494.zip |
432824: [Core] It should be possible to create elements in diagram based
on IExtendedHintedElementTypes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=432824
432828: [Core] Deployment of the palettes should be dependent of the
required profiles
https://bugs.eclipse.org/bugs/show_bug.cgi?id=432828
Change-Id: Idd8371bba3dfd711d73489760c7c1b8d9af69512
Signed-off-by: rschnekenbu <remi.schnekenburger@cea.fr>
29 files changed, 302 insertions, 293 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF index aec0d8c1a2a..9df4b67547a 100644 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF +++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/META-INF/MANIFEST.MF @@ -34,7 +34,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.2",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.2",
org.eclipse.gmf.tooling.runtime;bundle-version="3.1.0",
- org.eclipse.papyrus.infra.tools;bundle-version="0.10.2"
+ org.eclipse.papyrus.infra.tools;bundle-version="0.10.2",
+ org.eclipse.papyrus.infra.extendedtypes;bundle-version="0.10.2"
Export-Package: org.eclipse.papyrus.sysml.diagram.blockdefinition,
org.eclipse.papyrus.sysml.diagram.blockdefinition.command,
org.eclipse.papyrus.sysml.diagram.blockdefinition.dnd.helper,
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src-gen/org/eclipse/papyrus/sysml/diagram/blockdefinition/provider/InheritedClassDiagramViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src-gen/org/eclipse/papyrus/sysml/diagram/blockdefinition/provider/InheritedClassDiagramViewProvider.java index 28e13595dbb..0faa6b9d8c6 100644 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src-gen/org/eclipse/papyrus/sysml/diagram/blockdefinition/provider/InheritedClassDiagramViewProvider.java +++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.blockdefinition/src-gen/org/eclipse/papyrus/sysml/diagram/blockdefinition/provider/InheritedClassDiagramViewProvider.java @@ -28,6 +28,7 @@ import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.gmf.runtime.notation.Node; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry; +import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType; import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLViewProvider; import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter; import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes; @@ -40,23 +41,18 @@ public class InheritedClassDiagramViewProvider extends UMLViewProvider { @Override public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) { Edge createdEdge = null; - IElementType elementType = (IElementType)semanticAdapter.getAdapter(IElementType.class); if(elementType != null) { createdEdge = super.createEdge(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint); } else { - EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class); - String domainElementGraphicalType = semanticHint; if(domainElementGraphicalType == null) { domainElementGraphicalType = registry.getEdgeGraphicalType(domainElement); } - if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownEdgeType(domainElementGraphicalType))) { // Cannot use createEdge from super class as it never take the graphical type (semanticHint) into account. // createdEdge = super.createEdge(semanticAdapter, containerView, domainElementGraphicalType, index, persisted, preferencesHint); - if(ElementTypes.COMMENT_ANNOTATED_ELEMENT.getSemanticHint().equals(domainElementGraphicalType)) { createdEdge = createCommentAnnotatedElement_4013(containerView, index, persisted, preferencesHint); } @@ -65,11 +61,9 @@ public class InheritedClassDiagramViewProvider extends UMLViewProvider { } } } - if(createdEdge == null) { log.error(new Exception("Could not create Edge.")); } - return createdEdge; } @@ -80,24 +74,20 @@ public class InheritedClassDiagramViewProvider extends UMLViewProvider { if(!ElementTypes.DIAGRAM_ID.equals(diagramType)) { return false; } - - throw new UnsupportedOperationException("Should never be called by the "+diagramType+" diagram."); + throw new UnsupportedOperationException("Should never be called by the " + diagramType + " diagram."); } @Override protected boolean provides(CreateEdgeViewOperation op) { - // Must have a container if(op.getContainerView() == null) { return false; } - // This provider is registered for BlockDefinition Diagram only String diagramType = op.getContainerView().getDiagram().getType(); if(!ElementTypes.DIAGRAM_ID.equals(diagramType)) { return false; } - IElementType elementType = getSemanticElementType(op.getSemanticAdapter()); if(elementType == ElementTypes.COMMENT_ANNOTATED_ELEMENT) { return true; @@ -105,11 +95,20 @@ public class InheritedClassDiagramViewProvider extends UMLViewProvider { if(elementType == ElementTypes.CONSTRAINT_CONSTRAINED_ELEMENT) { return true; } - // ///////////////////////////////////////////////////////////////////// // Test possibility to provide a view based on the semantic nature and its expected container. // ///////////////////////////////////////////////////////////////////// - + // IElementType may be an extended type. Check for a view based on this element type + if(elementType instanceof IExtendedHintedElementType) { + EObject domainElement = (EObject)op.getSemanticAdapter().getAdapter(EObject.class); + String domainElementGraphicalType = op.getSemanticHint(); + if(domainElementGraphicalType == null) { + domainElementGraphicalType = registry.getEdgeGraphicalType(domainElement); + } + if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownEdgeType(domainElementGraphicalType))) { + return true; + } + } // IElementType may be null (especially when drop from ModelExplorer). // In such a case, test the semantic EObject instead. if(elementType == null) { @@ -118,12 +117,10 @@ public class InheritedClassDiagramViewProvider extends UMLViewProvider { if(domainElementGraphicalType == null) { domainElementGraphicalType = registry.getEdgeGraphicalType(domainElement); } - if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownEdgeType(domainElementGraphicalType))) { return true; } } - return false; } @@ -135,17 +132,14 @@ public class InheritedClassDiagramViewProvider extends UMLViewProvider { } // Get the type of the container String containerGraphicalType = op.getContainerView().getType(); - // This provider is registered for BlockDefinition Diagram only String diagramType = op.getContainerView().getDiagram().getType(); if(!ElementTypes.DIAGRAM_ID.equals(diagramType)) { return false; } - // ///////////////////////////////////////////////////////////////////// // Test possibility to provide a view based on the ElementType and its expected container. // ///////////////////////////////////////////////////////////////////// - IElementType elementType = (IElementType)op.getSemanticAdapter().getAdapter(IElementType.class); if(elementType == UMLElementTypes.MODEL) { if(ElementTypes.DIAGRAM_ID.equals(containerGraphicalType)) { @@ -246,11 +240,23 @@ public class InheritedClassDiagramViewProvider extends UMLViewProvider { } return false; } - // ///////////////////////////////////////////////////////////////////// // Test possibility to provide a view based on the semantic nature and its expected container. // ///////////////////////////////////////////////////////////////////// - + // IElementType may be an extended type. Check for a view based on this element type + if(elementType instanceof IExtendedHintedElementType) { + EObject domainElement = (EObject)op.getSemanticAdapter().getAdapter(EObject.class); + String domainElementGraphicalType = op.getSemanticHint(); + if(domainElementGraphicalType == null) { + domainElementGraphicalType = registry.getNodeGraphicalType(domainElement, containerGraphicalType); + } else { + domainElementGraphicalType = registry.getNodeGraphicalType(domainElementGraphicalType, containerGraphicalType); + } + if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownNodeType(domainElementGraphicalType))) { + return true; + } + } + // IElementType may be null (especially when drop from ModelExplorer). // In such a case, test the semantic EObject instead. if(elementType == null) { @@ -261,7 +267,6 @@ public class InheritedClassDiagramViewProvider extends UMLViewProvider { } else { domainElementGraphicalType = registry.getNodeGraphicalType(domainElementGraphicalType, containerGraphicalType); } - if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownNodeType(domainElementGraphicalType))) { return true; } @@ -271,38 +276,31 @@ public class InheritedClassDiagramViewProvider extends UMLViewProvider { @Override public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) { - // Use the GraphicalTypeRegistry to find the expected type for a domain element // Get the type of the container String containerGraphicalType = containerView.getType(); - // Get the type of the domain element EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class); - if(semanticHint != null) { // Look for a possible graphicalType replacement String graphicalType = registry.getNodeGraphicalType(semanticHint, containerGraphicalType); return super.createNode(new SemanticAdapter(domainElement, null), containerView, graphicalType, index, persisted, preferencesHint); } - String domainElementGraphicalType = registry.getNodeGraphicalType(domainElement, containerGraphicalType); - -// if(semanticHint != null) { -// return super.createNode(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint); -// } -// -// // Use the GraphicalTypeRegistry to find the expected type for a domain element -// // Get the type of the container -// String containerGraphicalType = containerView.getType(); -// // Get the type of the domain element -// EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class); -// String domainElementGraphicalType = registry.getNodeGraphicalType(domainElement, containerGraphicalType); - + // if(semanticHint != null) { + // return super.createNode(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint); + // } + // + // // Use the GraphicalTypeRegistry to find the expected type for a domain element + // // Get the type of the container + // String containerGraphicalType = containerView.getType(); + // // Get the type of the domain element + // EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class); + // String domainElementGraphicalType = registry.getNodeGraphicalType(domainElement, containerGraphicalType); // Create the expected node if(!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) { return super.createNode(semanticAdapter, containerView, domainElementGraphicalType, index, persisted, preferencesHint); } - log.error(new Exception("Could not create Node.")); return null; } diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF index b1391bfdcac..be28864f2d9 100644 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF +++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF @@ -30,7 +30,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.2",
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.2",
org.eclipse.gmf.tooling.runtime;bundle-version="3.1.0",
- org.eclipse.papyrus.infra.tools;bundle-version="0.10.2"
+ org.eclipse.papyrus.infra.tools;bundle-version="0.10.2",
+ org.eclipse.papyrus.infra.extendedtypes;bundle-version="0.10.2"
Export-Package: org.eclipse.papyrus.sysml.diagram.internalblock,
org.eclipse.papyrus.sysml.diagram.internalblock.compatibility,
org.eclipse.papyrus.sysml.diagram.internalblock.dnd.helper,
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src-gen/org/eclipse/papyrus/sysml/diagram/internalblock/provider/InheritedCompositeDiagramViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src-gen/org/eclipse/papyrus/sysml/diagram/internalblock/provider/InheritedCompositeDiagramViewProvider.java index 664cc5d10aa..f5f7a4084b5 100644 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src-gen/org/eclipse/papyrus/sysml/diagram/internalblock/provider/InheritedCompositeDiagramViewProvider.java +++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock/src-gen/org/eclipse/papyrus/sysml/diagram/internalblock/provider/InheritedCompositeDiagramViewProvider.java @@ -26,6 +26,7 @@ import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.gmf.runtime.notation.Node; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry; +import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType; import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes; import org.eclipse.papyrus.sysml.diagram.internalblock.Activator; import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter; @@ -40,23 +41,18 @@ public class InheritedCompositeDiagramViewProvider extends UMLViewProvider { @Override public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) { Edge createdEdge = null; - IElementType elementType = (IElementType)semanticAdapter.getAdapter(IElementType.class); if(elementType != null) { createdEdge = super.createEdge(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint); } else { - EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class); - String domainElementGraphicalType = semanticHint; if(domainElementGraphicalType == null) { domainElementGraphicalType = registry.getEdgeGraphicalType(domainElement); } - if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownEdgeType(domainElementGraphicalType))) { // Cannot use createEdge from super class as it never take the graphical type (semanticHint) into account. // createdEdge = super.createEdge(semanticAdapter, containerView, domainElementGraphicalType, index, persisted, preferencesHint); - if(ElementTypes.COMMENT_ANNOTATED_ELEMENT.getSemanticHint().equals(domainElementGraphicalType)) { createdEdge = createCommentAnnotatedElement_4002(containerView, index, persisted, preferencesHint); } @@ -65,11 +61,9 @@ public class InheritedCompositeDiagramViewProvider extends UMLViewProvider { } } } - if(createdEdge == null) { Activator.log.error(new Exception("Could not create Edge.")); } - return createdEdge; } @@ -80,24 +74,20 @@ public class InheritedCompositeDiagramViewProvider extends UMLViewProvider { if(!ElementTypes.DIAGRAM_ID.equals(diagramType)) { return false; } - throw new UnsupportedOperationException("Should never be called by the " + diagramType + " diagram."); } @Override protected boolean provides(CreateEdgeViewOperation op) { - // Must have a container if(op.getContainerView() == null) { return false; } - // This provider is registered for InternalBlock Diagram only String diagramType = op.getContainerView().getDiagram().getType(); if(!ElementTypes.DIAGRAM_ID.equals(diagramType)) { return false; } - IElementType elementType = getSemanticElementType(op.getSemanticAdapter()); if(elementType == ElementTypes.COMMENT_ANNOTATED_ELEMENT) { return true; @@ -105,11 +95,20 @@ public class InheritedCompositeDiagramViewProvider extends UMLViewProvider { if(elementType == ElementTypes.CONSTRAINT_CONSTRAINED_ELEMENT) { return true; } - // ///////////////////////////////////////////////////////////////////// // Test possibility to provide a view based on the semantic nature and its expected container. // ///////////////////////////////////////////////////////////////////// - + // IElementType may be an extended type. Check for a view based on this element type + if(elementType instanceof IExtendedHintedElementType) { + EObject domainElement = (EObject)op.getSemanticAdapter().getAdapter(EObject.class); + String domainElementGraphicalType = op.getSemanticHint(); + if(domainElementGraphicalType == null) { + domainElementGraphicalType = registry.getEdgeGraphicalType(domainElement); + } + if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownEdgeType(domainElementGraphicalType))) { + return true; + } + } // IElementType may be null (especially when drop from ModelExplorer). // In such a case, test the semantic EObject instead. if(elementType == null) { @@ -118,12 +117,10 @@ public class InheritedCompositeDiagramViewProvider extends UMLViewProvider { if(domainElementGraphicalType == null) { domainElementGraphicalType = registry.getEdgeGraphicalType(domainElement); } - if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownEdgeType(domainElementGraphicalType))) { return true; } } - return false; } @@ -135,17 +132,14 @@ public class InheritedCompositeDiagramViewProvider extends UMLViewProvider { } // Get the type of the container String containerGraphicalType = op.getContainerView().getType(); - // This provider is registered for InternalBlock Diagram only String diagramType = op.getContainerView().getDiagram().getType(); if(!ElementTypes.DIAGRAM_ID.equals(diagramType)) { return false; } - // ///////////////////////////////////////////////////////////////////// // Test possibility to provide a view based on the ElementType and its expected container. // ///////////////////////////////////////////////////////////////////// - IElementType elementType = (IElementType)op.getSemanticAdapter().getAdapter(IElementType.class); if(elementType == UMLElementTypes.CONSTRAINT) { if(ElementTypes.DIAGRAM_ID.equals(containerGraphicalType)) { @@ -166,11 +160,23 @@ public class InheritedCompositeDiagramViewProvider extends UMLViewProvider { return true; } } - // ///////////////////////////////////////////////////////////////////// // Test possibility to provide a view based on the semantic nature and its expected container. // ///////////////////////////////////////////////////////////////////// - + // IElementType may be an extended type. Check for a view based on this element type + if(elementType instanceof IExtendedHintedElementType) { + EObject domainElement = (EObject)op.getSemanticAdapter().getAdapter(EObject.class); + String domainElementGraphicalType = op.getSemanticHint(); + if(domainElementGraphicalType == null) { + domainElementGraphicalType = registry.getNodeGraphicalType(domainElement, containerGraphicalType); + } else { + domainElementGraphicalType = registry.getNodeGraphicalType(domainElementGraphicalType, containerGraphicalType); + } + if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownNodeType(domainElementGraphicalType))) { + return true; + } + } + // IElementType may be null (especially when drop from ModelExplorer). // In such a case, test the semantic EObject instead. if(elementType == null) { @@ -181,7 +187,6 @@ public class InheritedCompositeDiagramViewProvider extends UMLViewProvider { } else { domainElementGraphicalType = registry.getNodeGraphicalType(domainElementGraphicalType, containerGraphicalType); } - if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownNodeType(domainElementGraphicalType))) { return true; } @@ -191,27 +196,21 @@ public class InheritedCompositeDiagramViewProvider extends UMLViewProvider { @Override public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) { - // Use the GraphicalTypeRegistry to find the expected type for a domain element // Get the type of the container String containerGraphicalType = containerView.getType(); - // Get the type of the domain element EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class); - if(semanticHint != null) { // Look for a possible graphicalType replacement String graphicalType = registry.getNodeGraphicalType(semanticHint, containerGraphicalType); return super.createNode(new SemanticAdapter(domainElement, null), containerView, graphicalType, index, persisted, preferencesHint); } - String domainElementGraphicalType = registry.getNodeGraphicalType(domainElement, containerGraphicalType); - // Create the expected node if(!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) { return super.createNode(semanticAdapter, containerView, domainElementGraphicalType, index, persisted, preferencesHint); } - Activator.log.error(new Exception("Could not create Node.")); return null; } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/providers/UMLViewProvider.java index a5e1abb5eec..8e2c9cf380f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/providers/UMLViewProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz/src/org/eclipse/papyrus/uml/diagram/clazz/providers/UMLViewProvider.java @@ -150,9 +150,10 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint());
if(elementType != null) {
if(elementType instanceof IExtendedHintedElementType) {
- IElementType closestNonExtendedType = ElementTypeUtils.getClosestDiagramType(elementType);
- if(!UMLElementTypes.isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof IHintedType))) {
- return false; // foreign element type.
+ if(domainElement !=null) {
+ if(!UMLVisualIDRegistry.checkNodeVisualID(op.getContainerView(), domainElement, visualID)) {
+ return false;
+ }
}
} else {
if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java index 5126b349a45..7e2b64dbe2b 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java @@ -16,6 +16,9 @@ package org.eclipse.papyrus.uml.diagram.common.service; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; import java.util.Map; import javax.xml.parsers.DocumentBuilder; @@ -38,7 +41,7 @@ import org.xml.sax.SAXException; /** * Provider for Palette that uses a XML file for palette definition. */ -public class LocalPaletteProvider extends AbstractProvider implements IPaletteProvider, IPapyrusPaletteConstant { +public class LocalPaletteProvider extends AbstractProvider implements IPaletteProvider, IPapyrusPaletteConstant, IProfileDependantPaletteProvider { /** * The list of palette provider XML contributions @@ -48,6 +51,9 @@ public class LocalPaletteProvider extends AbstractProvider implements IPalettePr /** parser used for the xml file */ protected XMLDefinitionPaletteParser parser; + /** cached list of required profiles for this palette to be shown */ + protected Collection<String> requiredProfiles; + /** * {@inheritDoc} */ @@ -138,6 +144,34 @@ public class LocalPaletteProvider extends AbstractProvider implements IPalettePr } /** + * {@inheritDoc} + */ + public Collection<String> getRequiredProfiles() { + if(contributions==null) { + return Collections.emptyList(); + } + if(requiredProfiles == null) { + requiredProfiles = new HashSet<String>(); + + try { + // parse the content of the file to discover the required + // profiles + // using safe computation + XMLDefinitionPaletteParser profileParser = new XMLDefinitionPaletteParser(new XMLRequiredProfileFactory(requiredProfiles)); + for(int i = 0; i < contributions.getLength(); i++) { + Node node = contributions.item(i); + if(PALETTE_DEFINITION.equals(node.getNodeName())) { + profileParser.parsePaletteDefinition(node); + } + } + } catch (Throwable e) { + Activator.log.error(e); + } + } + return requiredProfiles; + } + + /** * Returns the file using the specified path in the plugin state location * * @param path diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PluginPaletteProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PluginPaletteProvider.java index 8f11d0c7dbf..c880443d6f5 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PluginPaletteProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PluginPaletteProvider.java @@ -17,9 +17,6 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -28,20 +25,16 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Platform; import org.eclipse.papyrus.uml.diagram.common.Activator; import org.osgi.framework.Bundle; -import org.w3c.dom.Node; /** * Provider extending the {@link LocalPaletteProvider} to reference xml-defined * palettes into plugins, using the papyrus palette extension point */ -public class PluginPaletteProvider extends LocalPaletteProvider implements IProfileDependantPaletteProvider { +public class PluginPaletteProvider extends LocalPaletteProvider { /** id of the contributor */ private String providerID; - /** cached list of required profiles for this palette to be shown */ - protected Collection<String> requiredProfiles; - /** * Return the provider ID that declares this provider * @@ -98,31 +91,4 @@ public class PluginPaletteProvider extends LocalPaletteProvider implements IProf readXMLDocument(configElement.getAttribute(PATH)); } - /** - * {@inheritDoc} - */ - public Collection<String> getRequiredProfiles() { - if(contributions==null) { - return Collections.emptyList(); - } - if(requiredProfiles == null) { - requiredProfiles = new HashSet<String>(); - - try { - // parse the content of the file to discover the required - // profiles - // using safe computation - XMLDefinitionPaletteParser profileParser = new XMLDefinitionPaletteParser(new XMLRequiredProfileFactory(requiredProfiles)); - for(int i = 0; i < contributions.getLength(); i++) { - Node node = contributions.item(i); - if(PALETTE_DEFINITION.equals(node.getNodeName())) { - profileParser.parsePaletteDefinition(node); - } - } - } catch (Throwable e) { - Activator.log.error(e); - } - } - return requiredProfiles; - } } diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLViewProvider.java index e9dc968b524..f2b28e9b811 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLViewProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/providers/UMLViewProvider.java @@ -149,9 +149,10 @@ public class UMLViewProvider extends AbstractProvider implements IViewProvider { visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint());
if(elementType != null) {
if(elementType instanceof IExtendedHintedElementType) {
- IElementType closestNonExtendedType = ElementTypeUtils.getClosestDiagramType(elementType);
- if(!UMLElementTypes.isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof IHintedType))) {
- return false; // foreign element type.
+ if (domainElement != null) {
+ if (!UMLVisualIDRegistry.checkNodeVisualID(op.getContainerView(), domainElement, visualID)) {
+ return false;
+ }
}
} else {
if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/plugin.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/plugin.properties index 5aaa9d167b7..8951ed5e6b2 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/plugin.properties +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/plugin.properties @@ -50,3 +50,4 @@ _UI_ElementDescriptor_graphicalHints_feature = Graphical Hints _UI_SeparatorConfiguration_type = Separator Configuration
_UI_LeafConfiguration_type = Leaf Configuration
_UI_StackConfiguration_ownedConfigurations_feature = Owned Configurations
+_UI_PaletteConfiguration_requiredProfiles_feature = Required Profiles
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ChildConfigurationItemProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ChildConfigurationItemProvider.java index 34f0d3b7a9c..3b25690e31c 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ChildConfigurationItemProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ChildConfigurationItemProvider.java @@ -25,13 +25,7 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.ChildConfiguration; * @generated
*/
public class ChildConfigurationItemProvider
- extends ConfigurationItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ConfigurationItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/DrawerConfigurationItemProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/DrawerConfigurationItemProvider.java index 671b9acf667..12e2369abcc 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/DrawerConfigurationItemProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/DrawerConfigurationItemProvider.java @@ -30,13 +30,7 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Paletteconfiguration * @generated
*/
public class DrawerConfigurationItemProvider
- extends ConfigurationItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ConfigurationItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/LeafConfigurationItemProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/LeafConfigurationItemProvider.java index b8614a33ee9..c79c92b44b1 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/LeafConfigurationItemProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/LeafConfigurationItemProvider.java @@ -25,13 +25,7 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.LeafConfiguration; * @generated
*/
public class LeafConfigurationItemProvider
- extends ChildConfigurationItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ChildConfigurationItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/PaletteConfigurationItemProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/PaletteConfigurationItemProvider.java index 865a691f6de..f5681d69c8a 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/PaletteConfigurationItemProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/PaletteConfigurationItemProvider.java @@ -11,12 +11,14 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.PaletteConfiguration;
@@ -30,13 +32,7 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Paletteconfiguration * @generated
*/
public class PaletteConfigurationItemProvider
- extends ConfigurationItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ConfigurationItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
@@ -58,11 +54,34 @@ public class PaletteConfigurationItemProvider if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
+ addRequiredProfilesPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
+ * This adds a property descriptor for the Required Profiles feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addRequiredProfilesPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PaletteConfiguration_requiredProfiles_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PaletteConfiguration_requiredProfiles_feature", "_UI_PaletteConfiguration_type"),
+ PaletteconfigurationPackage.Literals.PALETTE_CONFIGURATION__REQUIRED_PROFILES,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
@@ -130,6 +149,9 @@ public class PaletteConfigurationItemProvider updateChildren(notification);
switch (notification.getFeatureID(PaletteConfiguration.class)) {
+ case PaletteconfigurationPackage.PALETTE_CONFIGURATION__REQUIRED_PROFILES:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
case PaletteconfigurationPackage.PALETTE_CONFIGURATION__DRAWER_CONFIGURATIONS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/SeparatorConfigurationItemProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/SeparatorConfigurationItemProvider.java index ecebb1866f4..dd1529683d4 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/SeparatorConfigurationItemProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/SeparatorConfigurationItemProvider.java @@ -25,13 +25,7 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.SeparatorConfigurati * @generated
*/
public class SeparatorConfigurationItemProvider
- extends LeafConfigurationItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends LeafConfigurationItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/StackConfigurationItemProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/StackConfigurationItemProvider.java index e17089de8fb..03136db8b9e 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/StackConfigurationItemProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/StackConfigurationItemProvider.java @@ -30,13 +30,7 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.StackConfiguration; * @generated
*/
public class StackConfigurationItemProvider
- extends ChildConfigurationItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends ChildConfigurationItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ToolConfigurationItemProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ToolConfigurationItemProvider.java index 18c5e5cca0c..19e2db4d067 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ToolConfigurationItemProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ToolConfigurationItemProvider.java @@ -32,13 +32,7 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration; * @generated
*/
public class ToolConfigurationItemProvider
- extends LeafConfigurationItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
+ extends LeafConfigurationItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/META-INF/MANIFEST.MF index 1a8aba7205b..211a43938f0 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/META-INF/MANIFEST.MF +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/META-INF/MANIFEST.MF @@ -27,9 +27,7 @@ Bundle-Version: 0.10.2.qualifier Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.uml.diagram.paletteconfiguration
- .Activator
-Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.paletteconfigurat
- ion;singleton:=true
+Bundle-Activator: org.eclipse.papyrus.uml.diagram.paletteconfiguration.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.paletteconfiguration;singleton:=true
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore index 94cfbb03b97..1fe6d884c62 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecore @@ -5,6 +5,8 @@ <eClassifiers xsi:type="ecore:EClass" name="PaletteConfiguration" eSuperTypes="#//Configuration">
<eStructuralFeatures xsi:type="ecore:EReference" name="drawerConfigurations" lowerBound="1"
upperBound="-1" eType="#//DrawerConfiguration" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="requiredProfiles" upperBound="-1"
+ eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ToolConfiguration" eSuperTypes="#//LeafConfiguration">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" lowerBound="1" eType="#//ToolKind"
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecorediag b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecorediag index 95f8dfad3b3..62f9a357eb7 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecorediag +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.ecorediag @@ -3,6 +3,10 @@ <children xmi:type="notation:Node" xmi:id="_Es6HAN3dEd-vY7OSNoF8nA" type="1001">
<children xmi:type="notation:Node" xmi:id="_Es6HA93dEd-vY7OSNoF8nA" type="4001"/>
<children xmi:type="notation:Node" xmi:id="_Es6HBN3dEd-vY7OSNoF8nA" type="5001">
+ <children xmi:type="notation:Node" xmi:id="_8nEWwMSxEeO-K5aODM_IgQ" type="2001">
+ <element xmi:type="ecore:EAttribute" href="PaletteConfiguration.ecore#//PaletteConfiguration/requiredProfiles"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_8nEWwcSxEeO-K5aODM_IgQ"/>
+ </children>
<styles xmi:type="notation:DrawerStyle" xmi:id="_Es6HBd3dEd-vY7OSNoF8nA"/>
<styles xmi:type="notation:SortingStyle" xmi:id="_Es6HBt3dEd-vY7OSNoF8nA"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_Es6HB93dEd-vY7OSNoF8nA"/>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.genmodel b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.genmodel index 4f05bf87abb..b6baf1bf29b 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.genmodel +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/model/PaletteConfiguration.genmodel @@ -19,6 +19,7 @@ </genEnums>
<genClasses ecoreClass="PaletteConfiguration.ecore#//PaletteConfiguration">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference PaletteConfiguration.ecore#//PaletteConfiguration/drawerConfigurations"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteConfiguration.ecore#//PaletteConfiguration/requiredProfiles"/>
</genClasses>
<genClasses ecoreClass="PaletteConfiguration.ecore#//ToolConfiguration">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute PaletteConfiguration.ecore#//ToolConfiguration/kind"/>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/PaletteConfiguration.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/PaletteConfiguration.java index 4026c2cb2d4..a0289038712 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/PaletteConfiguration.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/PaletteConfiguration.java @@ -17,6 +17,7 @@ import org.eclipse.emf.common.util.EList; * The following features are supported:
* <ul>
* <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.PaletteConfiguration#getDrawerConfigurations <em>Drawer Configurations</em>}</li>
+ * <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.PaletteConfiguration#getRequiredProfiles <em>Required Profiles</em>}</li>
* </ul>
* </p>
*
@@ -41,4 +42,20 @@ public interface PaletteConfiguration extends Configuration { */
EList<DrawerConfiguration> getDrawerConfigurations();
+ /**
+ * Returns the value of the '<em><b>Required Profiles</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Required Profiles</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Required Profiles</em>' attribute list.
+ * @see org.eclipse.papyrus.uml.diagram.paletteconfiguration.PaletteconfigurationPackage#getPaletteConfiguration_RequiredProfiles()
+ * @model
+ * @generated
+ */
+ EList<String> getRequiredProfiles();
+
} // PaletteConfiguration
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/PaletteconfigurationPackage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/PaletteconfigurationPackage.java index 4721f4f1909..823e75516f3 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/PaletteconfigurationPackage.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/PaletteconfigurationPackage.java @@ -171,13 +171,22 @@ public interface PaletteconfigurationPackage extends EPackage { int PALETTE_CONFIGURATION__DRAWER_CONFIGURATIONS = CONFIGURATION_FEATURE_COUNT + 0;
/**
+ * The feature id for the '<em><b>Required Profiles</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PALETTE_CONFIGURATION__REQUIRED_PROFILES = CONFIGURATION_FEATURE_COUNT + 1;
+
+ /**
* The number of structural features of the '<em>Palette Configuration</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int PALETTE_CONFIGURATION_FEATURE_COUNT = CONFIGURATION_FEATURE_COUNT + 1;
+ int PALETTE_CONFIGURATION_FEATURE_COUNT = CONFIGURATION_FEATURE_COUNT + 2;
/**
* The meta object id for the '{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ChildConfigurationImpl <em>Child Configuration</em>}' class.
@@ -336,22 +345,13 @@ public interface PaletteconfigurationPackage extends EPackage { int TOOL_CONFIGURATION__ICON = LEAF_CONFIGURATION__ICON;
/**
- * The feature id for the '<em><b>Pre Validation Query</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int TOOL_CONFIGURATION__PRE_VALIDATION_QUERY = LEAF_CONFIGURATION_FEATURE_COUNT + 0;
-
- /**
* The feature id for the '<em><b>Kind</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int TOOL_CONFIGURATION__KIND = LEAF_CONFIGURATION_FEATURE_COUNT + 1;
+ int TOOL_CONFIGURATION__KIND = LEAF_CONFIGURATION_FEATURE_COUNT + 0;
/**
* The feature id for the '<em><b>Element Descriptors</b></em>' containment reference list.
@@ -360,7 +360,7 @@ public interface PaletteconfigurationPackage extends EPackage { * @generated
* @ordered
*/
- int TOOL_CONFIGURATION__ELEMENT_DESCRIPTORS = LEAF_CONFIGURATION_FEATURE_COUNT + 2;
+ int TOOL_CONFIGURATION__ELEMENT_DESCRIPTORS = LEAF_CONFIGURATION_FEATURE_COUNT + 1;
/**
* The number of structural features of the '<em>Tool Configuration</em>' class.
@@ -369,7 +369,7 @@ public interface PaletteconfigurationPackage extends EPackage { * @generated
* @ordered
*/
- int TOOL_CONFIGURATION_FEATURE_COUNT = LEAF_CONFIGURATION_FEATURE_COUNT + 3;
+ int TOOL_CONFIGURATION_FEATURE_COUNT = LEAF_CONFIGURATION_FEATURE_COUNT + 2;
/**
* The meta object id for the '{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.StackConfigurationImpl <em>Stack Configuration</em>}' class.
@@ -661,25 +661,25 @@ public interface PaletteconfigurationPackage extends EPackage { EReference getPaletteConfiguration_DrawerConfigurations();
/**
- * Returns the meta object for class '{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration <em>Tool Configuration</em>}'.
+ * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.PaletteConfiguration#getRequiredProfiles <em>Required Profiles</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for class '<em>Tool Configuration</em>'.
- * @see org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration
+ * @return the meta object for the attribute list '<em>Required Profiles</em>'.
+ * @see org.eclipse.papyrus.uml.diagram.paletteconfiguration.PaletteConfiguration#getRequiredProfiles()
+ * @see #getPaletteConfiguration()
* @generated
*/
- EClass getToolConfiguration();
+ EAttribute getPaletteConfiguration_RequiredProfiles();
/**
- * Returns the meta object for the reference '{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration#getPreValidationQuery <em>Pre Validation Query</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration <em>Tool Configuration</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for the reference '<em>Pre Validation Query</em>'.
- * @see org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration#getPreValidationQuery()
- * @see #getToolConfiguration()
+ * @return the meta object for class '<em>Tool Configuration</em>'.
+ * @see org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration
* @generated
*/
- EReference getToolConfiguration_PreValidationQuery();
+ EClass getToolConfiguration();
/**
* Returns the meta object for the attribute '{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration#getKind <em>Kind</em>}'.
@@ -944,22 +944,22 @@ public interface PaletteconfigurationPackage extends EPackage { EReference PALETTE_CONFIGURATION__DRAWER_CONFIGURATIONS = eINSTANCE.getPaletteConfiguration_DrawerConfigurations();
/**
- * The meta object literal for the '{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ToolConfigurationImpl <em>Tool Configuration</em>}' class.
+ * The meta object literal for the '<em><b>Required Profiles</b></em>' attribute list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ToolConfigurationImpl
- * @see org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.PaletteconfigurationPackageImpl#getToolConfiguration()
* @generated
*/
- EClass TOOL_CONFIGURATION = eINSTANCE.getToolConfiguration();
+ EAttribute PALETTE_CONFIGURATION__REQUIRED_PROFILES = eINSTANCE.getPaletteConfiguration_RequiredProfiles();
/**
- * The meta object literal for the '<em><b>Pre Validation Query</b></em>' reference feature.
+ * The meta object literal for the '{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ToolConfigurationImpl <em>Tool Configuration</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ToolConfigurationImpl
+ * @see org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.PaletteconfigurationPackageImpl#getToolConfiguration()
* @generated
*/
- EReference TOOL_CONFIGURATION__PRE_VALIDATION_QUERY = eINSTANCE.getToolConfiguration_PreValidationQuery();
+ EClass TOOL_CONFIGURATION = eINSTANCE.getToolConfiguration();
/**
* The meta object literal for the '<em><b>Kind</b></em>' attribute feature.
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/ToolConfiguration.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/ToolConfiguration.java index 51cf71a4d20..e5a277941ad 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/ToolConfiguration.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/ToolConfiguration.java @@ -7,7 +7,6 @@ package org.eclipse.papyrus.uml.diagram.paletteconfiguration;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.papyrus.infra.queries.core.configuration.QueryConfiguration;
/**
* <!-- begin-user-doc -->
@@ -17,7 +16,6 @@ import org.eclipse.papyrus.infra.queries.core.configuration.QueryConfiguration; * <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration#getPreValidationQuery <em>Pre Validation Query</em>}</li>
* <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration#getKind <em>Kind</em>}</li>
* <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration#getElementDescriptors <em>Element Descriptors</em>}</li>
* </ul>
@@ -29,32 +27,6 @@ import org.eclipse.papyrus.infra.queries.core.configuration.QueryConfiguration; */
public interface ToolConfiguration extends LeafConfiguration {
/**
- * Returns the value of the '<em><b>Pre Validation Query</b></em>' reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Validation Query</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pre Validation Query</em>' reference.
- * @see #setPreValidationQuery(QueryConfiguration)
- * @see org.eclipse.papyrus.uml.diagram.paletteconfiguration.PaletteconfigurationPackage#getToolConfiguration_PreValidationQuery()
- * @model
- * @generated
- */
- QueryConfiguration getPreValidationQuery();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration#getPreValidationQuery <em>Pre Validation Query</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Validation Query</em>' reference.
- * @see #getPreValidationQuery()
- * @generated
- */
- void setPreValidationQuery(QueryConfiguration value);
-
- /**
* Returns the value of the '<em><b>Kind</b></em>' attribute.
* The default value is <code>"CreationTool"</code>.
* The literals are from the enumeration {@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolKind}.
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteConfigurationImpl.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteConfigurationImpl.java index 0146f972e50..95899596e77 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteConfigurationImpl.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteConfigurationImpl.java @@ -12,6 +12,7 @@ import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.DrawerConfiguration;
@@ -26,6 +27,7 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Paletteconfiguration * The following features are implemented:
* <ul>
* <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.PaletteConfigurationImpl#getDrawerConfigurations <em>Drawer Configurations</em>}</li>
+ * <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.PaletteConfigurationImpl#getRequiredProfiles <em>Required Profiles</em>}</li>
* </ul>
* </p>
*
@@ -43,6 +45,16 @@ public class PaletteConfigurationImpl extends ConfigurationImpl implements Palet protected EList<DrawerConfiguration> drawerConfigurations;
/**
+ * The cached value of the '{@link #getRequiredProfiles() <em>Required Profiles</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRequiredProfiles()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> requiredProfiles;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -78,6 +90,18 @@ public class PaletteConfigurationImpl extends ConfigurationImpl implements Palet * <!-- end-user-doc -->
* @generated
*/
+ public EList<String> getRequiredProfiles() {
+ if (requiredProfiles == null) {
+ requiredProfiles = new EDataTypeUniqueEList<String>(String.class, this, PaletteconfigurationPackage.PALETTE_CONFIGURATION__REQUIRED_PROFILES);
+ }
+ return requiredProfiles;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
@@ -97,6 +121,8 @@ public class PaletteConfigurationImpl extends ConfigurationImpl implements Palet switch (featureID) {
case PaletteconfigurationPackage.PALETTE_CONFIGURATION__DRAWER_CONFIGURATIONS:
return getDrawerConfigurations();
+ case PaletteconfigurationPackage.PALETTE_CONFIGURATION__REQUIRED_PROFILES:
+ return getRequiredProfiles();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -114,6 +140,10 @@ public class PaletteConfigurationImpl extends ConfigurationImpl implements Palet getDrawerConfigurations().clear();
getDrawerConfigurations().addAll((Collection<? extends DrawerConfiguration>)newValue);
return;
+ case PaletteconfigurationPackage.PALETTE_CONFIGURATION__REQUIRED_PROFILES:
+ getRequiredProfiles().clear();
+ getRequiredProfiles().addAll((Collection<? extends String>)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -129,6 +159,9 @@ public class PaletteConfigurationImpl extends ConfigurationImpl implements Palet case PaletteconfigurationPackage.PALETTE_CONFIGURATION__DRAWER_CONFIGURATIONS:
getDrawerConfigurations().clear();
return;
+ case PaletteconfigurationPackage.PALETTE_CONFIGURATION__REQUIRED_PROFILES:
+ getRequiredProfiles().clear();
+ return;
}
super.eUnset(featureID);
}
@@ -143,8 +176,26 @@ public class PaletteConfigurationImpl extends ConfigurationImpl implements Palet switch (featureID) {
case PaletteconfigurationPackage.PALETTE_CONFIGURATION__DRAWER_CONFIGURATIONS:
return drawerConfigurations != null && !drawerConfigurations.isEmpty();
+ case PaletteconfigurationPackage.PALETTE_CONFIGURATION__REQUIRED_PROFILES:
+ return requiredProfiles != null && !requiredProfiles.isEmpty();
}
return super.eIsSet(featureID);
}
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (requiredProfiles: ");
+ result.append(requiredProfiles);
+ result.append(')');
+ return result.toString();
+ }
+
} //PaletteConfigurationImpl
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteconfigurationFactoryImpl.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteconfigurationFactoryImpl.java index 4b94482e28f..c8b02aa7909 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteconfigurationFactoryImpl.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteconfigurationFactoryImpl.java @@ -38,7 +38,7 @@ public class PaletteconfigurationFactoryImpl extends EFactoryImpl implements Pal */
public static PaletteconfigurationFactory init() {
try {
- PaletteconfigurationFactory thePaletteconfigurationFactory = (PaletteconfigurationFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7");
+ PaletteconfigurationFactory thePaletteconfigurationFactory = (PaletteconfigurationFactory)EPackage.Registry.INSTANCE.getEFactory(PaletteconfigurationPackage.eNS_URI);
if (thePaletteconfigurationFactory != null) {
return thePaletteconfigurationFactory;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteconfigurationPackageImpl.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteconfigurationPackageImpl.java index 4b4da02bd8a..3a0b7b29b6f 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteconfigurationPackageImpl.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/PaletteconfigurationPackageImpl.java @@ -13,7 +13,6 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.papyrus.infra.queries.core.configuration.ConfigurationPackage;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.ChildConfiguration;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Configuration;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.DrawerConfiguration;
@@ -159,7 +158,7 @@ public class PaletteconfigurationPackageImpl extends EPackageImpl implements Pal isInited = true;
// Initialize simple dependencies
- ConfigurationPackage.eINSTANCE.eClass();
+ EcorePackage.eINSTANCE.eClass();
// Create package meta-data objects
thePaletteconfigurationPackage.createPackageContents();
@@ -199,8 +198,8 @@ public class PaletteconfigurationPackageImpl extends EPackageImpl implements Pal * <!-- end-user-doc -->
* @generated
*/
- public EClass getToolConfiguration() {
- return toolConfigurationEClass;
+ public EAttribute getPaletteConfiguration_RequiredProfiles() {
+ return (EAttribute)paletteConfigurationEClass.getEStructuralFeatures().get(1);
}
/**
@@ -208,8 +207,8 @@ public class PaletteconfigurationPackageImpl extends EPackageImpl implements Pal * <!-- end-user-doc -->
* @generated
*/
- public EReference getToolConfiguration_PreValidationQuery() {
- return (EReference)toolConfigurationEClass.getEStructuralFeatures().get(0);
+ public EClass getToolConfiguration() {
+ return toolConfigurationEClass;
}
/**
@@ -218,7 +217,7 @@ public class PaletteconfigurationPackageImpl extends EPackageImpl implements Pal * @generated
*/
public EAttribute getToolConfiguration_Kind() {
- return (EAttribute)toolConfigurationEClass.getEStructuralFeatures().get(1);
+ return (EAttribute)toolConfigurationEClass.getEStructuralFeatures().get(0);
}
/**
@@ -227,7 +226,7 @@ public class PaletteconfigurationPackageImpl extends EPackageImpl implements Pal * @generated
*/
public EReference getToolConfiguration_ElementDescriptors() {
- return (EReference)toolConfigurationEClass.getEStructuralFeatures().get(2);
+ return (EReference)toolConfigurationEClass.getEStructuralFeatures().get(1);
}
/**
@@ -431,9 +430,9 @@ public class PaletteconfigurationPackageImpl extends EPackageImpl implements Pal // Create classes and their features
paletteConfigurationEClass = createEClass(PALETTE_CONFIGURATION);
createEReference(paletteConfigurationEClass, PALETTE_CONFIGURATION__DRAWER_CONFIGURATIONS);
+ createEAttribute(paletteConfigurationEClass, PALETTE_CONFIGURATION__REQUIRED_PROFILES);
toolConfigurationEClass = createEClass(TOOL_CONFIGURATION);
- createEReference(toolConfigurationEClass, TOOL_CONFIGURATION__PRE_VALIDATION_QUERY);
createEAttribute(toolConfigurationEClass, TOOL_CONFIGURATION__KIND);
createEReference(toolConfigurationEClass, TOOL_CONFIGURATION__ELEMENT_DESCRIPTORS);
@@ -491,7 +490,6 @@ public class PaletteconfigurationPackageImpl extends EPackageImpl implements Pal setNsURI(eNS_URI);
// Obtain other dependent packages
- ConfigurationPackage theConfigurationPackage = (ConfigurationPackage)EPackage.Registry.INSTANCE.getEPackage(ConfigurationPackage.eNS_URI);
EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
// Create type parameters
@@ -510,9 +508,9 @@ public class PaletteconfigurationPackageImpl extends EPackageImpl implements Pal // Initialize classes and features; add operations and parameters
initEClass(paletteConfigurationEClass, PaletteConfiguration.class, "PaletteConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getPaletteConfiguration_DrawerConfigurations(), this.getDrawerConfiguration(), null, "drawerConfigurations", null, 1, -1, PaletteConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPaletteConfiguration_RequiredProfiles(), theEcorePackage.getEString(), "requiredProfiles", null, 0, -1, PaletteConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(toolConfigurationEClass, ToolConfiguration.class, "ToolConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getToolConfiguration_PreValidationQuery(), theConfigurationPackage.getQueryConfiguration(), null, "preValidationQuery", null, 0, 1, ToolConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getToolConfiguration_Kind(), this.getToolKind(), "kind", "CreationTool", 1, 1, ToolConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getToolConfiguration_ElementDescriptors(), this.getElementDescriptor(), null, "elementDescriptors", null, 0, -1, ToolConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/ToolConfigurationImpl.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/ToolConfigurationImpl.java index 396b21a8773..77e1f373add 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/ToolConfigurationImpl.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src-gen/org/eclipse/papyrus/uml/diagram/paletteconfiguration/impl/ToolConfigurationImpl.java @@ -16,7 +16,6 @@ import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.papyrus.infra.queries.core.configuration.QueryConfiguration;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.ElementDescriptor;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.PaletteconfigurationPackage;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration;
@@ -29,7 +28,6 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolKind; * <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ToolConfigurationImpl#getPreValidationQuery <em>Pre Validation Query</em>}</li>
* <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ToolConfigurationImpl#getKind <em>Kind</em>}</li>
* <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ToolConfigurationImpl#getElementDescriptors <em>Element Descriptors</em>}</li>
* </ul>
@@ -39,16 +37,6 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolKind; */
public class ToolConfigurationImpl extends LeafConfigurationImpl implements ToolConfiguration {
/**
- * The cached value of the '{@link #getPreValidationQuery() <em>Pre Validation Query</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPreValidationQuery()
- * @generated
- * @ordered
- */
- protected QueryConfiguration preValidationQuery;
-
- /**
* The default value of the '{@link #getKind() <em>Kind</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -102,44 +90,6 @@ public class ToolConfigurationImpl extends LeafConfigurationImpl implements Tool * <!-- end-user-doc -->
* @generated
*/
- public QueryConfiguration getPreValidationQuery() {
- if (preValidationQuery != null && preValidationQuery.eIsProxy()) {
- InternalEObject oldPreValidationQuery = (InternalEObject)preValidationQuery;
- preValidationQuery = (QueryConfiguration)eResolveProxy(oldPreValidationQuery);
- if (preValidationQuery != oldPreValidationQuery) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, PaletteconfigurationPackage.TOOL_CONFIGURATION__PRE_VALIDATION_QUERY, oldPreValidationQuery, preValidationQuery));
- }
- }
- return preValidationQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public QueryConfiguration basicGetPreValidationQuery() {
- return preValidationQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setPreValidationQuery(QueryConfiguration newPreValidationQuery) {
- QueryConfiguration oldPreValidationQuery = preValidationQuery;
- preValidationQuery = newPreValidationQuery;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PaletteconfigurationPackage.TOOL_CONFIGURATION__PRE_VALIDATION_QUERY, oldPreValidationQuery, preValidationQuery));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
public ToolKind getKind() {
return kind;
}
@@ -190,9 +140,6 @@ public class ToolConfigurationImpl extends LeafConfigurationImpl implements Tool @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case PaletteconfigurationPackage.TOOL_CONFIGURATION__PRE_VALIDATION_QUERY:
- if (resolve) return getPreValidationQuery();
- return basicGetPreValidationQuery();
case PaletteconfigurationPackage.TOOL_CONFIGURATION__KIND:
return getKind();
case PaletteconfigurationPackage.TOOL_CONFIGURATION__ELEMENT_DESCRIPTORS:
@@ -210,9 +157,6 @@ public class ToolConfigurationImpl extends LeafConfigurationImpl implements Tool @Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case PaletteconfigurationPackage.TOOL_CONFIGURATION__PRE_VALIDATION_QUERY:
- setPreValidationQuery((QueryConfiguration)newValue);
- return;
case PaletteconfigurationPackage.TOOL_CONFIGURATION__KIND:
setKind((ToolKind)newValue);
return;
@@ -232,9 +176,6 @@ public class ToolConfigurationImpl extends LeafConfigurationImpl implements Tool @Override
public void eUnset(int featureID) {
switch (featureID) {
- case PaletteconfigurationPackage.TOOL_CONFIGURATION__PRE_VALIDATION_QUERY:
- setPreValidationQuery((QueryConfiguration)null);
- return;
case PaletteconfigurationPackage.TOOL_CONFIGURATION__KIND:
setKind(KIND_EDEFAULT);
return;
@@ -253,8 +194,6 @@ public class ToolConfigurationImpl extends LeafConfigurationImpl implements Tool @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case PaletteconfigurationPackage.TOOL_CONFIGURATION__PRE_VALIDATION_QUERY:
- return preValidationQuery != null;
case PaletteconfigurationPackage.TOOL_CONFIGURATION__KIND:
return kind != KIND_EDEFAULT;
case PaletteconfigurationPackage.TOOL_CONFIGURATION__ELEMENT_DESCRIPTORS:
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ExtendedPluginPaletteProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ExtendedPluginPaletteProvider.java index 77e13bcd66b..1069c0e6e5d 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ExtendedPluginPaletteProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src/org/eclipse/papyrus/uml/diagram/paletteconfiguration/provider/ExtendedPluginPaletteProvider.java @@ -15,8 +15,10 @@ import java.io.FileNotFoundException; import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -46,6 +48,7 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.papyrus.uml.diagram.common.part.PapyrusPalettePreferences;
import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeConnectionTool;
import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeCreationTool;
+import org.eclipse.papyrus.uml.diagram.common.service.IProfileDependantPaletteProvider;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Activator;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.ChildConfiguration;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Configuration;
@@ -57,6 +60,7 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Paletteconfiguration import org.eclipse.papyrus.uml.diagram.paletteconfiguration.SeparatorConfiguration;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.StackConfiguration;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration;
+import org.eclipse.papyrus.uml.diagram.paletteconfiguration.util.PaletteConfigurationUtils;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.util.PaletteconfigurationSwitch;
import org.eclipse.ui.IEditorPart;
import org.osgi.framework.Bundle;
@@ -65,7 +69,7 @@ import org.osgi.framework.Bundle; /**
* Palette provider with enhanced elements types
*/
-public class ExtendedPluginPaletteProvider extends AbstractProvider implements IPaletteProvider {
+public class ExtendedPluginPaletteProvider extends AbstractProvider implements IPaletteProvider, IProfileDependantPaletteProvider {
/** name of the type */
public static final String TYPE_NAME = "testSpecializationTypeName";
@@ -100,6 +104,11 @@ public class ExtendedPluginPaletteProvider extends AbstractProvider implements I /** default icon for drawers */
protected static ImageDescriptor DEFAULT_DRAWER_IMAGE_DESCRIPTOR = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "/icons/drawer.gif");
+ /** cached list of required profiles for this palette to be shown. this will be <code>null</code> until initialized*/
+ protected Collection<String> requiredProfiles = null;
+
+
+
/**
* {@inheritDoc}
*/
@@ -115,6 +124,27 @@ public class ExtendedPluginPaletteProvider extends AbstractProvider implements I /**
* {@inheritDoc}
*/
+ public Collection<String> getRequiredProfiles() {
+ if(contributions == null || contributions.size() == 0) {
+ return Collections.emptyList();
+ }
+ if(requiredProfiles == null) {
+ requiredProfiles = new HashSet<String>();
+
+ // compute. should be at least an empty list as soon as it has been initialized
+ for(PaletteConfiguration configuration : contributions) {
+ Collection<String> profiles = PaletteConfigurationUtils.getRequiredProfiles(configuration);
+ if(profiles !=null && profiles.size() > 0) {
+ requiredProfiles.addAll(profiles);
+ }
+ }
+ }
+ return requiredProfiles;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public void contributeToPalette(IEditorPart editor, Object content, PaletteRoot root, Map predefinedEntries) {
// for each element in the contribution list, create drawers/tools/stacks/etc.
if(contributions == null || contributions.size() == 0) {
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src/org/eclipse/papyrus/uml/diagram/paletteconfiguration/util/PaletteConfigurationUtils.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src/org/eclipse/papyrus/uml/diagram/paletteconfiguration/util/PaletteConfigurationUtils.java index 7071babdd6b..e0649afdb81 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src/org/eclipse/papyrus/uml/diagram/paletteconfiguration/util/PaletteConfigurationUtils.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.paletteconfiguration/src/org/eclipse/papyrus/uml/diagram/paletteconfiguration/util/PaletteConfigurationUtils.java @@ -13,6 +13,8 @@ *****************************************************************************/
package org.eclipse.papyrus.uml.diagram.paletteconfiguration.util;
+import java.util.Collection;
+import java.util.Collections;
import java.util.Iterator;
import org.eclipse.emf.ecore.EObject;
@@ -33,6 +35,13 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.ToolConfiguration; */
public class PaletteConfigurationUtils {
+ public static Collection<String> getRequiredProfiles(PaletteConfiguration paletteConfiguration) {
+ if(paletteConfiguration == null) {
+ return Collections.emptyList();
+ }
+ return paletteConfiguration.getRequiredProfiles();
+ }
+
/**
* Removes a configuration from its container
*
|