1 package org.simantics.scl.ui.imports.internal;
3 import java.util.ArrayList;
5 import org.eclipse.jface.dialogs.Dialog;
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 BasicImportModulesAction extends ImportModulesAction {
12 public static final BasicImportModulesAction INSTANCE = new BasicImportModulesAction();
14 public BasicImportModulesAction() {
15 super("Add modules", 0.0);
19 public boolean editImports(Shell shell, ArrayList<CommandSessionImportEntry> imports) {
20 SCLModuleSelectionDialog dialog = new SCLModuleSelectionDialog(shell);
21 if(dialog.open() == Dialog.OK) {
22 for(Object r : dialog.getResult()) {
23 new CommandSessionImportEntry((String)r, "", true).addTo(imports);