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

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

public class ResourceSelectionState
extends Workflow.State

State selects IGeoResources. The selected resources are those in the getResources() map. The keys are the selected resources and the values are the parents. State normally uses a ConnectionState but it isn't required is #setServices(List) is used to set the services.

Since:
1.1.0
Author:
Justin Deolive

Constructor Summary
ResourceSelectionState()
           
 
Method Summary
 java.lang.String getName()
           
 java.util.Map<IGeoResource,IService> getResources()
           
 java.util.Collection<IService> getServices()
           
 void init(IProgressMonitor monitor)
          Initialize the state.
 boolean run(IProgressMonitor monitor)
          Performs any "hard" work.
 void setResources(java.util.Map<IGeoResource,IService> resources)
           
 void setServices(java.util.Collection<IService> services)
           
 
Methods inherited from class net.refractions.udig.catalog.ui.workflow.Workflow.State
getPreviousState, getWorkflow, hasNext, next, setPrevious, setWorkflow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceSelectionState

public ResourceSelectionState()
Method Detail

getServices

public java.util.Collection<IService> getServices()

setServices

public void setServices(java.util.Collection<IService> services)

setResources

public void setResources(java.util.Map<IGeoResource,IService> resources)

getResources

public java.util.Map<IGeoResource,IService> getResources()

init

public void init(IProgressMonitor monitor)
          throws java.io.IOException
Description copied from class: Workflow.State
Initialize the state. This is the second method in the lifecycle of the state. It is called after #setPrevious(). If the state needs to "seed" itself with any context, that should occur here.

Overrides:
init in class Workflow.State
Throws:
java.io.IOException

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