Search in sources :

Example 1 with AddInterpretedModulesSelectionDialog

use of org.erlide.ui.dialogs.AddInterpretedModulesSelectionDialog in project erlide_eclipse by erlang.

the class DebugTab method getModulesFromAddModulesDialog.

public static List<IErlModule> getModulesFromAddModulesDialog(final Shell shell) {
    final List<IErlModule> result = Lists.newArrayList();
    final AddInterpretedModulesSelectionDialog dialog = new AddInterpretedModulesSelectionDialog(shell);
    final int resultCode = dialog.open();
    if (resultCode != IDialogConstants.OK_ID) {
        return result;
    }
    final Object[] dialogResult = dialog.getResult();
    if (dialogResult == null || dialogResult.length == 0) {
        return result;
    }
    final IErlModel model = ErlangEngine.getInstance().getModel();
    for (final Object o : dialogResult) {
        if (o instanceof IFile) {
            final IFile file = (IFile) o;
            result.add(model.findModule(file));
        }
    }
    return result;
}
Also used : IFile(org.eclipse.core.resources.IFile) AddInterpretedModulesSelectionDialog(org.erlide.ui.dialogs.AddInterpretedModulesSelectionDialog) IErlModel(org.erlide.engine.model.root.IErlModel) IErlModule(org.erlide.engine.model.root.IErlModule)

Aggregations

IFile (org.eclipse.core.resources.IFile)1 IErlModel (org.erlide.engine.model.root.IErlModel)1 IErlModule (org.erlide.engine.model.root.IErlModule)1 AddInterpretedModulesSelectionDialog (org.erlide.ui.dialogs.AddInterpretedModulesSelectionDialog)1