org.netbeans.modules.java.project/1 1.46

org.netbeans.spi.java.project.support.ui.templates
Class JavaTemplates

java.lang.Object
  extended by org.netbeans.spi.java.project.support.ui.templates.JavaTemplates

public class JavaTemplates
extends Object

Default implementations of Java-specific template UI.


Field Summary
static String JAVA_ICON
          Icon for Java templates.
 
Method Summary
static WizardDescriptor.InstantiatingIterator<WizardDescriptor> createJavaTemplateIterator()
          Creates new WizardIterator containing standard Package chooser.
static WizardDescriptor.Panel<WizardDescriptor> createPackageChooser(Project project, SourceGroup[] folders)
          Create a Java-oriented target chooser suitable for templates which are Java sources or otherwise intended to reside in a Java package.
static WizardDescriptor.Panel<WizardDescriptor> createPackageChooser(Project project, SourceGroup[] folders, WizardDescriptor.Panel<WizardDescriptor> bottomPanel)
          Create a Java-oriented target chooser suitable for templates which are Java sources or otherwise intended to reside in a Java package.
static WizardDescriptor.Panel<WizardDescriptor> createPackageChooser(Project project, SourceGroup[] folders, WizardDescriptor.Panel<WizardDescriptor> bottomPanel, boolean validPackageRequired)
          Create a Java-oriented target chooser suitable for templates which are Java sources or otherwise intended to reside in a Java package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_ICON

public static final String JAVA_ICON
Icon for Java templates.

Since:
1.40
See Also:
createJavaTemplateIterator(), Constant Field Values
Method Detail

createPackageChooser

public static WizardDescriptor.Panel<WizardDescriptor> createPackageChooser(Project project,
                                                                            SourceGroup[] folders)
                                                                     throws IllegalArgumentException
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.

Parameters:
project - the project which the template will be created in
folders - a list of possible Java package roots to create the new file in (must be nonempty)
Returns:
a wizard panel prompting the user to choose a name and package
Throws:
IllegalArgumentException - if folders is empty

createPackageChooser

public static WizardDescriptor.Panel<WizardDescriptor> createPackageChooser(Project project,
                                                                            SourceGroup[] folders,
                                                                            WizardDescriptor.Panel<WizardDescriptor> bottomPanel)
                                                                     throws IllegalArgumentException
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. Resulting panel can be decorated with additional panel. Which will be placed below the standard package chooser.

Parameters:
project - the project which the template will be created in
folders - a list of possible Java package roots to create the new file in (must be nonempty)
bottomPanel - panel which should be placed underneth the default chooser
Returns:
a wizard panel prompting the user to choose a name and package
Throws:
IllegalArgumentException - if folders is empty

createPackageChooser

public static WizardDescriptor.Panel<WizardDescriptor> createPackageChooser(Project project,
                                                                            SourceGroup[] folders,
                                                                            WizardDescriptor.Panel<WizardDescriptor> bottomPanel,
                                                                            boolean validPackageRequired)
                                                                     throws IllegalArgumentException
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.

Parameters:
project - the project which the template will be created in
folders - a list of possible Java package roots to create the new file in (must be nonempty)
bottomPanel - panel which should be placed underneth the default chooser
validPackageRequired - indicates whether a only a valid (non-empty) package is accepted
Returns:
a wizard panel prompting the user to choose a name and package
Throws:
IllegalArgumentException - if folders is empty
Since:
org.netbeans.modules.java.project/1 1.3

createJavaTemplateIterator

public static WizardDescriptor.InstantiatingIterator<WizardDescriptor> createJavaTemplateIterator()
Creates new WizardIterator containing standard Package chooser. Sample usage:
 @TemplateRegistration(..., iconBase=JavaTemplates.JAVA_ICON)
 public static WizardDescriptor.InstantiatingIterator<?> myTemplates() {
     return JavaTemplates.createJavaTemplateIterator();
 }
 

Returns:
WizardIterator consisting of one panel containing package chooser
See Also:
TemplateRegistration, JAVA_ICON

org.netbeans.modules.java.project/1 1.46

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.