| java.lang.Object org.netbeans.spi.project.ui.templates.support.Templates
Templates | public class Templates (Code) | | Default implementations of template UI.
author: Jesse Glick et al. |
Method Summary | |
public static WizardDescriptor.Panel<WizardDescriptor> | createSimpleTargetChooser(Project project, SourceGroup[] folders) Create a basic target chooser suitable for many kinds of templates. | public static WizardDescriptor.Panel<WizardDescriptor> | createSimpleTargetChooser(Project project, SourceGroup[] folders, WizardDescriptor.Panel<WizardDescriptor> bottomPanel) Create a basic target chooser suitable for many kinds of templates. | public static FileObject | getExistingSourcesFolder(WizardDescriptor wizardDescriptor) Find the existing sources folder selected for a custom template wizard iterator. | public static Project | getProject(WizardDescriptor wizardDescriptor) Find the project selected for a custom template wizard iterator. | public static FileObject | getTargetFolder(WizardDescriptor wizardDescriptor) Find the target folder selected for a custom template wizard iterator.
If the user selects File | New File
this may not be set, unless you have called
Templates.setTargetFolder in an earlier panel (such as that created by
Templates.createSimpleTargetChooser(Project,SourceGroup[]) ).
It may however have a preselected folder, e.g. | public static String | getTargetName(WizardDescriptor wizardDescriptor) Method to communicate current choice of target name to a custom
WizardDescriptor.InstantiatingIterator associated with particular template. | public static FileObject | getTemplate(WizardDescriptor wizardDescriptor) Find the template with which a custom template wizard iterator is associated. | public static void | setTargetFolder(WizardDescriptor wizardDescriptor, FileObject folder) Stores a target folder so that it can be remembered later using
Templates.getTargetFolder . | public static void | setTargetName(WizardDescriptor wizardDescriptor, String targetName) |
createSimpleTargetChooser | public static WizardDescriptor.Panel<WizardDescriptor> createSimpleTargetChooser(Project project, SourceGroup[] folders)(Code) | | Create a basic target chooser suitable for many kinds of templates.
The user is prompted to choose a location for the new file and a (base) name.
Instantiation is handled by
DataObject.createFromTemplate .
Parameters: project - The project to work on. Parameters: folders - a list of possible roots to create the new file in a wizard panel(s) prompting the user to choose a name and location |
createSimpleTargetChooser | public static WizardDescriptor.Panel<WizardDescriptor> createSimpleTargetChooser(Project project, SourceGroup[] folders, WizardDescriptor.Panel<WizardDescriptor> bottomPanel)(Code) | | Create a basic target chooser suitable for many kinds of templates.
The user is prompted to choose a location for the new file and a (base) name.
Instantiation is handled by
DataObject.createFromTemplate .
Resulting panel can be decorated with additional panel placed below the standard target
chooser.
Parameters: project - The project to work on. Parameters: folders - a list of possible roots to create the new file in Parameters: bottomPanel - panel which should be placed underneth the default chooser a wizard panel(s) prompting the user to choose a name and location |
getExistingSourcesFolder | public static FileObject getExistingSourcesFolder(WizardDescriptor wizardDescriptor)(Code) | | Find the existing sources folder selected for a custom template wizard iterator.
This may not be set, unless you have CommonProjectActions.newProjectAction
with CommonProjectActions.EXISTING_SOURCES_FOLDER value.
Parameters: wizardDescriptor - the wizard as passed to WizardDescriptor.InstantiatingIterator.initializeor TemplateWizard.Iterator.initialize the existing sources folder from which the user has requested this iterator to create a project since: 1.3 (17th May 2005) |
getProject | public static Project getProject(WizardDescriptor wizardDescriptor)(Code) | | Find the project selected for a custom template wizard iterator.
If the user selects File | New File, this will be the project chosen in the first panel.
If the user selects New from
org.netbeans.spi.project.ui.support.CommonProjectActions.newFileAction , this will
be the project on which the context menu was invoked.
Parameters: wizardDescriptor - the wizard as passed to WizardDescriptor.InstantiatingIterator.initializeor TemplateWizard.Iterator.initialize the project into which the user has requested this iterator create a file (or null if not set) |
getTargetFolder | public static FileObject getTargetFolder(WizardDescriptor wizardDescriptor)(Code) | | Find the target folder selected for a custom template wizard iterator.
If the user selects File | New File
this may not be set, unless you have called
Templates.setTargetFolder in an earlier panel (such as that created by
Templates.createSimpleTargetChooser(Project,SourceGroup[]) ).
It may however have a preselected folder, e.g. if the user invoked New from
the context menu of a folder.
Parameters: wizardDescriptor - the wizard as passed to WizardDescriptor.InstantiatingIterator.initializeor TemplateWizard.Iterator.initialize the folder into which the user has requested this iterator create a file (or null if not set) |
getTargetName | public static String getTargetName(WizardDescriptor wizardDescriptor)(Code) | | Method to communicate current choice of target name to a custom
WizardDescriptor.InstantiatingIterator associated with particular template.
XXX why is this public? only used from NewFileIterator in projectui?
Parameters: wizardDescriptor - a file wizard the selected target name (could be null?) See Also: TemplateWizard.getTargetName See Also: ProjectChooserFactory.WIZARD_KEY_TARGET_NAME |
getTemplate | public static FileObject getTemplate(WizardDescriptor wizardDescriptor)(Code) | | Find the template with which a custom template wizard iterator is associated.
If the user selects File | New File, this will be the template chosen in the first panel.
If the user selects New from
org.netbeans.spi.project.ui.support.CommonProjectActions.newFileAction , this will
be the template selected from the context submenu.
Parameters: wizardDescriptor - the wizard as passed to WizardDescriptor.InstantiatingIterator.initializeor TemplateWizard.Iterator.initialize the corresponding template marker file (or null if not set) |
setTargetFolder | public static void setTargetFolder(WizardDescriptor wizardDescriptor, FileObject folder)(Code) | | Stores a target folder so that it can be remembered later using
Templates.getTargetFolder .
Parameters: wizardDescriptor - a template wizard Parameters: folder - a target folder to remember |
setTargetName | public static void setTargetName(WizardDescriptor wizardDescriptor, String targetName)(Code) | | Sets the target name for given WizardDescriptor to be used from
custom target choosers
XXX why is this public? only used from SimpleTargetChooserPanel in projectui?
Parameters: wizardDescriptor - a file wizard Parameters: targetName - a desired target name See Also: TemplateWizard.setTargetName See Also: ProjectChooserFactory.WIZARD_KEY_TARGET_NAME |
|
|