Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-04-04 15:08:38 +0000
committercletavernie2012-04-04 15:08:38 +0000
commit39591afd64c27f9da4391facaf5ca10d7868b9ef (patch)
treec51c8d799d67d10d9bfda8747c08daec95e7557d
parentae4db089b95edb7bd359cb10733e34061a33cec2 (diff)
downloadorg.eclipse.papyrus-39591afd64c27f9da4391facaf5ca10d7868b9ef.tar.gz
org.eclipse.papyrus-39591afd64c27f9da4391facaf5ca10d7868b9ef.tar.xz
org.eclipse.papyrus-39591afd64c27f9da4391facaf5ca10d7868b9ef.zip
370797: [Theme] Papyrus should provide a support for CSS files on its diagrams
https://bugs.eclipse.org/bugs/show_bug.cgi?id=370797
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java9
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/handler/RefreshHandler.java16
2 files changed, 17 insertions, 8 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
index 93ef761dd34..759acf5eed0 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
@@ -228,15 +228,20 @@ public class GMFElementAdapter extends ElementAdapter implements NodeList, IChan
break;
}
- if(gmfElement == gmfElement.eContainer()) {
+ EObject container = gmfElement.eContainer();
+
+ if(gmfElement == container || !(container instanceof View)) {
gmfElement = null;
break;
}
- gmfElement = (View)gmfElement.eContainer();
+ gmfElement = (View)container;
}
parentNode = engine.getElement(gmfElement);
+ if(parentNode == this) {
+ return parentNode = null;
+ }
}
return parentNode;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/handler/RefreshHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/handler/RefreshHandler.java
index afddc45fa00..75098981f31 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/handler/RefreshHandler.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/handler/RefreshHandler.java
@@ -16,6 +16,7 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
import org.eclipse.papyrus.infra.core.utils.EditorUtils;
import org.eclipse.papyrus.infra.gmfdiag.common.helper.DiagramHelper;
import org.eclipse.ui.IEditorPart;
@@ -31,12 +32,15 @@ import org.eclipse.ui.IEditorPart;
public class RefreshHandler extends AbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart activeEditor = EditorUtils.getMultiDiagramEditor().getActiveEditor();
- if(activeEditor instanceof DiagramEditor) {
- DiagramEditor diagramEditor = (DiagramEditor)activeEditor;
- DiagramEditPart topEditPart = diagramEditor.getDiagramEditPart();
- if(topEditPart != null) {
- DiagramHelper.refresh(topEditPart, true);
+ IMultiDiagramEditor multiDiagramEditor = EditorUtils.getMultiDiagramEditor();
+ if(multiDiagramEditor != null) {
+ IEditorPart activeEditor = multiDiagramEditor.getActiveEditor();
+ if(activeEditor instanceof DiagramEditor) {
+ DiagramEditor diagramEditor = (DiagramEditor)activeEditor;
+ DiagramEditPart topEditPart = diagramEditor.getDiagramEditPart();
+ if(topEditPart != null) {
+ DiagramHelper.refresh(topEditPart, true);
+ }
}
}
return null;

Back to the top