diff options
author | rschnekenbu | 2014-03-01 23:31:32 +0000 |
---|---|---|
committer | rschnekenbu | 2014-03-01 23:31:32 +0000 |
commit | 82ea257b9748908e8dd823177eb265c99c18a608 (patch) | |
tree | 200949ee0560c5b2693fea6bbdc1742fe55b3e45 | |
parent | d761d0a5c1d665e744533a961dc80777a0dd0103 (diff) | |
download | org.eclipse.papyrus-82ea257b9748908e8dd823177eb265c99c18a608.tar.gz org.eclipse.papyrus-82ea257b9748908e8dd823177eb265c99c18a608.tar.xz org.eclipse.papyrus-82ea257b9748908e8dd823177eb265c99c18a608.zip |
424305: [Core] Papyrus shall provide runtime model based configuration
for Element Types framework
https://bugs.eclipse.org/bugs/show_bug.cgi?id=424305
- component diagram shall support this framework
2 files changed, 18 insertions, 4 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/edit/policies/UMLBaseItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/edit/policies/UMLBaseItemSemanticEditPolicy.java index 6ccb7b8c931..03df5d81052 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/edit/policies/UMLBaseItemSemanticEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/edit/policies/UMLBaseItemSemanticEditPolicy.java @@ -304,6 +304,20 @@ public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy { */
protected Command getCreateCommand(CreateElementRequest req) {
// no more usage of the extended types here.
+ IElementType requestElementType = req.getElementType();
+ if (requestElementType instanceof IExtendedHintedElementType) {
+ IExtendedHintedElementType extendedElementType = (IExtendedHintedElementType) requestElementType;
+
+ // try to get a semantic create command from the extended type
+ IElementEditService commandProvider = ElementEditServiceUtils.getCommandProvider(req.getContainer());
+ if (commandProvider != null) {
+ ICommand command = commandProvider.getEditCommand(req);
+ if (command != null && command.canExecute()) {
+ return new ICommandProxy(command);
+ }
+ }
+ }
+
return null;
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/providers/UMLViewProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/providers/UMLViewProvider.java index 839b0e0a9d6..c2e479f0c1d 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/providers/UMLViewProvider.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component/src/org/eclipse/papyrus/uml/diagram/component/providers/UMLViewProvider.java @@ -230,10 +230,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.
- }
+// IElementType closestNonExtendedType = ElementTypeUtils.getClosestDiagramType(elementType);
+// if(!UMLElementTypes.isKnownElementType(closestNonExtendedType) || (!(closestNonExtendedType instanceof IHintedType))) {
+// return false; // foreign element type.
+// }
} else {
if(!UMLElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
return false; // foreign element type
|