pt.moredata.netbeans.modules.moredatatemplates.wizard
Class WizardArrayIterator

java.lang.Object
  extended bypt.moredata.netbeans.modules.moredatatemplates.wizard.WizardArrayIterator
All Implemented Interfaces:
org.openide.nodes.Node.Cookie, java.io.Serializable, org.openide.loaders.TemplateWizard.Iterator, org.openide.WizardDescriptor.Iterator, WizardInterface

public class WizardArrayIterator
extends java.lang.Object
implements WizardInterface, org.openide.loaders.TemplateWizard.Iterator

Interator in the array of panels used in the wizard

Author:
: Sérgio Ferreira
See Also:
Serialized Form

Constructor Summary
WizardArrayIterator(org.openide.WizardDescriptor.Panel[] apanel, Data wizardData)
          Constructor for the WizardArrayIterator object receiving the panel list and the reference to the data.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener changelistener)
          Add a new listener for handling a change event.
 org.openide.WizardDescriptor.Panel current()
          Get the current panel
 Data getData()
          Gets the object containing the information collected during the wizard iteration.
 WizardPanel getPanel(int panelOrder)
          Gets the panel for the wanted wizard step.
 boolean hasNext()
          Check if the wizard has more steps forward.
 boolean hasPrevious()
          Check if there is more steps backward
 void initialize(org.openide.loaders.TemplateWizard templatewizard)
          Initialization of the wizard.
protected  org.openide.WizardDescriptor.Panel[] initializePanels()
          Initialize the panels.
 java.util.Set instantiate(org.openide.loaders.TemplateWizard templatewizard)
          Method called when the user chooses finish in the wizard execution.
 java.lang.String name()
          Get the localized string that identify the iteration step (x of y) I think that is here tha the current step of the wizard is displayed.
 void nextPanel()
          Execute the actions needed after the user selected next in the panel buttons.
 void previousPanel()
          Iterate into the previous panel.
 void removeChangeListener(javax.swing.event.ChangeListener changelistener)
          Remove a listener to the change event.
 void uninitialize(org.openide.loaders.TemplateWizard templatewizard)
          Executed by netbeans when finish the wizard execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WizardArrayIterator

public WizardArrayIterator(org.openide.WizardDescriptor.Panel[] apanel,
                           Data wizardData)
Constructor for the WizardArrayIterator object receiving the panel list and the reference to the data.

Parameters:
apanel - The panels where the wizard iterates.
wizardData - A reference to the the object where the data is collected
Method Detail

getData

public Data getData()
Gets the object containing the information collected during the wizard iteration.

Specified by:
getData in interface WizardInterface
Returns:
The data value

getPanel

public WizardPanel getPanel(int panelOrder)
Gets the panel for the wanted wizard step.

Specified by:
getPanel in interface WizardInterface
Parameters:
panelOrder - The order of the panel wanted
Returns:
The panel reference

instantiate

public java.util.Set instantiate(org.openide.loaders.TemplateWizard templatewizard)
Method called when the user chooses finish in the wizard execution. The generation or goal of the wizard is made here.

Specified by:
instantiate in interface org.openide.loaders.TemplateWizard.Iterator
Parameters:
templatewizard - A reference to the template wizard
Returns:
Allways NULL

initialize

public void initialize(org.openide.loaders.TemplateWizard templatewizard)
Initialization of the wizard. The action objects are instantiated here. Executed after Wizard.instante() executed. Should be implemented to netbeans know what to do.

Specified by:
initialize in interface org.openide.loaders.TemplateWizard.Iterator
Parameters:
templatewizard - The default template wizard of netbeans

uninitialize

public void uninitialize(org.openide.loaders.TemplateWizard templatewizard)
Executed by netbeans when finish the wizard execution.

Specified by:
uninitialize in interface org.openide.loaders.TemplateWizard.Iterator
Parameters:
templatewizard - The default template wizard of netbeans

initializePanels

protected org.openide.WizardDescriptor.Panel[] initializePanels()
Initialize the panels.

Returns:
A reference to the panels array

current

public org.openide.WizardDescriptor.Panel current()
Get the current panel

Specified by:
current in interface org.openide.WizardDescriptor.Iterator
Returns:
A reference to the current iterated panel

name

public java.lang.String name()
Get the localized string that identify the iteration step (x of y) I think that is here tha the current step of the wizard is displayed.

Specified by:
name in interface org.openide.WizardDescriptor.Iterator
Returns:
The string with the current position in the iteration.

hasNext

public boolean hasNext()
Check if the wizard has more steps forward.

Specified by:
hasNext in interface org.openide.WizardDescriptor.Iterator
Returns:
- true : The wizard still have more steps - false : The wizard does not have more steps

hasPrevious

public boolean hasPrevious()
Check if there is more steps backward

Specified by:
hasPrevious in interface org.openide.WizardDescriptor.Iterator
Returns:
- true : The wizard still have more steps backward - false : The wizard is in the first step

nextPanel

public void nextPanel()
Execute the actions needed after the user selected next in the panel buttons. Does the iteration to the next panel. This method is executed before the Store settings of the specific panel.

Specified by:
nextPanel in interface org.openide.WizardDescriptor.Iterator

previousPanel

public void previousPanel()
Iterate into the previous panel. Executed by netbeans when the user click on previous button. If necessary its here that some actions to be done when the user choose previous should be inserted.

Specified by:
previousPanel in interface org.openide.WizardDescriptor.Iterator

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener changelistener)
Add a new listener for handling a change event.

Specified by:
addChangeListener in interface org.openide.WizardDescriptor.Iterator
Parameters:
changelistener - A reference to the listener to be registered.

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener changelistener)
Remove a listener to the change event.

Specified by:
removeChangeListener in interface org.openide.WizardDescriptor.Iterator
Parameters:
changelistener - The listener to be removed.