1 package org.simantics.modeling.ui.scl.imports;
3 import java.util.ArrayList;
5 import org.eclipse.jface.dialogs.Dialog;
6 import org.eclipse.swt.widgets.Shell;
7 import org.simantics.Simantics;
8 import org.simantics.scl.compiler.commands.CommandSessionImportEntry;
9 import org.simantics.scl.ui.imports.ImportModulesAction;
11 public class SCLModulesImportModulesAction extends ImportModulesAction {
13 public static final SCLModulesImportModulesAction INSTANCE = new SCLModulesImportModulesAction();
15 public SCLModulesImportModulesAction() {
16 super("Add modules from project", 20.0);
20 public boolean editImports(Shell shell, ArrayList<CommandSessionImportEntry> imports) {
21 ModuleSelectionDialog dialog = new ModuleSelectionDialog(shell,
22 new SCLModulesQuery(Simantics.getProjectResource()));
23 if(dialog.open() == Dialog.OK) {
24 for(Object r : dialog.getResult()) {
25 String uri = (String)r;
26 new CommandSessionImportEntry(uri, "", true).addTo(imports);