|
org.netbeans.modules.projectuiapi/1 1.24.0 6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.spi.project.ui.templates.support.Templates
public class Templates
Default implementations of template UI.
Method Summary | |
---|---|
static WizardDescriptor.Panel<WizardDescriptor> |
createSimpleTargetChooser(Project project,
SourceGroup[] folders)
Create a basic target chooser suitable for many kinds of templates. |
static WizardDescriptor.Panel<WizardDescriptor> |
createSimpleTargetChooser(Project project,
SourceGroup[] folders,
WizardDescriptor.Panel<WizardDescriptor> bottomPanel)
Create a basic target chooser suitable for many kinds of templates. |
static FileObject |
getExistingSourcesFolder(WizardDescriptor wizardDescriptor)
Find the existing sources folder selected for a custom template wizard iterator. |
static Project |
getProject(WizardDescriptor wizardDescriptor)
Find the project selected for a custom template wizard iterator. |
static FileObject |
getTargetFolder(WizardDescriptor wizardDescriptor)
Find the target folder selected for a custom template wizard iterator. |
static String |
getTargetName(WizardDescriptor wizardDescriptor)
Method to communicate current choice of target name to a custom WizardDescriptor.InstantiatingIterator associated with particular template. |
static FileObject |
getTemplate(WizardDescriptor wizardDescriptor)
Find the template with which a custom template wizard iterator is associated. |
static void |
setTargetFolder(WizardDescriptor wizardDescriptor,
FileObject folder)
Stores a target folder so that it can be remembered later using getTargetFolder(org.openide.WizardDescriptor) . |
static void |
setTargetName(WizardDescriptor wizardDescriptor,
String targetName)
Sets the target name for given WizardDescriptor to be used from custom target choosers |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Project getProject(WizardDescriptor wizardDescriptor)
If the user selects File | New File, this will be the project chosen in the first panel.
If the user selects New from CommonProjectActions.newFileAction()
, this will
be the project on which the context menu was invoked.
wizardDescriptor
- the wizard as passed to WizardDescriptor.InstantiatingIterator#initialize
or TemplateWizard.Iterator#initialize
public static FileObject getTemplate(WizardDescriptor wizardDescriptor)
If the user selects File | New File, this will be the template chosen in the first panel.
If the user selects New from CommonProjectActions.newFileAction()
, this will
be the template selected from the context submenu.
wizardDescriptor
- the wizard as passed to WizardDescriptor.InstantiatingIterator#initialize
or TemplateWizard.Iterator#initialize
public static FileObject getTargetFolder(WizardDescriptor wizardDescriptor)
If the user selects File | New File
this may not be set, unless you have called setTargetFolder(org.openide.WizardDescriptor, org.openide.filesystems.FileObject)
in an earlier panel (such as that created by createSimpleTargetChooser(Project,SourceGroup[])
).
It may however have a preselected folder, e.g. if the user invoked New from
the context menu of a folder.
wizardDescriptor
- the wizard as passed to WizardDescriptor.InstantiatingIterator#initialize
or TemplateWizard.Iterator#initialize
public static FileObject getExistingSourcesFolder(WizardDescriptor wizardDescriptor)
This may not be set, unless you have CommonProjectActions.newProjectAction with CommonProjectActions.EXISTING_SOURCES_FOLDER value.
wizardDescriptor
- the wizard as passed to WizardDescriptor.InstantiatingIterator#initialize
or TemplateWizard.Iterator#initialize
public static void setTargetFolder(WizardDescriptor wizardDescriptor, FileObject folder)
getTargetFolder(org.openide.WizardDescriptor)
.
wizardDescriptor
- a template wizardfolder
- a target folder to rememberpublic static String getTargetName(WizardDescriptor wizardDescriptor)
WizardDescriptor.InstantiatingIterator
associated with particular template.
XXX why is this public? only used from NewFileIterator in projectui?
wizardDescriptor
- a file wizard
TemplateWizard.getTargetName()
,
ProjectChooserFactory.WIZARD_KEY_TARGET_NAME
public static void setTargetName(WizardDescriptor wizardDescriptor, String targetName)
XXX why is this public? only used from SimpleTargetChooserPanel in projectui?
wizardDescriptor
- a file wizardtargetName
- a desired target nameTemplateWizard.setTargetName(java.lang.String)
,
ProjectChooserFactory.WIZARD_KEY_TARGET_NAME
public static WizardDescriptor.Panel<WizardDescriptor> createSimpleTargetChooser(Project project, SourceGroup[] folders)
DataObject.createFromTemplate(org.openide.loaders.DataFolder)
.
project
- The project to work on.folders
- a list of possible roots to create the new file in
public static WizardDescriptor.Panel<WizardDescriptor> createSimpleTargetChooser(Project project, SourceGroup[] folders, WizardDescriptor.Panel<WizardDescriptor> bottomPanel)
DataObject.createFromTemplate(org.openide.loaders.DataFolder)
.
Resulting panel can be decorated with additional panel placed below the standard target
chooser.
project
- The project to work on.folders
- a list of possible roots to create the new file inbottomPanel
- panel which should be placed underneth the default chooser
|
org.netbeans.modules.projectuiapi/1 1.24.0 6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |