Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-01-27 08:20:41 -0500
committerCamille Letavernier2014-01-27 08:20:41 -0500
commit766d3a423638db8ddae364cf0511b2f9b8ff7435 (patch)
treea78f050b5a01496c6718099cd711ddd9977a2648 /plugins
parent61fe1560ac4f7d2d667c116648cbe5a2eb6a10ef (diff)
downloadorg.eclipse.papyrus-766d3a423638db8ddae364cf0511b2f9b8ff7435.tar.gz
org.eclipse.papyrus-766d3a423638db8ddae364cf0511b2f9b8ff7435.tar.xz
org.eclipse.papyrus-766d3a423638db8ddae364cf0511b2f9b8ff7435.zip
[Minor] Fix a CSS Refresh issue
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/handler/RefreshHandler.java22
1 files changed, 12 insertions, 10 deletions
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 dacfdea5e41..4c8b093f7a9 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
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
- *
+ *
* 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
@@ -41,20 +41,21 @@ public class RefreshHandler extends AbstractHandler {
* We use weak references so that we do not block the garbage collection of objects
*/
private static Collection<WeakReference<IRefreshHandlerPart>> PARTS = new LinkedList<WeakReference<IRefreshHandlerPart>>();
-
+
/**
* Register a refresher part that is not attached to any editor
*
* @param refresher
- * The refresher part
+ * The refresher part
*/
public static synchronized void register(IRefreshHandlerPart refresher) {
PARTS.add(new WeakReference<IRefreshHandlerPart>(refresher));
}
-
+
/**
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IEditorPart activeEditor;
try {
@@ -64,21 +65,22 @@ public class RefreshHandler extends AbstractHandler {
return null;
}
- // Refresh the base GMF objects
- DiagramHelper.refresh(activeEditor);
-
+ //Hooks must be called before the actual refresh, because they typically reset cache
// Call the relevant hooks
callRefresherHooks(activeEditor);
+ // Refresh the base GMF objects
+ DiagramHelper.refresh(activeEditor);
+
return null;
}
-
+
private synchronized void callRefresherHooks(IEditorPart activeEditor) {
Iterator<WeakReference<IRefreshHandlerPart>> iterator = PARTS.iterator();
- while (iterator.hasNext()) {
+ while(iterator.hasNext()) {
WeakReference<IRefreshHandlerPart> wr = iterator.next();
IRefreshHandlerPart part = wr.get();
- if (part != null) {
+ if(part != null) {
part.refresh(activeEditor);
} else {
iterator.remove();

Back to the top