1 19 20 package org.netbeans.modules.apisupport.project.ui.wizard; 21 22 import java.awt.Component ; 23 import java.io.File ; 24 import org.openide.WizardDescriptor; 25 import org.openide.WizardValidationException; 26 import org.openide.util.HelpCtx; 27 28 43 final class BasicInfoWizardPanel extends BasicWizardPanel.NewTemplatePanel implements WizardDescriptor.ValidatingPanel { 44 45 46 private BasicInfoVisualPanel visualPanel; 47 48 49 public BasicInfoWizardPanel(final NewModuleProjectData data) { 50 super(data); 51 } 52 53 public void reloadData() { 54 getVisualPanel().refreshData(); 55 } 56 57 public void storeData() { 58 getVisualPanel().storeData(); 59 } 60 61 private BasicInfoVisualPanel getVisualPanel() { 62 return (BasicInfoVisualPanel) getComponent(); 63 } 64 65 public Component getComponent() { 66 if (visualPanel == null) { 67 visualPanel = new BasicInfoVisualPanel(getData()); 68 visualPanel.addPropertyChangeListener(this); 69 visualPanel.setName(getMessage("LBL_BasicInfoPanel_Title")); 70 visualPanel.updateAndCheck(); 71 } 72 return visualPanel; 73 } 74 75 public HelpCtx getHelp() { 76 return new HelpCtx(BasicInfoWizardPanel.class.getName() + "_" + getWizardTypeString()); 77 } 78 79 public void validate() throws WizardValidationException { 80 String prjFolder = getData().getProjectFolder(); 83 if (prjFolder != null) { 84 File prjFolderF = new File (prjFolder); 85 if (prjFolderF.mkdir()) { 86 prjFolderF.delete(); 87 } else { 88 String message = getMessage("MSG_UnableToCreateProjectFolder"); 89 throw new WizardValidationException(getVisualPanel().nameValue, message, message); 90 } 91 } 92 } 93 94 } 95 | Popular Tags |