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.
-
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.
-
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.
-
TaskFrame()
- Constructor.
-
TaskFrame(Task)
- Constructor that includes task to display.
-
addTaskDoneListener(TaskDoneListener)
- Register interest in task completion.
-
launchTaskFrame(TaskLaunchRequestEvent, UIContext, int)
- A static method to launch a Task in a new TaskFrame.
-
launchTaskFrame(TaskLaunchRequestEvent, UIContext, int, ResultListener)
- A static method to launch a Task in a new TaskFrame.
-
notifyDoneListeners(TaskResult)
- Notify TaskDoneListeners of task completion.
-
removeTaskDoneListener(TaskDoneListener)
- Unregister interest in task completion.
-
setResultHandling(int)
- Set the result handling method for the TaskFrame.
-
setTask(Task)
- Set or replace the Task displayed in this frame.
-
taskDone(TaskResult)
- Notify TaskDoneListeners that the Task completed successfully
or was cancelled by the User.
-
titleChanged(TitleEvent)
- Notify TitleListeners that the title changed.
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.
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.
TaskFrame
public TaskFrame()
- Constructor.
TaskFrame
public TaskFrame(Task task)
- Constructor that includes task to display.
- Parameters:
- task - The task to display and listen to.
setTask
public void setTask(Task task)
- Set or replace the Task displayed in this frame.
- Parameters:
- task - Task to display in this frame.
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
addTaskDoneListener
public void addTaskDoneListener(TaskDoneListener listener)
- Register interest in task completion.
- Parameters:
- listener - Listener interested in task completion.
removeTaskDoneListener
public void removeTaskDoneListener(TaskDoneListener listener)
- Unregister interest in task completion.
- Parameters:
- listener - Listener no longer interested in task completion.
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.
titleChanged
public void titleChanged(TitleEvent event)
- Notify TitleListeners that the title changed.
- Parameters:
- event - A TitleEvent containing the new title.
- See Also:
- titleChanged
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
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
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