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));
-
purpose
- The platform(s) that the decorated task should be
performed on.
-
PurposeTask()
- Creates a PurposeTask.
-
PurposeTask(String, Task)
- Creates a PurposeTask that will perform the specified task
if the WizardState has the specified purpose.
-
addRuntimeResources(Vector)
- Add the runtime class requirements to the specified vector.
-
ignore(boolean)
- Returns false if this task does not want to be
ignored, or true if this task should be ignored.
-
isTargetPurpose()
- Returns true if this object is being executed from a WizardState
of the specified purpose.
purpose
protected String purpose
- The platform(s) that the decorated task should be
performed on.
PurposeTask
public PurposeTask()
- Creates a PurposeTask.
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.
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
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
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