1 package org.simantics.scl.ui.browser;
\r
3 import org.eclipse.core.commands.AbstractHandler;
\r
4 import org.eclipse.core.commands.ExecutionEvent;
\r
5 import org.eclipse.core.commands.ExecutionException;
\r
6 import org.eclipse.swt.SWTError;
\r
7 import org.eclipse.swt.layout.FillLayout;
\r
8 import org.eclipse.swt.widgets.Display;
\r
9 import org.eclipse.swt.widgets.Shell;
\r
10 import org.eclipse.ui.PlatformUI;
\r
12 public class LaunchSCLDocumentationBrowser extends AbstractHandler {
\r
15 public Object execute(ExecutionEvent event) throws ExecutionException {
\r
16 Display display = PlatformUI.getWorkbench().getDisplay();
\r
17 Shell shell = new Shell(display);
\r
18 shell.setText("SCL Documentation browser");
\r
19 shell.setLayout(new FillLayout());
\r
20 SCLDocumentationBrowser browser;
\r
22 browser = new SCLDocumentationBrowser(shell);
\r
23 } catch (SWTError e) {
\r
24 System.out.println("Could not instantiate the browser: " + e.getMessage());
\r
28 browser.setLocation("Prelude");
\r