use of com.android.tools.idea.npw.deprecated.WrapArchiveWizardPath in project android by JetBrains.
the class TemplateWizardModuleBuilder method setupWizardPaths.
@Override
protected Iterable<WizardPath> setupWizardPaths(Project project, Icon sidePanelIcon, Disposable disposable) {
List<WizardPath> paths = Lists.newArrayList(super.setupWizardPaths(project, sidePanelIcon, disposable));
paths.add(new WrapArchiveWizardPath(myWizardState, project, this, sidePanelIcon));
return paths;
}
use of com.android.tools.idea.npw.deprecated.WrapArchiveWizardPath in project android by JetBrains.
the class NewModuleWizardTest method testBuildChooseModuleStep.
public void testBuildChooseModuleStep() throws Exception {
File otherTemplateDir = new File(TemplateManager.getTemplateRootFolder(), Template.CATEGORY_PROJECTS);
List<String> templateDirFiles = Arrays.asList(otherTemplateDir.list((file, name) -> !name.startsWith(".")));
int expectedCount = templateDirFiles.size() - 3 + 3;
WrapArchiveWizardPath wrapArchiveWizardPath = new WrapArchiveWizardPath(new NewModuleWizardState(), getProject(), () -> {
}, null);
expectedCount += wrapArchiveWizardPath.getBuiltInTemplates().size();
ArrayList<ModuleWizardStep> steps = Lists.newArrayList();
TemplateWizardModuleBuilder myModuleBuilder = new TemplateWizardModuleBuilder(null, myModule.getProject(), AndroidIcons.Wizards.NewModuleSidePanel, steps, getTestRootDisposable(), false) {
@Override
public void update() {
// Do nothing
}
};
assertInstanceOf(steps.get(0), ChooseTemplateStep.class);
ChooseTemplateStep chooseTemplateStep = (ChooseTemplateStep) steps.get(0);
// Make sure we've got an actual object
assertNotNull(chooseTemplateStep);
DefaultListModel templateMetadatas = (DefaultListModel) chooseTemplateStep.myTemplateList.getModel();
Set<String> templateNames = new HashSet<>(templateMetadatas.getSize());
for (Object o : templateMetadatas.toArray()) {
templateNames.add(o.toString());
}
// Make sure we have the right number of choices
assertEquals(expectedCount, templateMetadatas.getSize());
// Ensure we're not offering duplicate elements in the list
assertEquals(templateNames.size(), templateMetadatas.getSize());
}
Aggregations