Class SWTUtil
java.lang.Object
org.eclipse.emf.compare.rcp.ui.internal.util.SWTUtil
Utility class for running operation in the UI-Thread if not already within it.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
safeAsyncExec
(Runnable runnable) Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.static void
safeRedraw
(org.eclipse.swt.widgets.Control control, boolean async) RunControl.redraw()
on the given viewer.static void
safeRefresh
(org.eclipse.jface.viewers.Viewer viewer, boolean async, boolean checkDisposed) RunViewer.refresh()
on the given viewer.static void
safeSyncExec
(Runnable runnable) Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.
-
Method Details
-
safeAsyncExec
Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity. The caller of this method continues to run in parallel, and is not notified when the runnable has completed.- Parameters:
runnable
- runnable code to run on the user-interface thread.
-
safeSyncExec
Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity. The thread which calls this method is suspended until the runnable completes.- Parameters:
runnable
- runnable code to run on the user-interface thread.
-
safeRefresh
public static void safeRefresh(org.eclipse.jface.viewers.Viewer viewer, boolean async, boolean checkDisposed) RunViewer.refresh()
on the given viewer.- Parameters:
viewer
- the viewer to refresh.async
- whether the thread which calls this method is not suspended until the runnable completes.checkDisposed
- whether the viewer's control dispose state has to be checked before refresh.
-
safeRedraw
public static void safeRedraw(org.eclipse.swt.widgets.Control control, boolean async) RunControl.redraw()
on the given viewer.- Parameters:
redraw
- the control to redraw.async
- whether the thread which calls this method is not suspended until the runnable completes.
-