cvs diff (in directory P:\trunk\nb_all\java\project\) Index: apichanges.xml =================================================================== RCS file: /cvs/java/project/apichanges.xml,v retrieving revision 1.6 diff -u -r1.6 apichanges.xml --- apichanges.xml 16 Jan 2005 22:20:58 -0000 1.6 +++ apichanges.xml 21 Mar 2005 13:10:07 -0000 @@ -80,6 +80,23 @@ + Added a new factory method for creating the name/package chooser wizard panel into the templates SPI. + + + + + +

+ A new factory method for creating the name and package chooser panel in the Java file wizard. + This method is similar to the methods that already exist in this class; it has an extra boolean + parameter that allows to specify whether the entered package name is required to be valid (non-empty). +

+
+ + +
+ + The functionality of PackageListView was moved into PackageView support SPI. Index: src/org/netbeans/spi/java/project/support/ui/templates/JavaTemplates.java =================================================================== RCS file: /cvs/java/project/src/org/netbeans/spi/java/project/support/ui/templates/JavaTemplates.java,v retrieving revision 1.13 diff -u -r1.13 JavaTemplates.java --- src/org/netbeans/spi/java/project/support/ui/templates/JavaTemplates.java 18 Mar 2005 09:19:56 -0000 1.13 +++ src/org/netbeans/spi/java/project/support/ui/templates/JavaTemplates.java 21 Mar 2005 13:10:07 -0000 @@ -55,11 +55,30 @@ * @throws IllegalArgumentException if folders is empty */ public static WizardDescriptor.Panel createPackageChooser(Project project, SourceGroup[] folders, WizardDescriptor.Panel bottomPanel) throws IllegalArgumentException { + return createPackageChooser(project, folders, bottomPanel, false); + } + + /** + * Create a Java-oriented target chooser suitable for templates which are Java + * sources or otherwise intended to reside in a Java package. + * The user is prompted to choose a package location for the new file and a (base) name; + * this method allows to specify whether a valid (non-empty) package is required. + * Resulting panel can be decorated with additional panel. Which will + * be placed below the standard package chooser. + * @param project the project which the template will be created in + * @param folders a list of possible Java package roots to create the new file in (must be nonempty) + * @param bottomPanel panel which should be placed underneth the default chooser + * @param validPackageRequired indicates whether a only a valid (non-empty) package is accepted + * @return a wizard panel prompting the user to choose a name and package + * @throws IllegalArgumentException if folders is empty + */ + public static WizardDescriptor.Panel createPackageChooser(Project project, SourceGroup[] folders, + WizardDescriptor.Panel bottomPanel, boolean validPackageRequired) throws IllegalArgumentException { if (folders.length == 0) { throw new IllegalArgumentException("No folders selected"); // NOI18N } - return new JavaTargetChooserPanel(project, folders, bottomPanel, false ); - } + return new JavaTargetChooserPanel(project, folders, bottomPanel, false, validPackageRequired); + } /** Creates new WizardIterator containing standard Package chooser * @return WizardIterator consisting of one panel containing package chooser *****CVS exited normally with code 1*****