All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.core.WizardComponent
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----com.sun.wizards.core.WizardComponent
- public abstract class WizardComponent
- extends Panel
WizardComponent defines the interface and implements
default behavior common to all classes in the client
Wizard tree. The Wizard tree consists of panels that
define the user experience of the wizard.
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.
"Component" was chosen as a name for this class from
the book "Design Patterns".
-
cancelDirection
- The cancel direction is a flag that indicates whether a cancel
operation from this panel should traverse backward (false) or
forward (true).
Deprecated.
-
name
- The name of this wizard component.
Deprecated.
-
parent
- This is the parent of this WizardComponent.
Deprecated.
-
route
- This is the route object of this WizardComponent.
Deprecated.
-
wizardManager
- The wizard manager is responsible for creation, display, and
navigation of the wizard tree.
Deprecated.
-
WizardComponent()
- Creates a WizardComponent with a route to the root of the server
object tree.
-
WizardComponent(String, Route, WizardTreeManager)
- Creates a WizardComponent with the specified name, the specified
route and wizard manager.
-
WizardComponent(WizardState, String)
- Creates a WizardComponent with the specified name.
-
abortDisplay()
- This method is called when this WizardComponent is being displayed,
and the user presses the "back" button.
-
addCriticalStateKeys(Vector)
- This method declares which wizard state keys get filled with data by this
Wizard Component.
-
addRuntimeResources(Vector)
- Get the runtime classes required by this WizardComposite.
-
beginDisplay()
- This method is called when the WizardComponent is displayed.
-
callback(String, String)
- Used in CLI Mode for imediate validations of data
-
cancel()
- Cancel this panel.
-
consoleInteraction()
- This method is called during non-graphical execution (i.e.
-
createObject(String, Class[], Object[])
- Create an object through reflection.
-
createUI()
- This method creates the user interface.
-
deserialize(DataInput)
- Deserialize this WizardComponent from the specified input
stream.
-
displayQuery(Object, String, String, String[], String[])
- Display a query to the user.
-
getCancelDirection()
- Returns the cancel direction.
-
getCancelMessage()
- Returns the cancel message.
Deprecated.
-
getChild(String)
- This is the default implementation of getChild.
-
getName()
- Gets the current name of this WizardComponent.
-
getNextChild(WizardComponent)
- Get the child that follows the specified child in the
WizardComponent tree.
-
getParentComponent()
- Gets the parent of this WizardComponent.
-
getPreviousChild(WizardComponent)
- Get the child that precedes the specified child in the
WizardComponent tree.
-
getRootComponent()
- Get the root of the WizardComponent tree.
-
getRoute()
- Get the route object that directs messages to the
correct WizardState.
-
getRoute(Route)
- Get the client side route for this WizardComponent.
-
getTreeManager()
- Returns the WizardTreeManager controling the client
panel tree.
-
getWizardComponent(Route)
- Get the WizardComponent specified by the given route object.
-
isDisplayComplete()
- Returns true if this WizardComponent is finished displaying.
-
isFirst()
- Returns true if this is the first leaf in the tree.
-
isLast()
- Returns true if this is the last leaf in the tree.
-
next()
- Get the next WizardComponent in the tree.
-
previous()
- Get the previous WizardComponent in the tree.
-
reset(Object)
- Reset this component, given the specified information.
-
saveWizardTree(DataOutput)
- Save the wizard tree.
-
serialize(DataOutput)
- Serialize this WizardComponent to the specified output
stream.
-
setCancelDirection(boolean)
- Sets the cancel direction.
-
setName(String)
- Sets the name of this WizardComponent to the specified name.
-
setParentComponent(WizardComponent)
- Sets the parent of this WizardComponent.
-
setRoute(Route)
- Set the route to the server-side WizardState.
-
skip()
- This method returns true if this WizardComponent wants
to be skipped during traversal of this tree.
parent
protected WizardComponent parent
- Note: parent is deprecated.
- This is the parent of this WizardComponent. This helps provide a tree
in which a child in the tree knows who its parent is.
wizardManager
protected WizardTreeManager wizardManager
- Note: wizardManager is deprecated.
- The wizard manager is responsible for creation, display, and
navigation of the wizard tree. It is also responsible for sending
messages to the server.
route
protected Route route
- Note: route is deprecated.
- This is the route object of this WizardComponent. The route object
can route messages from an element in the wizard tree to the appropriate
object on the server.
name
protected String name
- Note: name is deprecated.
- The name of this wizard component. For siblings, it is important that
each sibling has a unique name.
cancelDirection
protected boolean cancelDirection
- Note: cancelDirection is deprecated.
- The cancel direction is a flag that indicates whether a cancel
operation from this panel should traverse backward (false) or
forward (true).
WizardComponent
public WizardComponent()
- Creates a WizardComponent with a route to the root of the server
object tree.
WizardComponent
public WizardComponent(WizardState wizardState,
String name)
- Creates a WizardComponent with the specified name.
- Parameters:
- wizardState - The buildtime WizardState.
- name - The name for this WizardComponent.
WizardComponent
public WizardComponent(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.
setName
public void setName(String name)
- Sets the name of this WizardComponent to the specified name.
- Parameters:
- name - The new name for this WizardComponent.
- Overrides:
- setName in class Component
getName
public String getName()
- Gets the current name of this WizardComponent.
- Returns:
- The current name.
- Overrides:
- getName in class Component
getChild
public WizardComponent getChild(String childName)
- This is the default implementation of getChild.
WizardComposite overrides this method to return
a child. This default implementation can be
used directly for the WizardLeaf object.
- Parameters:
- childName - The name of the child to retrieve.
- Returns:
- The requested child, or null if the child does
not exist.
getParentComponent
public WizardComponent getParentComponent()
- Gets the parent of this WizardComponent.
- Returns:
- The parent.
setParentComponent
public void setParentComponent(WizardComponent parent)
- Sets the parent of this WizardComponent.
- Parameters:
- parent - The new parent of this WizardComponent.
getTreeManager
protected WizardTreeManager getTreeManager()
- Returns the WizardTreeManager controling the client
panel tree.
setRoute
public void setRoute(Route route)
- Set the route to the server-side WizardState.
- Parameters:
- route - The new server route.
getRoute
public Route getRoute()
- Get the route object that directs messages to the
correct WizardState.
- Returns:
- The route to the server.
getRoute
public Route getRoute(Route routeInProgress)
- Get the client side route for this WizardComponent.
- Parameters:
- routeInProgress - This method should be called with
routeInProgress = null.
- Returns:
- The route for this WizardComponent.
getRootComponent
public WizardComponent getRootComponent()
- Get the root of the WizardComponent tree.
- Returns:
- The root of the WizardComponent tree.
skip
public boolean skip()
- This method returns true if this WizardComponent wants
to be skipped during traversal of this tree.
- Returns:
- true if this object wants to be skipped in the
traversal of the tree. false otherwise.
beginDisplay
public void beginDisplay()
- This method is called when the WizardComponent is displayed.
abortDisplay
public void abortDisplay()
- This method is called when this WizardComponent is being displayed,
and the user presses the "back" button. This method provides an
opportunity for this WizardComponent to do cleanup before exiting.
This method is used when the user presses the "back" button, and
the
isDisplayComplete method is used when the user
presses the "next" button.
createUI
public void createUI()
- This method creates the user interface.
consoleInteraction
public void consoleInteraction()
- This method is called during non-graphical execution (i.e. the
wizard was launched with the
-nodisplay
command-line option.) In this method, subclasses should
interact with the console (System.in and
System.out) to collect the same information that
the component needs. Note that the information collected should be
saved in the same way as the isDisplayComplete()
and abortDisplay() methods expect it.
For example: suppose the graphical version of this
component presents the user with a CheckBoxGroup,
the user makes a selection, and the result is examined in the
isDisplayComplete() method by using the
getSelectedCheckBox() API from
java.awt.CheckBoxGroup. To do this same thing
using this method, it should prompt the user with the same
strings as used in the graphical version, and set the
selections into the checkBoxGroup when the user
supplies the information (by using the setSelectedCheckBox()
based on user input). In this way, the code already
written for isDisplayComplete() does not have to
be modified.
callback
public boolean callback(String result,
String id)
- Used in CLI Mode for imediate validations of data
- Parameters:
- result - The result of the call that caused the
callback.
- id - An identifier, for use by the callee during
the callback.
- Returns:
- Whether the result is valid. Subclasses should use
this method to validate data that is entered by the user
for a particular query, rather than validating ALL data
on the panel at once. This method returns
false
by default.
displayQuery
public void displayQuery(Object target,
String title,
String message,
String buttons[],
String methods[])
- Display a query to the user. When a selection is made,
the corresponding method will be called on the target.
- Parameters:
- target - The object to call when a selection from the
dialog is made.
- title - A small title for this query.
- message - The message to be displayed to the user.
- buttons - The buttons (button labels) offered to the
user to select from.
- methods - A list of methods (in the same order as the
list of buttons) that will be called when
a dialog selection is made.
isDisplayComplete
public boolean isDisplayComplete()
- Returns true if this WizardComponent is finished displaying.
This method can be used to verify user input.
- Returns:
- true if the display of this WizardComponent is
complete; false otherwise.
getNextChild
protected abstract WizardComponent getNextChild(WizardComponent currentChild)
- Get the child that follows the specified child in the
WizardComponent tree. Applications should use
next.
- Parameters:
- currentChild - The child in the tree that comes before
the desired sibling.
- Returns:
- The next child in the tree.
next
public abstract WizardComponent next()
- Get the next WizardComponent in the tree.
- Returns:
- The next child in the tree.
getPreviousChild
protected abstract WizardComponent getPreviousChild(WizardComponent currentChild)
- Get the child that precedes the specified child in the
WizardComponent tree. Applications should use
previous.
- Parameters:
- currentChild - The child in the tree that comes after
the desired sibling.
- Returns:
- The previous child in the tree.
previous
public abstract WizardComponent previous()
- Get the previous WizardComponent in the tree.
- Returns:
- The previous child in the tree.
isFirst
public boolean isFirst()
- Returns true if this is the first leaf in the tree.
- Returns:
- true if this is the first leaf in the tree. false
otherwise.
isLast
public boolean isLast()
- Returns true if this is the last leaf in the tree.
- Returns:
- true if this is the last leaf in the tree. false
otherwise.
saveWizardTree
public 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.
serialize
protected void serialize(DataOutput out)
- Serialize this WizardComponent to the specified output
stream. This method does not save its children.
- Parameters:
- out - The output stream to which this WizardComponent will be
serialized.
- See Also:
- serializeChildren
deserialize
protected void deserialize(DataInput in)
- Deserialize this WizardComponent from the specified input
stream. This method does not deserialize its children.
- Parameters:
- in - The input stream from which this WizardComponent will be
deserialized.
- See Also:
- deserializeChildren
createObject
public Object createObject(String classname,
Class argTypes[],
Object args[])
- Create an object through reflection.
- Parameters:
- classname - The class name of the object to create.
- argTypes - The paramater list identifying the correct
constructor.
- args - The arguments to pass to the constructor.
- Returns:
- The created object.
getWizardComponent
public WizardComponent getWizardComponent(Route route)
- Get the WizardComponent specified by the given route object.
- Parameters:
- route - The route specifying the desired WizardComponent.
- Returns:
- The desired WizardComponent, or null if the WizardComponent
does not exist.
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.
getCancelDirection
public boolean getCancelDirection()
- Returns the cancel direction. The cancel direction determines
whether cancel would visit the previous panel or the following
panel.
This method returns false if cancel should visit the previous
panel, or true if cancel should visit the next panel.
- Returns:
- The direction within the client wizard tree that
a cancel operation should traverse.
setCancelDirection
public void setCancelDirection(boolean cancelDirection)
- Sets the cancel direction. The cancel direction determines
whether cancel would visit the previous panel or the following
panel.
- Parameters:
- cancelDirection - If true, cancel will cause the next panel to be
visited. False causes the previous panel to be
visited.
getCancelMessage
public String getCancelMessage()
- Note: getCancelMessage() is deprecated.
You should Set the cancel message using a localizable
resource and the setCancelMsg() method in ArchiveWriter. To
set a runtime cancel message from a panel, set it into the
WizardState.
- Returns the cancel message.
- Returns:
- A String representing the message to be displayed when a user clicks
"cancel".
- See Also:
- setCancelMsg, Msg
cancel
public WizardComponent cancel()
- Cancel this panel. This method is only called after the
cancel operation is confirmed by the user.
- Returns:
- The client panel that should be displayed after the
cancel operation.
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.
addRuntimeResources
public void addRuntimeResources(Vector resourceVector)
- Get the runtime classes required by this WizardComposite.
- Parameters:
- resourceVector - The vector containing resources that this method will add to.
All Packages Class Hierarchy This Package Previous Next Index