Lines 55-65
Link Here
|
55 |
* @throws IllegalArgumentException if folders is empty |
55 |
* @throws IllegalArgumentException if folders is empty |
56 |
*/ |
56 |
*/ |
57 |
public static WizardDescriptor.Panel createPackageChooser(Project project, SourceGroup[] folders, WizardDescriptor.Panel bottomPanel) throws IllegalArgumentException { |
57 |
public static WizardDescriptor.Panel createPackageChooser(Project project, SourceGroup[] folders, WizardDescriptor.Panel bottomPanel) throws IllegalArgumentException { |
|
|
58 |
return createPackageChooser(project, folders, bottomPanel, false); |
59 |
} |
60 |
|
61 |
/** |
62 |
* Create a Java-oriented target chooser suitable for templates which are Java |
63 |
* sources or otherwise intended to reside in a Java package. |
64 |
* The user is prompted to choose a package location for the new file and a (base) name; |
65 |
* this method allows to specify whether a valid (non-empty) package is required. |
66 |
* Resulting panel can be decorated with additional panel. Which will |
67 |
* be placed below the standard package chooser. |
68 |
* @param project the project which the template will be created in |
69 |
* @param folders a list of possible Java package roots to create the new file in (must be nonempty) |
70 |
* @param bottomPanel panel which should be placed underneth the default chooser |
71 |
* @param validPackageRequired indicates whether a only a valid (non-empty) package is accepted |
72 |
* @return a wizard panel prompting the user to choose a name and package |
73 |
* @throws IllegalArgumentException if folders is empty |
74 |
*/ |
75 |
public static WizardDescriptor.Panel createPackageChooser(Project project, SourceGroup[] folders, |
76 |
WizardDescriptor.Panel bottomPanel, boolean validPackageRequired) throws IllegalArgumentException { |
58 |
if (folders.length == 0) { |
77 |
if (folders.length == 0) { |
59 |
throw new IllegalArgumentException("No folders selected"); // NOI18N |
78 |
throw new IllegalArgumentException("No folders selected"); // NOI18N |
60 |
} |
79 |
} |
61 |
return new JavaTargetChooserPanel(project, folders, bottomPanel, false ); |
80 |
return new JavaTargetChooserPanel(project, folders, bottomPanel, false, validPackageRequired); |
62 |
} |
81 |
} |
63 |
|
82 |
|
64 |
/** Creates new WizardIterator containing standard Package chooser |
83 |
/** Creates new WizardIterator containing standard Package chooser |
65 |
* @return WizardIterator consisting of one panel containing package chooser |
84 |
* @return WizardIterator consisting of one panel containing package chooser |