Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormvelten2011-05-18 05:25:29 -0400
committermvelten2011-05-18 05:25:29 -0400
commit15e543aab24c22a228504ea46ef9470b5a9d9c47 (patch)
tree3088e55ee85b72f2a47bb60fc1644030b8eb6b3f /plugins/core/org.eclipse.papyrus.navigation
parent9771be200265aecac907e73e4f28c16667532a6f (diff)
downloadorg.eclipse.papyrus-15e543aab24c22a228504ea46ef9470b5a9d9c47.tar.gz
org.eclipse.papyrus-15e543aab24c22a228504ea46ef9470b5a9d9c47.tar.xz
org.eclipse.papyrus-15e543aab24c22a228504ea46ef9470b5a9d9c47.zip
REOPENED - bug 334262: [General] Navigation and integration with the creation diagram service
https://bugs.eclipse.org/bugs/show_bug.cgi?id=334262 install navigation edit policy on sysml diagrams
Diffstat (limited to 'plugins/core/org.eclipse.papyrus.navigation')
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecoratorProvider.java32
1 files changed, 14 insertions, 18 deletions
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecoratorProvider.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecoratorProvider.java
index 6cec90e9895..94dc52d9c84 100644
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecoratorProvider.java
+++ b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecoratorProvider.java
@@ -23,11 +23,10 @@ import org.eclipse.gef.EditPart;
import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
import org.eclipse.gmf.runtime.common.core.service.IOperation;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
import org.eclipse.gmf.runtime.diagram.ui.services.decorator.CreateDecoratorsOperation;
import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider;
import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Shape;
import org.eclipse.papyrus.navigation.preference.INavigationPreferenceConstant;
import org.eclipse.papyrus.preferences.Activator;
@@ -68,25 +67,22 @@ public class NavigationDecoratorProvider extends AbstractProvider implements IDe
if (operation instanceof CreateDecoratorsOperation && !INavigationPreferenceConstant.DISABLED.equals(decoratorVisibility)) {
IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget();
EditPart editPart = (EditPart)decoratorTarget.getAdapter(EditPart.class);
- if(editPart instanceof IGraphicalEditPart) {
- Object notationElement = editPart.getModel();
- if (notationElement instanceof Shape || notationElement instanceof Edge) {
- EObject element = ((IGraphicalEditPart) editPart).resolveSemanticElement();
- boolean decorate = false;
- for (Class<?> class_ : decoratedClasses) {
- if (class_.isInstance(element)) {
- decorate = true;
- break;
- }
+ if(editPart instanceof IPrimaryEditPart) {
+ EObject element = ((IGraphicalEditPart) editPart).resolveSemanticElement();
+ boolean decorate = false;
+ for (Class<?> class_ : decoratedClasses) {
+ if (class_.isInstance(element)) {
+ decorate = true;
+ break;
}
- for (Class<?> class_ : forbiddenClasses) {
- if (class_.isInstance(element)) {
- decorate = false;
- break;
- }
+ }
+ for (Class<?> class_ : forbiddenClasses) {
+ if (class_.isInstance(element)) {
+ decorate = false;
+ break;
}
- return decorate;
}
+ return decorate;
}
}
return false;

Back to the top