| package org.eclipse.ui.tutorials.rcp.part1; |
| |
| import org.eclipse.core.runtime.IPlatformRunnable; |
| import org.eclipse.swt.widgets.Display; |
| import org.eclipse.ui.PlatformUI; |
| import org.eclipse.ui.application.WorkbenchAdvisor; |
| |
| public class RcpApplication implements IPlatformRunnable { |
| |
| public Object run(Object args) { |
| WorkbenchAdvisor workbenchAdvisor = new RcpWorkbenchAdvisor(); |
| Display display = PlatformUI.createDisplay(); |
| try { |
| int returnCode = PlatformUI.createAndRunWorkbench(display, |
| workbenchAdvisor); |
| if (returnCode == PlatformUI.RETURN_RESTART) { |
| return IPlatformRunnable.EXIT_RESTART; |
| } else { |
| return IPlatformRunnable.EXIT_OK; |
| } |
| } finally { |
| display.dispose(); |
| } |
| } |
| } |