net.refractions.udig.catalog.ui.workflow
Class IntermediateState

java.lang.Object
  extended by net.refractions.udig.catalog.ui.workflow.Workflow.State
      extended by net.refractions.udig.catalog.ui.workflow.IntermediateState

public class IntermediateState
extends Workflow.State

A state that tracks intermediate pages. They have no purpose beyond matching the state of a wizard page.

Since:
1.1.0
Author:
jesse

Constructor Summary
IntermediateState(int index, int numberOfPages, Workflow.State endState)
          New instance
 
Method Summary
 Workflow.State getEndState()
           
 int getIndex()
           
 java.lang.String getName()
           
 boolean hasNext()
          Determines if the state can dynamically create a new state to be the next active state of the workflow.
 Workflow.State next()
          The final method in the lifecycle of the state.
 boolean run(IProgressMonitor monitor)
          Performs any "hard" work.
 
Methods inherited from class net.refractions.udig.catalog.ui.workflow.Workflow.State
getPreviousState, getWorkflow, init, setPrevious, setWorkflow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntermediateState

public IntermediateState(int index,
                         int numberOfPages,
                         Workflow.State endState)
New instance

Parameters:
numberOfPages - the number of pages that this state must track. The last page will be the endState
endState - the state that must be satisfied for all the pages to be satisfied.
Method Detail

hasNext

public boolean hasNext()
Description copied from class: Workflow.State
Determines if the state can dynamically create a new state to be the next active state of the workflow. Note, in most cases this is equivalent to next() != null. However some implemtnations require that next() be called only once, as it is a lifecycle event.

Overrides:
hasNext in class Workflow.State
Returns:
true if the state can create a new state, otherwise false.

next

public Workflow.State next()
Description copied from class: Workflow.State
The final method in the lifecycle of the state. This method is used for states to dynamically link to each other. This method returns null to indicate no state.

Overrides:
next in class Workflow.State
Returns:
A new state which is to become the next active state, otherwise null.

run

public boolean run(IProgressMonitor monitor)
            throws java.io.IOException
Description copied from class: Workflow.State
Performs any "hard" work. This method is provided is provided for states which have to block to get work done. For instance, making a connection to a remote service. This method returns a boolean which signals wether the state was able to get the work done.

Overrides:
run in class Workflow.State
Parameters:
monitor - A progress monitor.
Returns:
True if the state was able to complete its job, otherwise false.
Throws:
java.io.IOException

getName

public java.lang.String getName()
Specified by:
getName in class Workflow.State

getEndState

public Workflow.State getEndState()

getIndex

public int getIndex()