All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.core.WizardComposite

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----com.sun.wizards.core.WizardComponent
                                   |
                                   +----com.sun.wizards.core.WizardComposite

public class WizardComposite
extends WizardComponent
WizardComposite implements the default behavior common to all WizardComponents that have children. This is the superclass of nodes (panel objects that have child panels).

The wizard client panel tree consists of an arrangement of panels (subclassed from WizardLeaf) and nodes (subclassed from WizardComposite). The arrangement of the tree determines the order in which the panels will be visited by the wizard. Nodes can affect the traversal of the panels, which allows advanced panels to be skipped for users that do not wish to use them.

"Composite" was chosen as a name for this class from the book "Design Patterns".


Variable Index

 o cancelAttribute
The cancel attribute indicates whether or not this composite will determine the child to visit after a cancel has been performed. Deprecated.
 o children
A list of this objects children. Deprecated.

Constructor Index

 o WizardComposite()
Creates a WizardComposite with a route to the root of the server object tree.
 o WizardComposite(String, Route, WizardTreeManager)
Creates a WizardComponent with the specified name, the specified route and wizard manager.
 o WizardComposite(WizardState, String)
Creates a WizardComposite with the specified name.

Method Index

 o addChild(WizardComponent)
Add the specified child to this WizardComposite.
 o addCriticalStateKeys(Vector)
This method declares which wizard state keys get filled with data by this Wizard Component.
 o addRuntimeResources(Vector)
Get the runtime classes required by this WizardComposite.
 o addSubTree(Route, String)
Add the subtree of the specified name from the WizardState identified by the specified route as a child of this WizardComposite.
 o cancel(WizardComponent, boolean)
Cancel this panel.
 o deserialize(DataInput)
Deserialize this WizardComposite from the specified input stream.
 o deserializeChildren(DataInput)
Deserialize the children of this object from the specified input stream.
 o getChild(String)
Returns the first direct child of this WizardComposite having the specified name.
 o getChildren()
Get a list of children of this WizardComposite object.
 o getChildVector()
Gets a vector containing the children of this WizardComposite.
 o getNextChild(WizardComponent)
Get the child that follows the specified child in the WizardComponent tree.
 o getPreviousChild(WizardComponent)
Get the child that precedes the specified child in the WizardComponent tree.
 o insertChild(WizardComponent, WizardComponent)
Inserts a child into this WizardComposite before the specified nextChild.
 o isCancelSet()
Returns true if the cancel attribute of this node is set.
 o next()
Get the next WizardComponent in the tree.
 o previous()
Get the previous WizardComponent in the tree.
 o removeChild(WizardComponent)
Removes the specified child from this object.
 o reset(Object)
Reset this component, given the specified information.
 o saveWizardTree(DataOutput)
Save the wizard tree.
 o serialize(DataOutput)
Serialize this WizardComposite to the specified output stream.
 o serializeChildren(DataOutput)
Serialize the children of this object to the specified output stream.
 o setCancel(boolean)
Sets the cancel attribute of this node.

Variables

 o children
 protected Vector children
Note: children is deprecated.

A list of this objects children.

 o cancelAttribute
 protected boolean cancelAttribute
Note: cancelAttribute is deprecated.

The cancel attribute indicates whether or not this composite will determine the child to visit after a cancel has been performed.

Constructors

 o WizardComposite
 public WizardComposite()
Creates a WizardComposite with a route to the root of the server object tree.

 o WizardComposite
 public WizardComposite(WizardState wizardState,
                        String name)
Creates a WizardComposite with the specified name.

Parameters:
wizardState - The buildtime WizardState.
name - The name for this WizardComposite.
 o WizardComposite
 public WizardComposite(String name,
                        Route route,
                        WizardTreeManager wizardManager)
Creates a WizardComponent with the specified name, the specified route and wizard manager.

Parameters:
name - The name for this WizardComponent.
route - The route to the appropriate server side object.
wizardManager - The wizardManager responsible for this component.

Methods

 o getChild
 public WizardComponent getChild(String childName)
Returns the first direct child of this WizardComposite having the specified name.

Parameters:
childName - The name of the desired child.
Returns:
The desired child or null if the named child is not a child of this object.
Overrides:
getChild in class WizardComponent
 o getChildren
 public Enumeration getChildren()
Get a list of children of this WizardComposite object.

Returns:
The children.
 o getChildVector
 protected Vector getChildVector()
Gets a vector containing the children of this WizardComposite.

 o getNextChild
 protected WizardComponent getNextChild(WizardComponent currentChild)
Get the child that follows the specified child in the WizardComponent tree.

Parameters:
currentChild - The child that comes before the desired child in the wizard tree.
Returns:
The next child in the wizard tree or null if no children follow the specified child in the tree.
Overrides:
getNextChild in class WizardComponent
 o next
 public WizardComponent next()
