All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.core.WizardTreeManager
java.lang.Object
|
+----com.sun.wizards.core.WizardTreeManager
- public class WizardTreeManager
- extends Object
- implements ActionListener, Runnable
The WizardTreeManager class manages the creation and navigation
of a wizard tree.
The WizardTreeManager is the core of the wizard client
classes. Each WizardComponent wizard panel maintains a
reference to the WizardTreeManager, and uses it to call methods
on the wizard server. All wizard archive resources are available
to the client objects through the WizardTreeManager.
The WizardTreeManager communicates with the root WizardState object
either directly (in the case of a wizard running locally), or through
RMI (in the case of a wizard running remotely).
-
BACK_BUTTON
- A value identifying the back button.
-
CANCEL_BUTTON
- A value identifying the cancel button.
-
EXIT_BUTTON
- A value identifying the exit button.
-
NEXT_BUTTON
- A value identifying the next button.
-
WizardTreeManager(AppConsole, WizardState)
- Creates a WizardTreeManager object with the specified
WizardState.
-
actionPerformed(ActionEvent)
- Implementation of the ActionListener interface.
-
addInitializationListener(InitializationListener)
- Add an initialization listener.
-
backButtonPressed()
- Invoked when the back button has been pressed.
-
callClientObjectMethod(Route, String, String[], Object[])
- Call a method on the client.
-
callObjectMethod(Object, String, String[], Object[])
- Call an object method through reflection.
-
callServerObjectMethod(Route, String, String[], Object[])
- Call a method on the server.
-
cancelButtonPressed()
- Invoked when the cancel button has been pressed.
-
cancelConfirmed()
- Invoked when the cancel operation is confirmed by the user.
-
continueConfirmed()
- Invoked when the continue operation is confirmed by the user.
-
createBaselinePanel()
- Creates the wizard's baseline panel.
-
createImagePanel()
- Creates the image panel.
-
createNavigationPanel()
- Creates the navigation panel.
-
createObject(String, Class[], Object[])
- Create an object through reflection.
-
createSubTree(Route, String)
- Create a subtree with the specified name and the specified route to
a server side object.
-
createWizardPanel()
- Creates the wizard panel.
-
displayCorrectButtons()
- Set the visibility of the buttons requested by the
currently displayed panel.
-
displayQuery(Object, String, String, String[], String[])
- Display a query to the user.
-
displayQuery(Object, String, String[], String[])
- Display a query to the user.
-
doReboot()
- Invoked when the reboot operation is confirmed by the user.
-
exit(int)
- Exits the server and client VMs with the specified exit
code.
-
exitButtonPressed()
- Invoked when the exit button has been pressed.
-
exitConfirmed()
- Invoked when the exit operation is confirmed by the user.
-
getBaselineImage()
- Get the baseline image shown on the left
-
getBaselinePanel()
- Returns the baseline panel created through a call to
createBaselinePanel
-
getCurrentPanel()
- Returns the current wizard panel.
-
getFirstComponent()
- Get the first component in this wizard
-
getImage()
- Get the main image shown on the left
-
getImage(Route, String)
- This method gets the specified image from the archive identified
by the specified route.
-
getImagePanel()
- Returns the image panel created through a call to
createImagePanel
-
getNamedResource(Route, String, String)
- This method returns the bytes of the named resource of the
specified type.
-
getNavigationPanel()
- Returns the navigation panel created through a call
to
createNavigationPanel.
-
getWizardInitState()
- Returns the state of the WizardState.
-
getWizardPanel()
- Returns the wizard panel created through a call to
createWizardPanel.
-
getWizardSize()
- Gets the size of the wizard frame.
-
getWizardState()
- Gets the WizardState for this wizard.
-
hasConsole()
- Returns true if this Iterator object has a text console that can
display text and return user text input.
-
hasGUI()
- Returns true if this AppConsole object has a gui that can display
images.
-
initialize()
- This method should be called when the window containing the
wizard tree is opened.
-
isTraversingForward()
- Says whether we are currently traversing forward or not.
-
nextButtonPressed()
- Invoked when the next button has been pressed.
-
removeInitializationListener(InitializationListener)
- Remove the specified initialization listener from the notification
list.
-
run()
- Display the buttons when the WizardState has initialized.
-
setBaselineImage(String)
- Set the baseline image shown on the left
-
setButtonEnabled(String, boolean)
- Enables or disables the navigation button specified by
the button's function.
-
setButtonLabel(String, String)
- Change the label of the specified navigation button.
-
setFrameTitle(String)
- Sets the title of the window comtaining the wizard.
-
setIconImage(Image)
- Set the icon image of the wizard frame.
-
setImage(String)
- Set the main image shown on the left
-
setWizardSize(Dimension)
- Sets the size of the wizard frame.
-
setWizardState(WizardState)
- Sets the Wizard State that controls this wizard.
-
warpToLeaf(WizardComponent)
- Visits the specified WizardComponent.
BACK_BUTTON
public static int BACK_BUTTON
- A value identifying the back button.
NEXT_BUTTON
public static int NEXT_BUTTON
- A value identifying the next button.
CANCEL_BUTTON
public static int CANCEL_BUTTON
- A value identifying the cancel button.
EXIT_BUTTON
public static int EXIT_BUTTON
- A value identifying the exit button.
WizardTreeManager
public WizardTreeManager(AppConsole appConsole,
WizardState wizardState)
- Creates a WizardTreeManager object with the specified
WizardState. The WizardState will facilitate
reading the wizard archive.
- Parameters:
- appConsole - The application console that this
wizard manager resides within.
- wizardState - The WizardState object responsible
for getting client information from
the wizard archive.
hasGUI
public boolean hasGUI()
- Returns true if this AppConsole object has a gui that can display
images.
hasConsole
public boolean hasConsole()
- Returns true if this Iterator object has a text console that can
display text and return user text input.
getFirstComponent
public WizardComponent getFirstComponent()
- Get the first component in this wizard
run
public void run()
- Display the buttons when the WizardState has initialized.
isTraversingForward
public boolean isTraversingForward()
- Says whether we are currently traversing forward or not.
- Returns:
- true if we arrived at the current panel by pressing
a "next" method.
setImage
public void setImage(String imageName)
- Set the main image shown on the left
- Parameters:
- imageName - The name of the image to use, in wizard resource form
setBaselineImage
public void setBaselineImage(String baselineImageName)
- Set the baseline image shown on the left
- Parameters:
- baselineImageName - The name of the image to use, in wizard resource form.
getImage
public String getImage()
- Get the main image shown on the left
- Returns:
- The name of the image to use, in wizard resource form
getBaselineImage
public String getBaselineImage()
- Get the baseline image shown on the left
- Returns:
- baselineImageName The name of the image to use, in wizard resource form.
setIconImage
public void setIconImage(Image icon)
- Set the icon image of the wizard frame.
- Parameters:
- icon - The icon image to be displayed.
setWizardSize
public void setWizardSize(Dimension size)
- Sets the size of the wizard frame.
- Parameters:
- size - The new size for the wizard frame.
getWizardSize
public Dimension getWizardSize()
- Gets the size of the wizard frame.
- Returns:
- The current size of the wizard.
setWizardState
public void setWizardState(WizardState state)
- Sets the Wizard State that controls this wizard. Use
with caution! This replaces the only connection the client
has with the server. All subsequent calls to the server-side
wizard state will be routed to this new wizard state.
- Parameters:
- state - The new state to install for this tree.
getWizardState
public WizardState getWizardState()
- Gets the WizardState for this wizard.
- Returns:
- The current WizardState controlling this wizard.
createWizardPanel
protected void createWizardPanel()
- Creates the wizard panel. The wizard panel is the container
in which the wizard client tree will be displayed. This method
also creates the client tree.
createNavigationPanel
protected void createNavigationPanel()
- Creates the navigation panel. The navigation panel is a
panel that provides buttons with which a user will navigate
the wizard client tree.
createImagePanel
protected void createImagePanel()
- Creates the image panel. The image panel is the panel
that displays the wizard image.
createBaselinePanel
protected void createBaselinePanel()
- Creates the wizard's baseline panel. This panel is the panel
that displays the wizard's baseline name image.
getWizardPanel
public Panel getWizardPanel()
- Returns the wizard panel created through a call to
createWizardPanel.
- Returns:
- The wizard panel.
getNavigationPanel
public Panel getNavigationPanel()
- Returns the navigation panel created through a call
to
createNavigationPanel.
- Returns:
- The navigation panel.
getImagePanel
public Panel getImagePanel()
- Returns the image panel created through a call to
createImagePanel
- Returns:
- The image panel.
getBaselinePanel
public Panel getBaselinePanel()
- Returns the baseline panel created through a call to
createBaselinePanel
- Returns:
- The image panel.
setFrameTitle
public void setFrameTitle(String title)
- Sets the title of the window comtaining the wizard.
Calls setTitle() of the java.awt.Frame.
- Parameters:
- title - The new title of the Frame.
initialize
public void initialize()
- This method should be called when the window containing the
wizard tree is opened. This method is responsible for loading
images and initialization of components.
createSubTree
public WizardComposite createSubTree(Route route,
String subtreeName)
- Create a subtree with the specified name and the specified route to
a server side object.
- Parameters:
- route - The route to the correct server side object.
- subtreeName - The name of the desired subtree. If this is
set to null, the entire wizard tree is
created.
- Returns:
- The desired tree, or null if the requested tree has not
been written into the wizard archive.
getNamedResource
public byte[] getNamedResource(Route route,
String type,
String name)
- This method returns the bytes of the named resource of the
specified type.
- Parameters:
- route - The route to the correct WizardState to resolve the
desired resource.
- type - The type of resource.
- name - The name of the resource.
- Returns:
- The byte array representing the requested resource.
getImage
public Image getImage(Route route,
String name)
- This method gets the specified image from the archive identified
by the specified route.
- Parameters:
- route - The route to the correct archive.
- name - The name of the desired image.
- Returns:
- The desired image, or null if the image does not exist
in the archive.
getCurrentPanel
public WizardComponent getCurrentPanel()
- Returns the current wizard panel. The current panel is the
wizard panel currently being displayed by the IteratorLayout.
- Returns:
- The wizard panel currently being displayed.
backButtonPressed
public synchronized void backButtonPressed()
- Invoked when the back button has been pressed.
nextButtonPressed
public synchronized void nextButtonPressed()
- Invoked when the next button has been pressed.
warpToLeaf
public synchronized void warpToLeaf(WizardComponent newLeaf)
- Visits the specified WizardComponent.
- Parameters:
- newLeaf - The leaf to visit.
cancelButtonPressed
public synchronized void cancelButtonPressed()
- Invoked when the cancel button has been pressed.
exitButtonPressed
public synchronized void exitButtonPressed()
- Invoked when the exit button has been pressed.
exitConfirmed
public void exitConfirmed()
- Invoked when the exit operation is confirmed by the user.
exit
public void exit(int exitStatus)
- Exits the server and client VMs with the specified exit
code.
- Parameters:
- exitStatus - The exit code.
doReboot
public void doReboot()
- Invoked when the reboot operation is confirmed by the user.
cancelConfirmed
public void cancelConfirmed()
- Invoked when the cancel operation is confirmed by the user.
continueConfirmed
public void continueConfirmed()
- Invoked when the continue operation is confirmed by the user.
actionPerformed
public void actionPerformed(ActionEvent e)
- Implementation of the ActionListener interface. This
method is called when any of the navigation buttons
are pressed, and dispatches that event to
the appropriate method.
displayCorrectButtons
public void displayCorrectButtons()
- Set the visibility of the buttons requested by the
currently displayed panel. The button visibility is
set by the button mask returned from the current panel.
- See Also:
- getButtonMask
setButtonLabel
public String setButtonLabel(String buttonFunction,
String newLabel)
- Change the label of the specified navigation button.
- Parameters:
- buttonFunction - A string representation of the
function the button performs.
i.e. "Next" for the next button.
- newLabel - The new label for the specified
button.
- Returns:
- The current button label.
setButtonEnabled
public void setButtonEnabled(String buttonFunction,
boolean b)
- Enables or disables the navigation button specified by
the button's function.
- Parameters:
- buttonFunction - A string representation of the
function the button performs.
i.e. "Next" for the next button.
- b - If true, this button is enabled;
otherwise, this button is disabled.
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.
- message - The message to be displayed to the user.
- title - The title of the query window, or the title shown
to the user in CLI mode.
- 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.
displayQuery
public void displayQuery(Object target,
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.
- 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.
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.
callClientObjectMethod
public Object callClientObjectMethod(Route route,
String methodName,
String argTypes[],
Object args[])
- Call a method on the client. The method is sent to the correct object
in the Wizard client tree via the specified route object.
- Parameters:
- route - The route to the desired client object.
- methodName - The name of the method to call.
- argTypes - The parameter list identifying the
correct method.
- args - The parameters to pass to the method.
- Returns:
- The method return value.
getWizardInitState
public int getWizardInitState()
- Returns the state of the WizardState. This state is represented
as a bit mask in which each bit represents a single step in the
WizardState initialization. The mask values have defininitions
within the Def object.
callServerObjectMethod
public Object callServerObjectMethod(Route route,
String methodName,
String argTypes[],
Object args[])
- Call a method on the server. The method is sent to the correct object
in the WizardState tree via the specified route object.
- Parameters:
- route - The route to the desired server object.
- methodName - The name of the method to call.
- argTypes - The parameter list identifying the
correct method.
- args - The parameters to pass to the method.
- Returns:
- The method return value.
callObjectMethod
public Object callObjectMethod(Object target,
String methodName,
String argTypes[],
Object args[])
- Call an object method through reflection.
- Parameters:
- target - The object to call the method on.
- methodName - The name of the method to call.
- argTypes - The parameter list identifying the
correct method.
- args - The parameters to pass to the method.
- Returns:
- The method return value.
addInitializationListener
public void addInitializationListener(InitializationListener listener)
- Add an initialization listener.
- Parameters:
- listener - The listener to add for notification of initialization events.
removeInitializationListener
public void removeInitializationListener(InitializationListener listener)
- Remove the specified initialization listener from the notification
list.
- Parameters:
- listener - The listener to remove.
All Packages Class Hierarchy This Package Previous Next Index