Java Code Examples for org.eclipse.swt.widgets.Display.update()

The following are Jave code examples for showing how to use update() of the org.eclipse.swt.widgets.Display class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: eclipse-batch-editor   File: AbstractQuickDialog.java   Source Code and License Vote up 6 votes
private void runEventLoop(Shell loopShell) {
	Display display;
	if (getShell() == null) {
		display = Display.getCurrent();
	} else {
		display = loopShell.getDisplay();
	}

	while (loopShell != null && !loopShell.isDisposed()) {
		try {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		} catch (Throwable e) {
			EclipseUtil.logError("UI problems on dispatch",e);
		}
	}
	if (!display.isDisposed()) {
		display.update();
	}
}
 
Example 2
Project: eclipse-bash-editor   File: AbstractQuickDialog.java   Source Code and License Vote up 6 votes
private void runEventLoop(Shell loopShell) {
	Display display;
	if (getShell() == null) {
		display = Display.getCurrent();
	} else {
		display = loopShell.getDisplay();
	}

	while (loopShell != null && !loopShell.isDisposed()) {
		try {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		} catch (Throwable e) {
			EclipseUtil.logError("UI problems on dispatch",e);
		}
	}
	if (!display.isDisposed()) {
		display.update();
	}
}
 
Example 3
Project: n4js   File: AbstractPluginUITest.java   Source Code and License Vote up 5 votes
/**
 * Processes UI input and does not return while there are things to do on the UI thread.<br>
 * I.e., when this method returns, there is no more work to do on the UI thread <em>at this time</em>.
 */
protected void waitForUiThread() {
	final Display display = getDisplay();
	while (display.readAndDispatch()) {
		// wait while there might be something to process.
	}
	display.update();
}