package org.simantics.scl.ui.browser; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.swt.SWTError; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; public class LaunchSCLDocumentationBrowser extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { Display display = PlatformUI.getWorkbench().getDisplay(); Shell shell = new Shell(display); shell.setText(Messages.LaunchSCLDocumentationBrowser_SCLDocumentationBrowser); shell.setLayout(new FillLayout()); SCLDocumentationBrowser browser; try { browser = new SCLDocumentationBrowser(shell); } catch (SWTError e) { System.out.println("Could not instantiate the browser: " + e.getMessage()); //$NON-NLS-1$ display.dispose(); return null; } browser.setLocation("Prelude"); //$NON-NLS-1$ shell.open(); return null; } }