@Override public boolean validate() throws ConfigurationException { ProjectTemplate template = getSelectedTemplate(); if (template == null) { throw new ConfigurationException( StringUtil.capitalize( ProjectBundle.message( "project.new.wizard.from.template.error", myWizardContext.getPresentationName())), "Error"); } if (myWizardContext.isCreatingNewProject()) { if (!myNamePathComponent.validateNameAndPath(myWizardContext, myFormatPanel.isDefault())) return false; } if (!validateModulePaths()) return false; if (!myWizardContext.isCreatingNewProject()) { validateExistingModuleName(); } ValidationInfo info = template.validateSettings(); if (info != null) { throw new ConfigurationException(info.message, "Error"); } if (mySettingsStep != null) { return mySettingsStep.validate(); } return true; }
private void setupPanels(@Nullable ProjectTemplate template) { restorePanel(myNamePathComponent, 4); restorePanel(myModulePanel, myWizardContext.isCreatingNewProject() ? 8 : 6); restorePanel(myExpertPanel, myWizardContext.isCreatingNewProject() ? 1 : 0); mySettingsStep = myModuleBuilder == null ? null : myModuleBuilder.modifySettingsStep(this); String description = null; if (template != null) { description = template.getDescription(); if (StringUtil.isNotEmpty(description)) { StringBuilder sb = new StringBuilder("<html><body><font "); sb.append(SystemInfo.isMac ? "" : "face=\"Verdana\" size=\"-1\"").append('>'); sb.append(description).append("</font></body></html>"); description = sb.toString(); myDescriptionPane.setText(description); } } myExpertPlaceholder.setVisible( !(myModuleBuilder instanceof TemplateModuleBuilder) && myExpertPanel.getComponentCount() > 0); for (int i = 0; i < 6; i++) { myModulePanel.getComponent(i).setVisible(!(myModuleBuilder instanceof EmptyModuleBuilder)); } myDescriptionPanel.setVisible(StringUtil.isNotEmpty(description)); mySettingsPanel.revalidate(); mySettingsPanel.repaint(); }
@Nullable @Override protected ModuleBuilder create(ProjectTemplate key) { return (ModuleBuilder) key.createModuleBuilder(); }
@Nullable String getDescription() { return myTemplate.getDescription(); }
Icon getIcon() { return myTemplate.createModuleBuilder().getNodeIcon(); }
String getName() { return myTemplate.getName(); }