X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.ui%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fui%2Fbrowser%2FLaunchSCLDocumentationBrowser.java;fp=bundles%2Forg.simantics.scl.ui%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fui%2Fbrowser%2FLaunchSCLDocumentationBrowser.java;h=eab01a2e4def07a5a55a6a0f375b3473435d27f7;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/browser/LaunchSCLDocumentationBrowser.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/browser/LaunchSCLDocumentationBrowser.java new file mode 100644 index 000000000..eab01a2e4 --- /dev/null +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/browser/LaunchSCLDocumentationBrowser.java @@ -0,0 +1,34 @@ +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("SCL Documentation browser"); + shell.setLayout(new FillLayout()); + SCLDocumentationBrowser browser; + try { + browser = new SCLDocumentationBrowser(shell); + } catch (SWTError e) { + System.out.println("Could not instantiate the browser: " + e.getMessage()); + display.dispose(); + return null; + } + browser.setLocation("Prelude"); + shell.open(); + + return null; + } + +}