Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2013-05-31 10:07:29 -0400
committercletavernie2013-05-31 10:07:29 -0400
commit23a75b0aeb2e82056b55cc54cae944898b58bfa1 (patch)
tree7bc38f9751db90420ccd45ce0a2d929fc7690094
parent2142bdacab1d3a63f584e9b3ae0869653bc3988d (diff)
downloadorg.eclipse.papyrus-23a75b0aeb2e82056b55cc54cae944898b58bfa1.tar.gz
org.eclipse.papyrus-23a75b0aeb2e82056b55cc54cae944898b58bfa1.tar.xz
org.eclipse.papyrus-23a75b0aeb2e82056b55cc54cae944898b58bfa1.zip
409472: Severe performance bottleneck while creating activity diagram from "imported" model.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=409472
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/extension/diagrameditor/EditorDescriptor.java8
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/src/org/eclipse/papyrus/infra/gmfdiag/css/configuration/handler/AbstractStyleHandler.java1
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java1
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java1
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java1
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/ShapeCompartmentEditPolicy.java94
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramHelper.java14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/AcceptEventActionFigure.java41
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java13
9 files changed, 126 insertions, 48 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/extension/diagrameditor/EditorDescriptor.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/extension/diagrameditor/EditorDescriptor.java
index 3ed2fac57a7..8a9af9f54b8 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/extension/diagrameditor/EditorDescriptor.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/extension/diagrameditor/EditorDescriptor.java
@@ -40,10 +40,11 @@ public class EditorDescriptor {
* The icon representing the diagram
*/
private ImageDescriptor icon;
+
/**
* Resource path to the icon
*/
- private String inconPath;
+ private String iconPath;
/**
* Constructor.
@@ -112,6 +113,7 @@ public class EditorDescriptor {
*
* {@inheritDoc}
*/
+ @Override
public String toString() {
if(editorFactoryClass == null || editorFactoryClass.getName() == null) {
return "[nestedEditor editorFactory:" + editorFactoryClass + "(null)]";
@@ -126,7 +128,7 @@ public class EditorDescriptor {
* path of the Icon
*/
public void setIconURL(String iconPath) {
- inconPath = iconPath;
+ this.iconPath = iconPath;
}
/**
@@ -135,7 +137,7 @@ public class EditorDescriptor {
* @return the path of the mai image. can return null if this property is not set
*/
public String getIconURL() {
- return inconPath;
+ return iconPath;
}
/**
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/src/org/eclipse/papyrus/infra/gmfdiag/css/configuration/handler/AbstractStyleHandler.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/src/org/eclipse/papyrus/infra/gmfdiag/css/configuration/handler/AbstractStyleHandler.java
index 436380c2d5f..20630eb8add 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/src/org/eclipse/papyrus/infra/gmfdiag/css/configuration/handler/AbstractStyleHandler.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.configuration/src/org/eclipse/papyrus/infra/gmfdiag/css/configuration/handler/AbstractStyleHandler.java
@@ -166,6 +166,7 @@ public abstract class AbstractStyleHandler extends AbstractHandler {
try {
resource.save(new HashMap<Object, Object>());
BaseCSSEngine.instance.reset();
+ DiagramHelper.setNeedsRefresh();
DiagramHelper.refreshDiagrams();
} catch (IOException ex) {
Activator.log.error(ex);
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java
index 7aed0e59bd5..ffae587eb03 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java
@@ -106,6 +106,7 @@ public class DiagramCSSEngine extends ExtendedCSSEngineImpl implements IChangeLi
public void handleChange(ChangeEvent event) {
resetCache();
+ DiagramHelper.setNeedsRefresh();
DiagramHelper.refreshDiagrams(); //FIXME: Should be contextual. We should only refresh the editor(s) containing this Diagram
}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java
index 6e7b277a76e..013da33c1dc 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java
@@ -353,6 +353,7 @@ public abstract class ExtendedCSSEngineImpl extends AbstractCSSEngine implements
//FIXME: It seems the refresh can create a deadlock in some cases
+ DiagramHelper.setNeedsRefresh();
Display.getDefault().asyncExec(new Runnable() {
public void run() {
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java
index 84b17145b6e..0d1f24dd949 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java
@@ -73,6 +73,7 @@ public class ThemePreferencesPage extends FieldEditorPreferencePage implements I
boolean result = super.performOk();
if(needsRefresh) {
WorkspaceCSSEngine.instance.reset();
+ DiagramHelper.setNeedsRefresh();
DiagramHelper.refreshDiagrams();
}
return result;
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/ShapeCompartmentEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/ShapeCompartmentEditPolicy.java
index 190fa9d5b31..88fea4dcf86 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/ShapeCompartmentEditPolicy.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/ShapeCompartmentEditPolicy.java
@@ -32,7 +32,6 @@ import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
import org.eclipse.papyrus.infra.gmfdiag.common.Activator;
import org.eclipse.papyrus.infra.gmfdiag.common.commands.CreateShapeCompartmentViewCommand;
import org.eclipse.papyrus.infra.gmfdiag.common.commands.SetNodeVisibilityCommand;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IShapeCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.service.shape.NotificationManager;
import org.eclipse.papyrus.infra.gmfdiag.common.service.shape.ShapeService;
@@ -50,7 +49,7 @@ public class ShapeCompartmentEditPolicy extends GraphicalEditPolicy implements N
/** manager for notifications: should the compartment react to the notification? */
protected NotificationManager notificationManager;
-
+
/**
* Creates a new AppliedStereotype display edit policy
*/
@@ -62,6 +61,7 @@ public class ShapeCompartmentEditPolicy extends GraphicalEditPolicy implements N
*
* {@inheritDoc}
*/
+ @Override
public void activate() {
super.activate();
// retrieve the view and the element managed by the edit part
@@ -71,13 +71,14 @@ public class ShapeCompartmentEditPolicy extends GraphicalEditPolicy implements N
}
notificationManager = ShapeService.getInstance().createNotificationManager(getDiagramEventBroker(), view, this);
createShapeCompartment();
-
+
}
/**
*
* {@inheritDoc}
*/
+ @Override
public void deactivate() {
// retrieve the view and the element managed by the edit part
View view = getView();
@@ -120,34 +121,68 @@ public class ShapeCompartmentEditPolicy extends GraphicalEditPolicy implements N
*/
protected void executeShapeCompartmentCreation(final IGraphicalEditPart editPart) {
try {
- getEditingDomain(editPart).runExclusive(new Runnable() {
+ // getEditingDomain(editPart).runExclusive(new Runnable() {
+
+ /**
+ * {@inheritDoc}
+ */
+ // public void run() {
+ Display.getCurrent().syncExec(new Runnable() {
/**
* {@inheritDoc}
*/
public void run() {
- Display.getCurrent().asyncExec(new Runnable() {
+ //boolean isVisible = hasToDisplayCompartment(editPart.getNotationView());
+ CreateShapeCompartmentViewCommand command = new CreateShapeCompartmentViewCommand(getEditingDomain(editPart), "Create Compartment", "Command that creates the compartment displaying shapes", editPart.getNotationView(), /* isVisible */false);
+ Map<String, Boolean> options = new HashMap<String, Boolean>();
+ //options.put(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
+ try {
+ //This should not change the command stack, as this transaction will only manipulate transient views. Create a transaction manually, if needed
+ InternalTransactionalEditingDomain editingDomain = (InternalTransactionalEditingDomain)editPart.getEditingDomain();
+ InternalTransaction activeTransaction = editingDomain.getActiveTransaction();
+ if(activeTransaction != null && activeTransaction.isActive()) {
+ if(activeTransaction.isReadOnly()) {
+ //We're in a read-only active transaction (e.g. post-commit).
+ //Typical case: We create a new gmf::View in a transaction.
+ //The transaction has been committed, and the edit part is being created during the post-commit
+ //post-commit is read-only. We cannot create a read-write transaction in this state, so we need
+ //to deactive the read-only transaction first.
- /**
- * {@inheritDoc}
- */
- public void run() {
- //boolean isVisible = hasToDisplayCompartment(editPart.getNotationView());
- CreateShapeCompartmentViewCommand command = new CreateShapeCompartmentViewCommand(getEditingDomain(editPart), "Create Compartment", "Command that creates the compartment displaying shapes", editPart.getNotationView(), /*isVisible*/ false);
- Map<String,Boolean> options = new HashMap<String,Boolean>();
- options.put(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
- try{
- InternalTransaction it=((InternalTransactionalEditingDomain) editPart.getEditingDomain()).startTransaction(false, options);
+ try {
+ //Deactivate the read-only transaction
+ editingDomain.deactivate(activeTransaction);
+
+ //Start a new read-write transaction
+ InternalTransaction it = editingDomain.startTransaction(false, options);
+ command.execute();
+ it.commit();
+ } finally {
+ //Reactive the read-only transaction
+ editingDomain.activate(activeTransaction);
+ }
+
+ } else {
+ //We're already in an active read-write transaction. Simply execute the command
+ //Never happens?
command.execute();
- it.commit();
- } catch(Exception e){
- Activator.log.error(e);
}
- // editPart.getEditingDomain().getCommandStack().execute(command);
+ } else {
+ //We're not in a transaction. Start a new read-write transaction
+ //Typical case: opening the diagram
+ InternalTransaction it = editingDomain.startTransaction(false, options);
+ command.execute();
+ it.commit();
}
- });
+
+ } catch (Exception e) {
+ Activator.log.error(e);
+ }
+ // editPart.getEditingDomain().getCommandStack().execute(command);
}
});
+ // }
+ // });
} catch (Exception e) {
Activator.log.error(e);
}
@@ -155,13 +190,15 @@ public class ShapeCompartmentEditPolicy extends GraphicalEditPolicy implements N
/**
* Returns the editing domain for the given edit Part
- * @param editPart the edit part from which editing domain is searched
- * @return the editing domain
+ *
+ * @param editPart
+ * the edit part from which editing domain is searched
+ * @return the editing domain
*/
protected TransactionalEditingDomain getEditingDomain(IGraphicalEditPart editPart) {
return editPart.getEditingDomain();
}
-
+
/**
* Gets the diagram event broker from the editing domain.
*
@@ -202,6 +239,7 @@ public class ShapeCompartmentEditPolicy extends GraphicalEditPolicy implements N
/**
* Returns the view corresponding to the shape compartment
+ *
* @param node
* @return
*/
@@ -233,13 +271,13 @@ public class ShapeCompartmentEditPolicy extends GraphicalEditPolicy implements N
public void run() {
SetNodeVisibilityCommand setCommand = new SetNodeVisibilityCommand(editPart.getEditingDomain(), view, isVisible);
//use to avoid to put it in the command stack
- Map<String,Boolean> options = new HashMap<String,Boolean>();
- options.put(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
+ Map<String, Boolean> options = new HashMap<String, Boolean>();
+ options.put(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
try {
- InternalTransaction it=((InternalTransactionalEditingDomain) editPart.getEditingDomain()).startTransaction(false, options);
+ InternalTransaction it = ((InternalTransactionalEditingDomain)editPart.getEditingDomain()).startTransaction(false, options);
setCommand.execute();
it.commit();
- } catch(Exception e){
+ } catch (Exception e) {
Activator.log.error(e);
}
}
@@ -250,5 +288,5 @@ public class ShapeCompartmentEditPolicy extends GraphicalEditPolicy implements N
Activator.log.error(e);
}
}
-
+
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramHelper.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramHelper.java
index 8ab63c01f65..fece295adf1 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramHelper.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/helper/DiagramHelper.java
@@ -85,15 +85,27 @@ public class DiagramHelper {
}
}
}
-
}
+ private static boolean needsRefresh = false;
+
/**
* Refreshes all opened diagrams
*/
public static void refreshDiagrams() {
+ synchronized(DiagramHelper.class) {
+ if(!needsRefresh) {
+ return;
+ }
+ needsRefresh = false;
+ }
+
for(IMultiDiagramEditor activeMultiEditor : EditorUtils.getMultiDiagramEditors()) {
refresh(activeMultiEditor);
}
}
+
+ public synchronized static void setNeedsRefresh() {
+ needsRefresh = true;
+ }
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/AcceptEventActionFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/AcceptEventActionFigure.java
index f86b35dfba0..37603bbed3d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/AcceptEventActionFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity/custom-src/org/eclipse/papyrus/uml/diagram/activity/figures/AcceptEventActionFigure.java
@@ -50,21 +50,21 @@ public class AcceptEventActionFigure extends ScalablePolygonShape implements IPa
/** The helper which handles stereotype aspects */
private StereotypeFigureHelper stereotypeHelper;
- public AcceptEventActionFigure(){
+ public AcceptEventActionFigure() {
CenteredColumnLayout layoutThis = new CenteredColumnLayout();
this.setLayoutManager(layoutThis);
- this.addPoint( new Point(0, 0));
+ this.addPoint(new Point(0, 0));
this.addPoint(new Point(200, 0));
this.addPoint(new Point(200, 50));
this.addPoint(new Point(0, 50));
this.addPoint(new Point(50, 25));
// add time template
- this.addTimePoint( new Point(0, 0));
- this.addTimePoint(new Point( 100, 0));
- this.addTimePoint( new Point(50, 25));
- this.addTimePoint( new Point(100, 50));
- this.addTimePoint( new Point(0, 50));
- this.addTimePoint(new Point( 50, 25));
+ this.addTimePoint(new Point(0, 0));
+ this.addTimePoint(new Point(100, 0));
+ this.addTimePoint(new Point(50, 25));
+ this.addTimePoint(new Point(100, 50));
+ this.addTimePoint(new Point(0, 50));
+ this.addTimePoint(new Point(50, 25));
this.setFill(true);
this.setLineWidth(1);
// make margin border relative
@@ -73,6 +73,7 @@ public class AcceptEventActionFigure extends ScalablePolygonShape implements IPa
createContents();
// use StereotypeFigureHelper
stereotypeHelper = new StereotypeFigureHelper(this) {
+
@Override
public Object getStereotypeRectangleConstraint() {
CenteredColumnConstraint constraintStereotypeRect0 = new CenteredColumnConstraint(false);
@@ -99,13 +100,14 @@ public class AcceptEventActionFigure extends ScalablePolygonShape implements IPa
labelRect0.add(fAcceptEventActionLabel);
}
-
+
private final PointList myTemplate = new PointList();
-
+
private Rectangle myTemplateBounds;
-
+
+ @Override
public void addPoint(Point point) {
myTemplate.addPoint(point);
myTemplateBounds = null;
@@ -186,6 +188,7 @@ public class AcceptEventActionFigure extends ScalablePolygonShape implements IPa
* @unused
* @deprecated
*/
+ @Deprecated
public Label getStereotypesLabel() {
return null;//fActionStereotypeLabel;
}
@@ -239,6 +242,7 @@ public class AcceptEventActionFigure extends ScalablePolygonShape implements IPa
myTemplateTimeBounds = null;
}
+ @Override
protected void fillShape(Graphics graphics) {
Rectangle bounds = getBounds();
graphics.pushState();
@@ -246,9 +250,13 @@ public class AcceptEventActionFigure extends ScalablePolygonShape implements IPa
graphics.fillPolygon(scalePointList());
graphics.popState();
// refresh relative margin
- this.setBorder(new MarginBorder(scaleMargin()));
+ Insets newInsets = scaleMargin();
+ if(!newInsets.equals(getBorder().getInsets(this))) {
+ this.setBorder(new MarginBorder(scaleMargin()));
+ }
}
+ @Override
protected void outlineShape(Graphics graphics) {
Rectangle bounds = getBounds();
graphics.pushState();
@@ -274,7 +282,7 @@ public class AcceptEventActionFigure extends ScalablePolygonShape implements IPa
}
/**
- * switch between the two templates
+ * switch between the two templates
*/
private Rectangle getTemplateBounds() {
if(myTemplateBounds == null) {
@@ -322,9 +330,9 @@ public class AcceptEventActionFigure extends ScalablePolygonShape implements IPa
// switch between the two templates
int[] scaled;
if(useTemplateTime) {
- scaled = (int[])myTemplateTime.toIntArray().clone();
+ scaled = myTemplateTime.toIntArray().clone();
} else {
- scaled = (int[])myTemplate.toIntArray().clone();
+ scaled = myTemplate.toIntArray().clone();
}
for(int i = 0; i < scaled.length; i += 2) {
scaled[i] = (int)Math.floor(scaled[i] * xScale);
@@ -359,10 +367,11 @@ public class AcceptEventActionFigure extends ScalablePolygonShape implements IPa
public void setTransparency(int transparency) {
}
+
public void setGradientData(int gradientColor1, int gradientColor2, int gradientStyle) {
}
public void setIsUsingGradient(boolean b) {
}
-} \ No newline at end of file
+}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
index b56582d3fa6..9ec76c3251c 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/ModelExplorerView.java
@@ -651,17 +651,30 @@ public class ModelExplorerView extends CommonNavigator implements IRevealSemanti
return;
}
lastTrans = curTrans;
+
+ synchronized(this) {
+ needsRefresh = true;
+ }
+
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
/**
* {@inheritDoc}
*/
public void run() {
+ synchronized(ModelExplorerView.this) {
+ if(!needsRefresh) {
+ return;
+ }
+ needsRefresh = false;
+ }
refresh();
}
});
}
+ private boolean needsRefresh = false;
+
/**
* refresh the view.
*/

Back to the top