All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sgi.sysadm.ui.TaskFrame

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----javax.swing.JFrame
                                           |
                                           +----com.sgi.sysadm.ui.RFrame
                                                   |
                                                   +----com.sgi.sysadm.ui.TaskFrame

public class TaskFrame
extends RFrame
implements TitleListener, TaskDoneListener
TaskFrame is a container for displaying tasks. TaskFrame is intended for Task clients that want to a task in a separate, standalone window. The TaskFrame may be reused to show a set of Tasks in sequence.

By default, TaskFrame will post a result panel when the Task completes successfully. This behavior can be modified by calling TaskFrame.setResultHandling(). If result handling is set to TaskFrame.POST_RESULT_PANEL (the default), TaskFrame clients will be notified of successful task completion after the posted result panel has been dismissed by the user.

TaskFrame clients should not call Task.addTaskDoneListener(), but should instead call TaskFrame.addTaskDoneListener() so they can be certain that the TaskFrame has a chance to respond to Task completion.


Variable Index

 o DONT_POST_RESULT_PANEL
If the resultHandling parameter to setResultHandling() is set to TaskFrame.POST_RESULT_PANEL, then the TaskFrame will not display a result panel if the task succeeds.
 o POST_RESULT_PANEL
If the resultHandling parameter to setResultHandling() is set to TaskFrame.POST_RESULT_PANEL, then the TaskFrame will display a result panel if the task succeeds.

Constructor Index

 o TaskFrame()
Constructor.
 o TaskFrame(Task)
Constructor that includes task to display.

Method Index

 o addTaskDoneListener(TaskDoneListener)
Register interest in task completion.
 o launchTaskFrame(TaskLaunchRequestEvent, UIContext, int)
A static method to launch a Task in a new TaskFrame.
 o launchTaskFrame(TaskLaunchRequestEvent, UIContext, int, ResultListener)
A static method to launch a Task in a new TaskFrame.
 o notifyDoneListeners(TaskResult)
Notify TaskDoneListeners of task completion.
 o removeTaskDoneListener(TaskDoneListener)
Unregister interest in task completion.
 o setResultHandling(int)
Set the result handling method for the TaskFrame.
 o setTask(Task)
Set or replace the Task displayed in this frame.
 o taskDone(TaskResult)
Notify TaskDoneListeners that the Task completed successfully or was cancelled by the User.
 o titleChanged(TitleEvent)
Notify TitleListeners that the title changed.

Variables

 o POST_RESULT_PANEL
 public static final int POST_RESULT_PANEL
If the resultHandling parameter to setResultHandling() is set to TaskFrame.POST_RESULT_PANEL, then the TaskFrame will display a result panel if the task succeeds.

 o DONT_POST_RESULT_PANEL
 public static final int DONT_POST_RESULT_PANEL
If the resultHandling parameter to setResultHandling() is set to TaskFrame.POST_RESULT_PANEL, then the TaskFrame will not display a result panel if the task succeeds.

Constructors

 o TaskFrame
 public TaskFrame()
Constructor.

 o TaskFrame
 public TaskFrame(Task task)
Constructor that includes task to display.

Parameters:
task - The task to display and listen to.

Methods

 o setTask
 public void setTask(Task task)
Set or replace the Task displayed in this frame.

Parameters:
task - Task to display in this frame.
 o setResultHandling
 public void setResultHandling(int resultHandling)
Set the result handling method for the TaskFrame.

Parameters:
resultHandling - Set to POST_RESULT_PANEL if you want the TaskFrame to handle task completion, otherwise set to DONT_POST_RESULT_PANEL.
See Also:
POST_RESULT_PANEL, DONT_POST_RESULT_PANEL
 o addTaskDoneListener
 public void addTaskDoneListener(TaskDoneListener listener)
Register interest in task completion.

Parameters:
listener - Listener interested in task completion.
 o removeTaskDoneListener
 public void removeTaskDoneListener(TaskDoneListener listener)
Unregister interest in task completion.

Parameters:
listener - Listener no longer interested in task completion.
 o notifyDoneListeners
 protected void notifyDoneListeners(TaskResult result)
Notify TaskDoneListeners of task completion. Derived classes which override taskDone() should call this method.

Parameters:
result - Result of task completion.
 o titleChanged
 public void titleChanged(TitleEvent event)
Notify TitleListeners that the title changed.

Parameters:
event - A TitleEvent containing the new title.
See Also:
titleChanged
 o taskDone
 public void taskDone(TaskResult result)
Notify TaskDoneListeners that the Task completed successfully or was cancelled by the User. If the Task was successful, and the TaskFrame's result handling is POST_RESULT_PANEL, and Task.getResultViewPanel() returns a non-null ResultViewPanel, this will pass the ResultViewPanel to ResultViewFrame.launchResultViewFrame().

Parameters:
result - A TaskResult containing information about Task completion.
See Also:
taskDone
 o launchTaskFrame
 public static void launchTaskFrame(TaskLaunchRequestEvent tlre,
                                    UIContext uic,
                                    int resultHandling,
                                    ResultListener listener)
A static method to launch a Task in a new TaskFrame.

Parameters:
tlre - The TaskLauchRequestEvent that specifies the Task to launch
uic - The UIContext to use when displaying the Task
resultHandling - pass POST_RESULT_PANEL, or DONT_POST_RESULT_PANEL, as appropriate.
listener - A ResultListener that will be notified of the Task when it is created. Cast the result in ResultEvent to a Task. If the Task fails to launch, listener.failed() will be called.
See Also:
POST_RESULT_PANEL, DONT_POST_RESULT_PANEL
 o launchTaskFrame
 public static void launchTaskFrame(TaskLaunchRequestEvent event,
                                    UIContext uic,
                                    int resultHandling)
A static method to launch a Task in a new TaskFrame.

Parameters:
event - The TaskLauchRequestEvent that specifies the Task to launch
uic - The UIContext to use when displaying the Task
resultHandling - pass POST_RESULT_PANEL, or DONT_POST_RESULT_PANEL, as appropriate.
See Also:
POST_RESULT_PANEL, DONT_POST_RESULT_PANEL

All Packages  Class Hierarchy  This Package  Previous  Next  Index