public class TemplateWizard
extends org.openide.WizardDescriptor
TemplateRegistration| Modifier and Type | Class | Description |
|---|---|---|
static interface |
TemplateWizard.Iterator |
The interface for custom iterator.
|
org.openide.NotifyDescriptor.Confirmation, org.openide.NotifyDescriptor.Exception, org.openide.NotifyDescriptor.InputLine, org.openide.NotifyDescriptor.Messageorg.openide.WizardDescriptor.ArrayIterator<Data extends java.lang.Object>, org.openide.WizardDescriptor.AsynchronousInstantiatingIterator<Data extends java.lang.Object>, org.openide.WizardDescriptor.AsynchronousValidatingPanel<Data extends java.lang.Object>, org.openide.WizardDescriptor.BackgroundInstantiatingIterator<Data extends java.lang.Object>, org.openide.WizardDescriptor.ExtendedAsynchronousValidatingPanel<Data extends java.lang.Object>, org.openide.WizardDescriptor.FinishablePanel<Data extends java.lang.Object>, org.openide.WizardDescriptor.FinishPanel<Data extends java.lang.Object>, org.openide.WizardDescriptor.InstantiatingIterator<Data extends java.lang.Object>, org.openide.WizardDescriptor.Panel<Data extends java.lang.Object>, org.openide.WizardDescriptor.ProgressInstantiatingIterator<Data extends java.lang.Object>, org.openide.WizardDescriptor.ValidatingPanel<Data extends java.lang.Object>BOTTOM_ALIGN, DEFAULT_ALIGN, PROP_BUTTON_LISTENER, PROP_CLOSING_OPTIONS, PROP_HELP_CTX, PROP_LEAF, PROP_MODAL, PROP_OPTIONS_ALIGN, RIGHT_ALIGNCANCEL_OPTION, CLOSED_OPTION, DEFAULT_OPTION, ERROR_MESSAGE, INFORMATION_MESSAGE, NO_OPTION, OK_CANCEL_OPTION, OK_OPTION, PLAIN_MESSAGE, PROP_DETAIL, PROP_ERROR_NOTIFICATION, PROP_INFO_NOTIFICATION, PROP_MESSAGE, PROP_MESSAGE_TYPE, PROP_NO_DEFAULT_CLOSE, PROP_OPTION_TYPE, PROP_OPTIONS, PROP_TITLE, PROP_VALID, PROP_VALUE, PROP_WARNING_NOTIFICATION, QUESTION_MESSAGE, WARNING_MESSAGE, YES_NO_CANCEL_OPTION, YES_NO_OPTION, YES_OPTIONFINISH_OPTION, NEXT_OPTION, PREVIOUS_OPTION, PROP_AUTO_WIZARD_STYLE, PROP_CONTENT_BACK_COLOR, PROP_CONTENT_DATA, PROP_CONTENT_DISPLAYED, PROP_CONTENT_FOREGROUND_COLOR, PROP_CONTENT_NUMBERED, PROP_CONTENT_SELECTED_INDEX, PROP_ERROR_MESSAGE, PROP_HELP_DISPLAYED, PROP_HELP_URL, PROP_IMAGE, PROP_IMAGE_ALIGNMENT, PROP_INFO_MESSAGE, PROP_LEFT_DIMENSION, PROP_WARNING_MESSAGE| Modifier | Constructor | Description |
|---|---|---|
|
TemplateWizard() |
Creates new TemplateWizard
|
protected |
TemplateWizard(TemplateWizard.Iterator it) |
Constructor
for wizards that require the target chooser or template
chooser panel.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected TemplateWizard.Iterator |
createDefaultIterator() |
Allows subclasses to provide their own default iterator
the one that will be used if not special iterator is associated
with selected template.
|
protected org.openide.WizardDescriptor.Panel<org.openide.WizardDescriptor> |
createTargetChooser() |
Method that allows subclasses to second (default) panel.
|
protected org.openide.WizardDescriptor.Panel<org.openide.WizardDescriptor> |
createTemplateChooser() |
Method that allows subclasses to provide their own panel
for choosing the template (the first panel).
|
static java.net.URL |
getDescription(DataObject obj) |
Method to get a description for a data object.
|
static java.lang.String |
getDescriptionAsResource(DataObject obj) |
Deprecated.
Use
getDescription(org.openide.loaders.DataObject) instead. |
static TemplateWizard.Iterator |
getIterator(DataObject obj) |
Finds a custom iterator attached to a template that should
be used to instantiate the object.
|
DataFolder |
getTargetFolder() |
Getter for target folder.
|
java.lang.String |
getTargetName() |
Getter for the name of the target template.
|
DataObject |
getTemplate() |
Getter for template to create object from.
|
DataFolder |
getTemplatesFolder() |
Getter for the folder with templates.
|
java.text.MessageFormat |
getTitleFormat() |
Overridden to be able to set a default value for the title format.
|
protected java.util.Set<DataObject> |
handleInstantiate() |
Calls iterator's instantiate.
|
protected void |
initialize() |
Initializes important settings.
|
java.util.Set<DataObject> |
instantiate() |
Chooses the template and instantiates it.
|
java.util.Set<DataObject> |
instantiate(DataObject template) |
Chooses the template and instantiates it.
|
java.util.Set<DataObject> |
instantiate(DataObject template,
DataFolder targetFolder) |
Chooses the template and instantiates it.
|
static void |
setDescription(DataObject obj,
java.net.URL url) |
Method to attach a description to a data object.
|
static void |
setDescriptionAsResource(DataObject obj,
java.lang.String rsrc) |
Deprecated.
|
static void |
setIterator(DataObject obj,
TemplateWizard.Iterator iter) |
Deprecated.
since 2.13 you should provide the iterator from
getCookie method |
void |
setTargetFolder(DataFolder f) |
Sets the target folder.
|
void |
setTargetName(java.lang.String name) |
Setter for the name of the template.
|
void |
setTemplate(DataObject obj) |
Sets the template.
|
void |
setTemplatesFolder(DataFolder folder) |
Setter for the folder with templates.
|
void |
setTitleFormat(java.text.MessageFormat format) |
Overridden to be able to set own default value for the title format.
|
org.openide.WizardDescriptor.Panel<org.openide.WizardDescriptor> |
targetChooser() |
Returns wizard panel that that is used to choose target folder and
name of the template.
|
org.openide.WizardDescriptor.Panel<org.openide.WizardDescriptor> |
templateChooser() |
Returns wizard panel that is used to choose a template.
|
protected void |
updateState() |
Overriden to add/remove listener to/from displayed component.
|
getButtonListener, getClosingOptions, getHelpCtx, getOptionsAlign, isLeaf, isModal, setButtonListener, setLeaf, setModal, setOptionsAlignaddPropertyChangeListener, createNotificationLineSupport, firePropertyChange, getAdditionalOptions, getDefaultValue, getMessage, getMessageType, getNotificationLineSupport, getOptions, getOptionType, getTitle, getTitleForType, isNoDefaultClose, isValid, removePropertyChangeListener, setMessage, setMessageType, setNoDefaultClose, setOptionType, setTitle, setValidpublic TemplateWizard()
protected TemplateWizard(TemplateWizard.Iterator it)
it - panel iterator instanceprotected void initialize()
initialize in class org.openide.WizardDescriptorpublic DataObject getTemplate()
public void setTemplate(DataObject obj)
obj - the template to start withpublic void setTemplatesFolder(DataFolder folder)
folder - the root folder for all templates if null the
default folder is usedpublic DataFolder getTemplatesFolder()
public DataFolder getTargetFolder() throws java.io.IOException
java.io.IOException - if the target folder has not been setpublic void setTargetFolder(DataFolder f)
f - the folderpublic java.lang.String getTargetName()
null if not yet setpublic void setTargetName(java.lang.String name)
name - name for the new object, or nullpublic org.openide.WizardDescriptor.Panel<org.openide.WizardDescriptor> templateChooser()
public org.openide.WizardDescriptor.Panel<org.openide.WizardDescriptor> targetChooser()
protected org.openide.WizardDescriptor.Panel<org.openide.WizardDescriptor> createTemplateChooser()
protected org.openide.WizardDescriptor.Panel<org.openide.WizardDescriptor> createTargetChooser()
protected TemplateWizard.Iterator createDefaultIterator()
This implementation creates iterator that just shows the targetChooser panel.
public java.util.Set<DataObject> instantiate() throws java.io.IOException
Beware that this blocks while the wizard is running;
and if a WizardDescriptor.BackgroundInstantiatingIterator might be selected,
should not be called from the AWT event queue.
java.io.IOException - I/O errorpublic java.util.Set<DataObject> instantiate(DataObject template) throws java.io.IOException
instantiate() regarding threading behavior.template - predefined template that should be instantiatedjava.io.IOException - I/O errorpublic java.util.Set<DataObject> instantiate(DataObject template, DataFolder targetFolder) throws java.io.IOException
instantiate() regarding threading behavior.template - predefined template that should be instantiatedtargetFolder - the target folderjava.io.IOException - I/O errorpublic void setTitleFormat(java.text.MessageFormat format)
setTitleFormat in class org.openide.WizardDescriptorformat - message formatpublic java.text.MessageFormat getTitleFormat()
getTitleFormat in class org.openide.WizardDescriptorprotected java.util.Set<DataObject> handleInstantiate() throws java.io.IOException
java.io.IOException - if the instantiation failspublic static void setDescription(DataObject obj, java.net.URL url) throws java.io.IOException
nbresloc protocol.obj - data object to attach description tourl - the url with description or null if there should be
no descriptionjava.io.IOException - if I/O failspublic static java.net.URL getDescription(DataObject obj)
obj - data object to attach description to@Deprecated public static void setDescriptionAsResource(DataObject obj, java.lang.String rsrc) throws java.io.IOException
setDescription(org.openide.loaders.DataObject, java.net.URL) instead.obj - data object to set description forrsrc - a resource string, e.g. "com/foo/MyPage.html", or null to clearjava.io.IOException - if the attribute cannot be set@Deprecated public static java.lang.String getDescriptionAsResource(DataObject obj)
getDescription(org.openide.loaders.DataObject) instead.obj - the data objectnull if unset (incl. if only set as a raw URL)@Deprecated public static void setIterator(DataObject obj, TemplateWizard.Iterator iter) throws java.io.IOException
getCookie method
Better way for providing an Iterator is to return it from the
dataobject.getCookie (TemplateWizard.Iterator.class)
call.
obj - data objectiter - TemplateWizard.Iterator to use for instantiation of this
data object, or null to clearjava.io.IOException - if I/O failspublic static TemplateWizard.Iterator getIterator(DataObject obj)
setIterator method, if not it asks the
data object for the Iterator as cookie.obj - the data objectprotected void updateState()
updateState in class org.openide.WizardDescriptorBuilt on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.