1 package org.simantics.scl.ui.editor2;
3 import org.eclipse.core.commands.AbstractHandler;
4 import org.eclipse.core.commands.ExecutionEvent;
5 import org.eclipse.core.commands.ExecutionException;
6 import org.eclipse.ui.IWorkbenchPage;
7 import org.eclipse.ui.PartInitException;
8 import org.eclipse.ui.PlatformUI;
10 public class OpenSCLModule extends AbstractHandler {
13 public Object execute(ExecutionEvent event) throws ExecutionException {
14 SCLModuleSelectionDialog dialog = new SCLModuleSelectionDialog(
15 PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
16 if(dialog.open() == SCLModuleSelectionDialog.OK) {
17 String moduleName = (String)dialog.getFirstResult();
18 openModule(moduleName);
23 public static void openModule(String moduleName) {
24 IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
27 SCLModuleEditorInput input = new StandardSCLModuleEditorInput(moduleName);
29 page.openEditor(input, "org.simantics.scl.ui.editor2");
30 } catch (PartInitException e) {