Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormwenz2016-06-01 09:21:29 +0000
committermwenz2016-06-03 13:25:52 +0000
commit355a667c1e4e65289666e7c2498de754be6bf4ac (patch)
tree3c004e4e15eea534d57f89bd3ddf95a504f462f1
parent543eb48310c72e08ef4a9792f1c998b07ab8899c (diff)
downloadorg.eclipse.graphiti-355a667c1e4e65289666e7c2498de754be6bf4ac.tar.gz
org.eclipse.graphiti-355a667c1e4e65289666e7c2498de754be6bf4ac.tar.xz
org.eclipse.graphiti-355a667c1e4e65289666e7c2498de754be6bf4ac.zip
Bug 494997 - EditPart does not refresh for active shapes inside inactive
ContainerShapes Change-Id: I5eb13b4256a2f06aaa2738ff01e3cb2d07452864
-rw-r--r--plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java
index 17b04563..98702aa4 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramRefreshJob.java
@@ -1,7 +1,7 @@
/*******************************************************************************
* <copyright>
*
- * Copyright (c) 2005, 2015 SAP AG.
+ * Copyright (c) 2005, 2016 SAP AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
* Bug 336488 - DiagramEditor API
* pjpaulin - Bug 352120 - Now uses IDiagramContainerUI interface
* mwenz - Bug 477659 - NullPointerException in DefaultRefreshBehavior.internalRefreshEditPart
+ * mwenz - Bug 494997 - EditPart does not refresh for active shapes inside inactive ContainerShapes
*
* </copyright>
*
@@ -30,6 +31,8 @@ import org.eclipse.gef.EditPart;
import org.eclipse.graphiti.features.IDirectEditingInfo;
import org.eclipse.graphiti.internal.pref.GFPreferences;
import org.eclipse.graphiti.internal.util.T;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
+import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.ui.editor.DiagramBehavior;
import org.eclipse.graphiti.ui.internal.parts.ConnectionDecoratorEditPart;
import org.eclipse.graphiti.ui.internal.parts.DiagramEditPart;
@@ -141,13 +144,22 @@ class DiagramRefreshJob extends UIJob {
Object parentModel = ep.getParent().getModel();
if (parentModel != null && ep.getModel() instanceof EObject) {
EObject eo = (EObject) ep.getModel();
- if (!parentModel.equals(eo.eContainer())) {
+ if (!parentModel.equals(getActiveShapeContainer(eo))) {
return true;
}
}
return false;
}
+ private EObject getActiveShapeContainer(EObject eo) {
+ EObject container = eo.eContainer();
+ while (container != null && container instanceof Shape && !(container instanceof Diagram)
+ && !((Shape) container).isActive()) {
+ container = container.eContainer();
+ }
+ return container;
+ }
+
void setRefreshAll() {
this.refreshAll = true;
}

Back to the top