use of com.android.tools.idea.gradle.project.ModuleToImport in project android by JetBrains.
the class ImportSourceLocationStep method updateStepStatus.
private void updateStepStatus(PathValidationResult result) {
Object validationDetails = result.myDetails;
PageStatus status = result.myStatus;
Map<String, VirtualFile> selectedModules = Collections.emptyMap();
if (!ERROR.equals(status.severity)) {
final Collection<ModuleToImport> modules = myModulesPanel.getSelectedModules();
if (modules.isEmpty()) {
status = PageStatus.NO_MODULES_SELECTED;
validationDetails = null;
} else {
selectedModules = Maps.newHashMap();
for (ModuleToImport module : modules) {
selectedModules.put(myModulesPanel.getModuleName(module), module.location);
}
}
}
myPageValidationResult = result;
myState.setModulesToImport(selectedModules);
updateStatusDisplay(status, validationDetails);
myStatus = status;
myUpdateListener.update();
}
use of com.android.tools.idea.gradle.project.ModuleToImport in project android by JetBrains.
the class ModulesListModelTest method testTwoEmptyNamesAreNotDuplicates.
public void testTwoEmptyNamesAreNotDuplicates() {
ModuleToImport m2 = new ModuleToImport("m2", myModule2.location, NO_DEPS);
setModules(myModule1, m2);
myModel.setModuleName(myModule1, "");
myModel.setModuleName(m2, "");
assertEquals(INVALID_NAME, myModel.getModuleState(myModule1));
assertEquals(INVALID_NAME, myModel.getModuleState(m2));
}
use of com.android.tools.idea.gradle.project.ModuleToImport in project android by JetBrains.
the class ModulesListModelTest method testSelectedByDefault.
public void testSelectedByDefault() {
ModuleToImport nullLocation = new ModuleToImport("somename", null, NO_DEPS);
ModuleToImport existing = new ModuleToImport(EXISTING_MODULE, myModule2.location, NO_DEPS);
setModules(myModule1, nullLocation, existing);
assertTrue(myModel.isSelected(myModule1));
assertFalse(myModel.isSelected(nullLocation));
assertFalse(myModel.isSelected(existing));
}
use of com.android.tools.idea.gradle.project.ModuleToImport in project android by JetBrains.
the class ModulesListModelTest method assertContainsAll.
private static void assertContainsAll(ModuleListModel moduleListModel, ModuleToImport... expectedModules) {
Collection<ModuleToImport> modules = moduleListModel.getSelectedModules();
assertEquals(expectedModules.length, modules.size());
for (ModuleToImport module : expectedModules) {
assertTrue(String.format("Does not contain %s", module.name), modules.contains(module));
}
}
use of com.android.tools.idea.gradle.project.ModuleToImport in project android by JetBrains.
the class ModulesTable method getSelectedModulesMap.
public Map<String, VirtualFile> getSelectedModulesMap() {
final Collection<ModuleToImport> modules = myListModel.getSelectedModules();
if (modules.isEmpty()) {
return Collections.emptyMap();
}
Map<String, VirtualFile> selectedModules = Maps.newHashMap();
for (ModuleToImport module : modules) {
selectedModules.put(myListModel.getModuleName(module), module.location);
}
return selectedModules;
}
Aggregations