com.japisoft.framework.wizard
Class BasicWizardStep

java.lang.Object
  extended bycom.japisoft.framework.wizard.BasicWizardStep
All Implemented Interfaces:
WizardStep

public class BasicWizardStep
extends java.lang.Object
implements WizardStep

Facility for creating a wizard. By default this step will enabled the next step and the previous step, if you want to change this behavior, you must override the start method. It is advised to create your WizardStep by overriding this class.

Author:
(c) 2003 JAPISOFT

Field Summary
protected  WizardStepContext currentContext
           
 
Constructor Summary
BasicWizardStep(java.lang.String name)
           
BasicWizardStep(java.lang.String name, java.lang.String shortTitle, java.lang.String longTitle, javax.swing.Icon smallIcon, javax.swing.Icon largeIcon, StepView view)
           
BasicWizardStep(java.lang.String name, java.lang.String shortTitle, java.lang.String longTitle, StepView view)
           
 
Method Summary
 boolean canStart(WizardStepContext context)
          Called before the wizard step is started.
 javax.swing.Icon getLargeIcon()
           
 java.lang.String getLongTitle()
           
 java.lang.String getName()
           
 java.lang.String getShortTitle()
           
 javax.swing.Icon getSmallIcon()
           
 StepView getStepView()
          This is the user interface part for the wizard step
 boolean isEnabled()
           
protected  boolean mustAcceptNextByDefault()
           
protected  boolean mustAcceptPreviousByDefault()
           
 void setAcceptNextActionByDefault(boolean acceptNext)
          Decide to accept the next action automatically.
 void setAcceptPreviousActionByDefault(boolean acceptPrevious)
          Decide to accept the previous action automatically.
 void setEnabled(boolean enabled)
          Enabled or disable this wizard step.
 void setLargeIcon(javax.swing.Icon icon)
           
 void setLongTitle(java.lang.String title)
           
 void setShortTitle(java.lang.String title)
           
 void setSmallIcon(javax.swing.Icon icon)
           
 void setView(StepView component)
           
 boolean start(WizardStepContext context)
          Called when the wizard step is started, so the final user can interact with the view provided by the getView method
 void stop(WizardStepContext context)
          Called before a new wizard step is started
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentContext

protected WizardStepContext currentContext
Constructor Detail

BasicWizardStep

public BasicWizardStep(java.lang.String name)
Parameters:
name - Name of this wizard

BasicWizardStep

public BasicWizardStep(java.lang.String name,
                       java.lang.String shortTitle,
                       java.lang.String longTitle,
                       StepView view)
Parameters:
name - Name of this wizard
shortTitle - Label for the left part, it can't be null
longTitle - Label for the top part
view - Main wizard component

BasicWizardStep

public BasicWizardStep(java.lang.String name,
                       java.lang.String shortTitle,
                       java.lang.String longTitle,
                       javax.swing.Icon smallIcon,
                       javax.swing.Icon largeIcon,
                       StepView view)
Parameters:
name - Name of this wizard
shortTitle - Label for the left part, it can't be null
longTitle - Label for the top part
view - Main wizard component
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface WizardStep
Returns:
a name for this wizard

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface WizardStep
Returns:
true if the wizard step is accessible

setEnabled

public void setEnabled(boolean enabled)
Enabled or disable this wizard step. A non enabled wizard will be skipped


setShortTitle

public void setShortTitle(java.lang.String title)

getShortTitle

public java.lang.String getShortTitle()
Specified by:
getShortTitle in interface WizardStep
Returns:
a short title for this wizard. This title will appear on the left part

getLongTitle

public java.lang.String getLongTitle()
Specified by:
getLongTitle in interface WizardStep
Returns:
a long title for this wizard. This title will appear on the center part

setLongTitle

public void setLongTitle(java.lang.String title)

getStepView

public StepView getStepView()
Description copied from interface: WizardStep
This is the user interface part for the wizard step

Specified by:
getStepView in interface WizardStep

setView

public void setView(StepView component)

getSmallIcon

public javax.swing.Icon getSmallIcon()
Specified by:
getSmallIcon in interface WizardStep
Returns:
a small icon for the left part

setSmallIcon

public void setSmallIcon(javax.swing.Icon icon)

getLargeIcon

public javax.swing.Icon getLargeIcon()
Specified by:
getLargeIcon in interface WizardStep
Returns:
a big icon for the center part

setLargeIcon

public void setLargeIcon(javax.swing.Icon icon)

setAcceptNextActionByDefault

public void setAcceptNextActionByDefault(boolean acceptNext)
Decide to accept the next action automatically. By default true


mustAcceptNextByDefault

protected boolean mustAcceptNextByDefault()
Returns:
the default value for accepting a next step. By default true meaning the Next button will by activated

setAcceptPreviousActionByDefault

public void setAcceptPreviousActionByDefault(boolean acceptPrevious)
Decide to accept the previous action automatically. By default true


mustAcceptPreviousByDefault

protected boolean mustAcceptPreviousByDefault()
Returns:
the default value for accepting a next step. By default true meaning the Next button will by activated

canStart

public boolean canStart(WizardStepContext context)
Description copied from interface: WizardStep
Called before the wizard step is started. If the step return false then the step will be canceled and the wizard will stay to the current one

Specified by:
canStart in interface WizardStep
Parameters:
context - The wizard step context
Returns:
a default true value

start

public boolean start(WizardStepContext context)
Description copied from interface: WizardStep
Called when the wizard step is started, so the final user can interact with the view provided by the getView method

Specified by:
start in interface WizardStep
Parameters:
context - Information about the wizard step
Returns:
true when it accept to be started else the current wizard step will be skipped

stop

public void stop(WizardStepContext context)
Description copied from interface: WizardStep
Called before a new wizard step is started

Specified by:
stop in interface WizardStep
Parameters:
context - Information about the wizard step