|
org.openide.loaders 6.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openide.NotifyDescriptor
org.openide.DialogDescriptor
org.openide.WizardDescriptor
org.openide.loaders.TemplateWizard
public class TemplateWizard
Wizard for creation of new objects from a template.
| Nested Class Summary | |
|---|---|
static interface |
TemplateWizard.Iterator
The interface for custom iterator. |
| Nested classes/interfaces inherited from class org.openide.WizardDescriptor |
|---|
WizardDescriptor.ArrayIterator<Data>, WizardDescriptor.AsynchronousInstantiatingIterator<Data>, WizardDescriptor.AsynchronousValidatingPanel<Data>, WizardDescriptor.FinishablePanel<Data>, WizardDescriptor.FinishPanel<Data>, WizardDescriptor.InstantiatingIterator<Data>, WizardDescriptor.Panel<Data>, WizardDescriptor.ProgressInstantiatingIterator<Data>, WizardDescriptor.ValidatingPanel<Data> |
| Nested classes/interfaces inherited from class org.openide.NotifyDescriptor |
|---|
NotifyDescriptor.Confirmation, NotifyDescriptor.Exception, NotifyDescriptor.InputLine, NotifyDescriptor.Message |
| Field Summary |
|---|
| Fields inherited from class org.openide.WizardDescriptor |
|---|
FINISH_OPTION, NEXT_OPTION, PREVIOUS_OPTION |
| Fields inherited from class org.openide.DialogDescriptor |
|---|
BOTTOM_ALIGN, DEFAULT_ALIGN, PROP_BUTTON_LISTENER, PROP_CLOSING_OPTIONS, PROP_HELP_CTX, PROP_LEAF, PROP_MODAL, PROP_OPTIONS_ALIGN, RIGHT_ALIGN |
| Fields inherited from class org.openide.NotifyDescriptor |
|---|
CANCEL_OPTION, CLOSED_OPTION, DEFAULT_OPTION, ERROR_MESSAGE, INFORMATION_MESSAGE, NO_OPTION, OK_CANCEL_OPTION, OK_OPTION, PLAIN_MESSAGE, PROP_DETAIL, PROP_MESSAGE, PROP_MESSAGE_TYPE, PROP_OPTION_TYPE, PROP_OPTIONS, PROP_TITLE, PROP_VALID, PROP_VALUE, QUESTION_MESSAGE, WARNING_MESSAGE, YES_NO_CANCEL_OPTION, YES_NO_OPTION, YES_OPTION |
| Constructor Summary | |
|---|---|
|
TemplateWizard()
Creates new TemplateWizard |
protected |
TemplateWizard(TemplateWizard.Iterator it)
Constructor for wizards that require the target chooser or template chooser panel. |
| Method Summary | |
|---|---|
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 WizardDescriptor.Panel<WizardDescriptor> |
createTargetChooser()
Method that allows subclasses to second (default) panel. |
protected WizardDescriptor.Panel<WizardDescriptor> |
createTemplateChooser()
Method that allows subclasses to provide their own panel for choosing the template (the first panel). |
static URL |
getDescription(DataObject obj)
Method to get a description for a data object. |
static 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. |
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. |
MessageFormat |
getTitleFormat()
Overridden to be able to set a default value for the title format. |
protected Set<DataObject> |
handleInstantiate()
Calls iterator's instantiate. |
protected void |
initialize()
Initializes important settings. |
Set<DataObject> |
instantiate()
Chooses the template and instantiates it. |
Set<DataObject> |
instantiate(DataObject template)
Chooses the template and instantiates it. |
Set<DataObject> |
instantiate(DataObject template,
DataFolder targetFolder)
Chooses the template and instantiates it. |
static void |
setDescription(DataObject obj,
URL url)
Method to attach a description to a data object. |
static void |
setDescriptionAsResource(DataObject obj,
String rsrc)
Deprecated. Use setDescription(org.openide.loaders.DataObject, java.net.URL) instead. |
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(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(MessageFormat format)
Overridden to be able to set own default value for the title format. |
WizardDescriptor.Panel<WizardDescriptor> |
targetChooser()
Returns wizard panel that that is used to choose target folder and name of the template. |
WizardDescriptor.Panel<WizardDescriptor> |
templateChooser()
Returns wizard panel that is used to choose a template. |
protected void |
updateState()
Overriden to add/remove listener to/from displayed component. |
| Methods inherited from class org.openide.WizardDescriptor |
|---|
getInstantiatedObjects, getProperties, getProperty, getValue, putProperty, setAdditionalOptions, setClosingOptions, setHelpCtx, setOptions, setPanels, setPanelsAndSettings, setValue |
| Methods inherited from class org.openide.DialogDescriptor |
|---|
getButtonListener, getClosingOptions, getHelpCtx, getOptionsAlign, isLeaf, isModal, setButtonListener, setLeaf, setModal, setOptionsAlign |
| Methods inherited from class org.openide.NotifyDescriptor |
|---|
addPropertyChangeListener, firePropertyChange, getAdditionalOptions, getDefaultValue, getMessage, getMessageType, getOptions, getOptionType, getTitle, getTitleForType, isValid, removePropertyChangeListener, setMessage, setMessageType, setOptionType, setTitle, setValid |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TemplateWizard()
protected TemplateWizard(TemplateWizard.Iterator it)
it - panel iterator instance| Method Detail |
|---|
protected void initialize()
initialize in class 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 IOException
IOException - if the target folder has not been setpublic void setTargetFolder(DataFolder f)
f - the folderpublic String getTargetName()
null if not yet setpublic void setTargetName(String name)
name - name for the new object, or nullpublic WizardDescriptor.Panel<WizardDescriptor> templateChooser()
public WizardDescriptor.Panel<WizardDescriptor> targetChooser()
protected WizardDescriptor.Panel<WizardDescriptor> createTemplateChooser()
protected WizardDescriptor.Panel<WizardDescriptor> createTargetChooser()
protected TemplateWizard.Iterator createDefaultIterator()
This implementation creates iterator that just shows the targetChooser panel.
public Set<DataObject> instantiate() throws IOException
IOException - I/O errorpublic Set<DataObject> instantiate(DataObject template) throws IOException
template - predefined template that should be instantiated
IOException - I/O errorpublic Set<DataObject> instantiate(DataObject template, DataFolder targetFolder) throws IOException
template - predefined template that should be instantiatedtargetFolder - the target folder
IOException - I/O errorpublic void setTitleFormat(MessageFormat format)
setTitleFormat in class WizardDescriptorformat - message formatpublic MessageFormat getTitleFormat()
getTitleFormat in class WizardDescriptorprotected Set<DataObject> handleInstantiate() throws IOException
IOException - if the instantiation failspublic static void setDescription(DataObject obj, URL url) throws IOException
nbresloc protocol.
obj - data object to attach description tourl - the url with description or null if there should be
no description
IOException - if I/O failspublic static URL getDescription(DataObject obj)
obj - data object to attach description to
@Deprecated public static void setDescriptionAsResource(DataObject obj, String rsrc) throws 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 clear
IOException - if the attribute cannot be set@Deprecated public static String getDescriptionAsResource(DataObject obj)
getDescription(org.openide.loaders.DataObject) instead.
obj - the data object
null if unset (incl. if only set as a raw URL)@Deprecated public static void setIterator(DataObject obj, TemplateWizard.Iterator iter) throws 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 clear
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 object
protected void updateState()
updateState in class WizardDescriptor
|
org.openide.loaders 6.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||