Get the next WizardComponent in the tree. For a composite, next will return the first child.next() or null.

Returns:
The next WizardComponent in the tree.
Overrides:
next in class WizardComponent
 o getPreviousChild
 protected WizardComponent getPreviousChild(WizardComponent currentChild)
Get the child that precedes the specified child in the WizardComponent tree.

Parameters:
currentChild - The child that comes after the desired child in the wizard tree.
Returns:
The previous child in the wizard tree or null if no children precede the specified child in the tree.
Overrides:
getPreviousChild in class WizardComponent
 o previous
 public WizardComponent previous()
Get the previous WizardComponent in the tree. For a composite, previous will return the last child.previous() or null.

Returns:
The previous WizardComponent in the tree.
Overrides:
previous in class WizardComponent
 o addChild
 public final void addChild(WizardComponent child)
Add the specified child to this WizardComposite. The order that the children were added will be maintained.

Parameters:
child - The child to add to this object.
 o insertChild
 public final void insertChild(WizardComponent child,
                               WizardComponent nextChild)
Inserts a child into this WizardComposite before the specified nextChild. This new child will be visited before nextChild.

Parameters:
child - The child to add to this object.
nextChild - The already-existing child to insert in front of.
 o removeChild
 public final void removeChild(WizardComponent child)
Removes the specified child from this object.

Parameters:
child - The child to remove.
 o saveWizardTree
 public final synchronized void saveWizardTree(DataOutput out)
Save the wizard tree. This method is used by wizard builders to create a wizard archive containing a client tree. This method should only be called on the root of the client tree.

Parameters:
out - The output stream to which the wizard tree should be written.
Overrides:
saveWizardTree in class WizardComponent
 o serializeChildren
 protected void serializeChildren(DataOutput out)
Serialize the children of this object to the specified output stream. This method should not be called by applications.

Parameters:
out - The output stream to which this objects children should be written.
 o deserializeChildren
 protected void deserializeChildren(DataInput in)
Deserialize the children of this object from the specified input stream. This method should not be called by applications.

Parameters:
in - The input stream from which this objects children should be read.
 o serialize
 protected void serialize(DataOutput out)
Serialize this WizardComposite to the specified output stream. This method does not save its children.

Parameters:
out - The output stream to which this WizardComponent will be serialized.
Overrides:
serialize in class WizardComponent
See Also:
serializeChildren
 o deserialize
 protected void deserialize(DataInput in)
Deserialize this WizardComposite from the specified input stream. This method does not deserialize its children.

Parameters:
in - The input stream from which this WizardComponent will be deserialized.
Overrides:
deserialize in class WizardComponent
See Also:
deserializeChildren
 o addSubTree
 public void addSubTree(Route route,
                        String subtreeName)
Add the subtree of the specified name from the WizardState identified by the specified route as a child of this WizardComposite.

Parameters:
route - The route to the WizardState responsible for the desired subtree.
subtreeName - The name of the desired subtree.
 o reset
 public void reset(Object info)
Reset this component, given the specified information. This method may be called when a user backtracks in the client wizard tree and changes a fundamental setting. The panel that enabled the modification might traverse subsequent panels and call this method resynchronize all panels with the user's choice.

Parameters:
info - The information required to perform a reset.
Overrides:
reset in class WizardComponent
 o setCancel
 public void setCancel(boolean cancelAttribute)
Sets the cancel attribute of this node.

The default behavior of the cancel button is to identify the nearest ancestor node with the cancel attribute set, and then traverse to the previous child or the next child of that node.

The previous or next behavior of cancel is set by the current panel's cancelDirection flag.

Parameters:
cancelAttribute - If true, the cancel attribute of this node will be set.
See Also:
setCancelDirection
 o isCancelSet
 public boolean isCancelSet()
Returns true if the cancel attribute of this node is set.

 o cancel
 public WizardComponent cancel(WizardComponent child,
                               boolean direction)
Cancel this panel. This method is only called after the cancel operation is confirmed by the user.

Parameters:
child - The child currently being visited.
direction - The cancel direction.
Returns:
The client panel that should be displayed after the cancel operation.
 o addCriticalStateKeys
 public void addCriticalStateKeys(Vector keys)
This method declares which wizard state keys get filled with data by this Wizard Component. During statefile creation, these keys are written out to the statefile. and can be used with a statefile to set the default settings in subsequent executions of the wizard.

Parameters:
wizardStateKeys - The vector holding the wizard state keys.
Overrides:
addCriticalStateKeys in class WizardComponent
 o addRuntimeResources
 public void addRuntimeResources(Vector resourceVector)
Get the runtime classes required by this WizardComposite.

Overrides:
addRuntimeResources in class WizardComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index