]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/browser/LaunchSCLDocumentationBrowser.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.ui / src / org / simantics / scl / ui / browser / LaunchSCLDocumentationBrowser.java
1 package org.simantics.scl.ui.browser;\r
2 \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
11 \r
12 public class LaunchSCLDocumentationBrowser extends AbstractHandler {\r
13 \r
14     @Override\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
21         try {\r
22             browser = new SCLDocumentationBrowser(shell);\r
23         } catch (SWTError e) {\r
24             System.out.println("Could not instantiate the browser: " + e.getMessage());\r
25             display.dispose();\r
26             return null;\r
27         }\r
28         browser.setLocation("Prelude");\r
29         shell.open();\r
30         \r
31         return null;\r
32     }\r
33 \r
34 }\r