01: package org.eclipse.ui.tutorials.rcp.part2;
02:
03: import org.eclipse.core.runtime.IPlatformRunnable;
04: import org.eclipse.swt.widgets.Display;
05: import org.eclipse.ui.PlatformUI;
06:
07: /**
08: * This class controls all aspects of the application's execution
09: */
10: public class Application implements IPlatformRunnable {
11:
12: /* (non-Javadoc)
13: * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)
14: */
15: public Object run(Object args) throws Exception {
16: Display display = PlatformUI.createDisplay();
17: try {
18: int returnCode = PlatformUI.createAndRunWorkbench(display,
19: new ApplicationWorkbenchAdvisor());
20: if (returnCode == PlatformUI.RETURN_RESTART) {
21: return IPlatformRunnable.EXIT_RESTART;
22: }
23: return IPlatformRunnable.EXIT_OK;
24: } finally {
25: display.dispose();
26: }
27: }
28: }
|