1 package org.simantics.scl.ui.imports.internal;
3 import java.util.ArrayList;
5 import org.eclipse.swt.widgets.FileDialog;
6 import org.eclipse.swt.widgets.Shell;
7 import org.simantics.scl.compiler.commands.CommandSessionImportEntry;
8 import org.simantics.scl.ui.imports.ImportModulesAction;
10 public class ExternalImportModulesAction extends ImportModulesAction {
12 public static final ExternalImportModulesAction INSTANCE = new ExternalImportModulesAction();
14 public ExternalImportModulesAction() {
15 super("Add external module", 95.0);
19 public boolean editImports(Shell shell, ArrayList<CommandSessionImportEntry> imports) {
20 FileDialog dialog = new FileDialog(shell);
21 dialog.setFilterExtensions(new String[] {"*.scl"});
23 String result = dialog.open();
25 new CommandSessionImportEntry("file:" + result, "", true).addTo(imports);