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