1 19 20 package org.netbeans.modules.java.freeform.spi.support; 21 22 import java.io.IOException ; 23 import org.netbeans.modules.java.freeform.ui.ClasspathWizardPanel; 24 import org.netbeans.modules.java.freeform.ui.NewJ2SEFreeformProjectWizardIterator; 25 import org.netbeans.modules.java.freeform.ui.ProjectModel; 26 import org.netbeans.modules.java.freeform.ui.SourceFoldersPanel; 27 import org.netbeans.modules.java.freeform.ui.SourceFoldersWizardPanel; 28 import org.netbeans.spi.project.support.ant.AntProjectHelper; 29 import org.openide.WizardDescriptor; 30 31 55 public class NewJavaFreeformProjectSupport { 56 57 58 public static final String PROP_EXTRA_JAVA_SOURCE_FOLDERS = "sourceFolders"; 60 private NewJavaFreeformProjectSupport() { 61 } 62 63 67 public static WizardDescriptor.Panel[] createJavaPanels() { 68 return new WizardDescriptor.Panel[]{new SourceFoldersWizardPanel(), new ClasspathWizardPanel()}; 69 } 70 71 77 public static boolean enableNextButton(WizardDescriptor.Panel panel) { 78 if (panel instanceof SourceFoldersWizardPanel) { 79 SourceFoldersPanel sfp = (SourceFoldersPanel)panel.getComponent(); 80 if (!sfp.hasSomeSourceFolder()) { 81 return false; 82 } 83 } 84 return true; 85 } 86 87 92 public static void instantiateJavaPanels(AntProjectHelper helper, WizardDescriptor wiz) throws IOException { 93 ProjectModel pm = (ProjectModel)wiz.getProperty(NewJ2SEFreeformProjectWizardIterator.PROP_PROJECT_MODEL); 94 ProjectModel.instantiateJavaProject(helper, pm); 95 } 96 97 100 public static void uninitializeJavaPanels(WizardDescriptor wiz) { 101 wiz.putProperty(NewJavaFreeformProjectSupport.PROP_EXTRA_JAVA_SOURCE_FOLDERS, null); 102 wiz.putProperty(NewJ2SEFreeformProjectWizardIterator.PROP_PROJECT_MODEL, null); 103 } 104 105 } 106 | Popular Tags |