moduleInfos.put(vn.toString(), vn);
}
private VersionedName[] getModuleChoices(String toBeEdited) {
Forge forge = getEditor().getForge();
Map<String, VersionedName> modules = new HashMap<String, VersionedName>();
IProject current = getCurrentProject();
Diagnostic chain = new Diagnostic();
ModuleName always = null;
if(toBeEdited != null)
try {
always = ModuleName.fromString(toBeEdited);
}
catch(IllegalArgumentException e) {
// Keep always as null since a match is impossible
}
for(IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
try {
if(current == null || project.getName().equals(current.getName()))
continue;
if(!project.hasNature(XtextProjectHelper.NATURE_ID))
continue;
for(File moduleRoot : forge.findModuleRoots(project.getLocation().toFile(), null)) {
Metadata metadata = forge.createFromModuleDirectory(moduleRoot, false, null, null, chain);
addDependencyIfNotPresent(metadata, modules, always);
}
}
catch(Exception e) {
UIPlugin.getInstance().log(e);