All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.tasks.PurposeTask

java.lang.Object
   |
   +----com.sun.wizards.core.Task
           |
           +----com.sun.wizards.tasks.DecoratorTask
                   |
                   +----com.sun.wizards.tasks.PurposeTask

public class PurposeTask
extends DecoratorTask
implements Serializable
The PurposeTask is a task that follows the Decorator design pattern. This object can be used to perform or reverse a task only if its WizardState has the specified purpose. For example, you might want a configureTask that performs itself only if the purpose of this wizard is "configuration". In this case, you would use the following construction:

Sequence mySequence = new Sequence(); mySequence.addTask(new PurposeTask("configuration", configureTask));


Variable Index

 o purpose
The platform(s) that the decorated task should be performed on.

Constructor Index

 o PurposeTask()
Creates a PurposeTask.
 o PurposeTask(String, Task)
Creates a PurposeTask that will perform the specified task if the WizardState has the specified purpose.

Method Index

 o addRuntimeResources(Vector)
Add the runtime class requirements to the specified vector.
 o ignore(boolean)
Returns false if this task does not want to be ignored, or true if this task should be ignored.
 o isTargetPurpose()
Returns true if this object is being executed from a WizardState of the specified purpose.

Variables

 o purpose
 protected String purpose
The platform(s) that the decorated task should be performed on.

Constructors

 o PurposeTask
 public PurposeTask()
Creates a PurposeTask.

 o PurposeTask
 public PurposeTask(String purpose,
                    Task decoratedTask)
Creates a PurposeTask that will perform the specified task if the WizardState has the specified purpose.

Parameters:
purpose - The WizardState purpose the decorated task should perform on.
decoratedTask - The task that is to be performed or reversed.

Methods

 o isTargetPurpose
 protected boolean isTargetPurpose()
Returns true if this object is being executed from a WizardState of the specified purpose.

Returns:
true if this object is being executed on one of the target platforms specified at buildtime
 o ignore
 public boolean ignore(boolean direction)
Returns false if this task does not want to be ignored, or true if this task should be ignored. If this PurposeTask is executing from a WizardState of the purpose specified at buildtime, this method will return true.

Parameters:
direction - Which way we should traverse the product tree if we are ignoring the task
Returns:
true or false, depending on if this Task should be ignored.
Overrides:
ignore in class DecoratorTask
 o addRuntimeResources
 public void addRuntimeResources(Vector resourceVector)
Add the runtime class requirements to the specified vector.

Parameters:
resourceVector - The vector containing all runtime resources for this wizard.
Overrides:
addRuntimeResources in class DecoratorTask

All Packages  Class Hierarchy  This Package  Previous  Next  Index