Skip to content
Snippets Groups Projects
Commit 13325e79 authored by Daniel Ratiu's avatar Daniel Ratiu
Browse files

run updates in the UI thread

refs 1191
parent 0a14ac3f
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EContentAdapter;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
import org.eclipse.swt.widgets.Display;
import org.fortiss.tooling.base.ui.layout.IDiagramLayoutConfiguration;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
......@@ -36,7 +37,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: AABA307F945C1A10D0F3F3C6617901E5
* @ConQAT.Rating YELLOW Hash: 0E3088D3491CFA563193129187B7CE82
*/
public abstract class GraphicalEditPartBase<T extends EObject> extends AbstractGraphicalEditPart {
......@@ -52,7 +53,14 @@ public abstract class GraphicalEditPartBase<T extends EObject> extends AbstractG
// if not removing adapters, just refresh everything
if(notification.getEventType() != Notification.REMOVING_ADAPTER) {
refresh();
// ensure that refresh is run in the UI thread
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
refresh();
}
});
}
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment