All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sgi.sysadm.ui.ResultViewPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----javax.swing.JPanel
                                   |
                                   +----com.sgi.sysadm.ui.ResultViewPanel

public class ResultViewPanel
extends JPanel
A class that displays the results of a Task. The ResultPanel contains three sub-components. The first, located at the top of the panel, is a RichTextComponent that contains text describing the results of the Task. The text can be simple and just say that the Task sucessfuly completed, or it can give detailed information about the actions carried out by the Task. The text may also tell the user what steps logically follow after completing this Task.

The second section, located in the middle of the panel, contains a Item icon and a link to launch an ItemView. This section is optional, and is only used when the Task has operated on a particular Item.

The third section is a TaskShelf, which displays the Tasks that are logical to perform given the current Item and its current state.

There are 7 constructors which offer a wide variety of ways to create a ResultView panel. Here as some tips to choosing the correct constructor:

Does the Task operate on a particular Item, and is that Item still in existance when the Task finishes?
If so, use one of the constructors that takes an itemSelector and categoryName, or an itemTester and a categoryName. Choosing one of these constructors will allow the ResultViewPanel to show a link to launch the ItemView for the Item that was operated on. It will also allow the TaskShelf to show Tasks that are applicable to the Item in question. The choice whether to use the itemSelector or itemTester version of the constructor depends on whether or not the Task knows the selector of the Item it operated on. If so, pass the selector to the constructor. If not, then pass an ItemTester that can positively identify the Item

Does the Task operate on a particular Category of Items, rather than a particular Item, or does the Task delete an Item?
In either of these cases, there is no Item to display, but you should still pass the name of the Category to the constructor so that the Tasks relavent to the Category can be placed in the TaskShelf.

Will the TaskRegistry provide all of the Tasks that should be shown in the TaskShelf.
If you use a constructor that takes a categoryName (or a categoryName + itemSelector or categoryName + itemTester), then the ResultViewPanel will use the TaskRegistry to fill the TaskShelf with relavant Tasks. If there are some Tasks that should be in the ResultViewPanel that will not be returned by the TaskRegistry, then you should use one of the constructors that accepts an array of TaskLoaders. The Tasks specified by the TaskLoaders will be placed ahead of any Tasks that the TaskRegistry provides in the TaskShelf.

See Also:
RichTextComponent, ItemTester, TaskRegistry, TaskLoader

Variable Index

 o H_MARGIN
A resource ResultViewPanel.horizontalMargin is the width (in points) of the margin to use on the left and right of the panel.
 o ICON_HEIGHT
A resource ResultViewPanel.iconHeight is an integer that specifies the height (in points) of the icon.
 o ICON_TO_LINK_SPACING
A resource ResultViewPanel.iconToLinkSpacing is an integer that gives the horizontal space (in points) to put between the icon and the link.
 o ICON_WIDTH
A resource ResultViewPanel.iconWidth is an integer that specifies the width (in points) of the icon.
 o LINK_TO_SHELF_SPACING
A resource ResultViewPanel.shelfToButtonSpacing is an integer that gives the vertical space (in points) to put between the ItemView link and the TaskShelf.
 o PLEASE_WAIT
A resource ResultViewPanel.pleaseWait is the string that is displayed in place of the Item's name until the name is known.
 o SHOW_TASK_SHELF
A system property that controls whether the TaskShelf is shown in the ResultViewPanel.
 o TEXT_TO_LINK_SPACING
A resource ResultViewPanel.textToLinkSpacing is an integer that gives the vertical space (in points) to put between the text area and the ItemView link.
 o TEXT_TO_SHELF_SPACING
A resource ResultViewPanel.textToShelfSpacing is an integer that gives the vertical space (in points) to put between the text area and the TaskShelf.
 o V_MARGIN
A resource ResultViewPanel.verticalMargin is the height (in points) of the margin to use on the top and bottom of the panel.

Constructor Index

 o ResultViewPanel(UIContext, ResourceStack, String, ItemTester, String)
A constructor that takes a TaskLoader[], a Category name, Item tester, and message.
 o ResultViewPanel(UIContext, ResourceStack, String, String)
A constructor that contains a Category name and message.
 o ResultViewPanel(UIContext, ResourceStack, String, String, String)
A constructor that takes a TaskLoader[], a Category name, Item name, and message.
 o ResultViewPanel(UIContext, ResourceStack, TaskLoader[], String)
A constructor that contains a message and a list of Tasks that might logically follow the Task that has finished.
 o ResultViewPanel(UIContext, ResourceStack, TaskLoader[], String, ItemTester, String)
A constructor that takes a TaskLoader[], a Category name, Item tester, and message.
 o ResultViewPanel(UIContext, ResourceStack, TaskLoader[], String, String)
A constructor that contains a Category name and message.
 o ResultViewPanel(UIContext, ResourceStack, TaskLoader[], String, String, String)
A constructor that takes a TaskLoader[], a Category name, Item selector, and message.

Method Index

 o addItemViewLaunchRequestListener(ItemViewLaunchRequestListener)
Adds an ItemViewLaunchRequestListener to the list of listeners that will be notified if an ItemView launch is requested.
 o addTaskLaunchRequestListener(TaskLaunchRequestListener)
Adds a TaskLaunchRequestListener to the list of listeners that will be notified if an Task launch is requested.
 o destroy()
Destroys this ResultViewPanel for garbage collection purposes.

Variables

 o TEXT_TO_LINK_SPACING
 public static final String TEXT_TO_LINK_SPACING
A resource ResultViewPanel.textToLinkSpacing is an integer that gives the vertical space (in points) to put between the text area and the ItemView link.

 o TEXT_TO_SHELF_SPACING
 public static final String TEXT_TO_SHELF_SPACING
A resource ResultViewPanel.textToShelfSpacing is an integer that gives the vertical space (in points) to put between the text area and the TaskShelf. Only used if there's no link to launch an ItemView.

 o LINK_TO_SHELF_SPACING
 public static final String LINK_TO_SHELF_SPACING
A resource ResultViewPanel.shelfToButtonSpacing is an integer that gives the vertical space (in points) to put between the ItemView link and the TaskShelf.

 o ICON_TO_LINK_SPACING
 public static final String ICON_TO_LINK_SPACING
A resource ResultViewPanel.iconToLinkSpacing is an integer that gives the horizontal space (in points) to put between the icon and the link.

 o ICON_WIDTH
 public static final String ICON_WIDTH
A resource ResultViewPanel.iconWidth is an integer that specifies the width (in points) of the icon.

 o ICON_HEIGHT
 public static final String ICON_HEIGHT
A resource ResultViewPanel.iconHeight is an integer that specifies the height (in points) of the icon.

 o V_MARGIN
 public static final String V_MARGIN
A resource ResultViewPanel.verticalMargin is the height (in points) of the margin to use on the top and bottom of the panel.

 o H_MARGIN
 public static final String H_MARGIN
A resource ResultViewPanel.horizontalMargin is the width (in points) of the margin to use on the left and right of the panel.

 o PLEASE_WAIT
 public static final String PLEASE_WAIT
A resource ResultViewPanel.pleaseWait is the string that is displayed in place of the Item's name until the name is known. The ResultViewPanel is often displayed before it has retreived the Item that the Task has operated on from the server. Until the ItemArrives, the PLEASE_WAIT string will be displayed as the Item's name.

 o SHOW_TASK_SHELF
 public static final String SHOW_TASK_SHELF
A system property that controls whether the TaskShelf is shown in the ResultViewPanel. If this property is defined, then the TaskShelf will be shown.

Constructors

 o ResultViewPanel
 public ResultViewPanel(UIContext uic,
                        ResourceStack rs,
                        TaskLoader loaders[],
                        String message)
A constructor that contains a message and a list of Tasks that might logically follow the Task that has finished. This is meant to be used when there is no Item or Category to give the status of.

Parameters:
uic - The UIContext to use for this ResultViewPanel.
rs - The ResourceStack to use to control this ResultViewPanel.
loaders - The list of TaskLoaders whose Tasks should be displayed in the TaskShelf.
message - A localized string to display in the ResultViewPanel. The string can contain any markup that RichText can understand.
 o ResultViewPanel
 public ResultViewPanel(UIContext uic,
                        ResourceStack rs,
                        TaskLoader loaders[],
                        String categoryName,
                        String itemSelector,
                        String message)
A constructor that takes a TaskLoader[], a Category name, Item selector, and message. The ResultView will display the message, a list of Tasks that are logical for the Item in its current state (as returned by TaskRegistry) with the Tasks in loader prepended, and a link to launch an ItemView for the Item. This is meant to be used when the Task operates on a particular Item.

Parameters:
uic - The UIContext to use for this ResultViewPanel.
rs - The ResourceStack to use to control this ResultViewPanel.
loaders - An array of Task loaders. These Tasks will appear first in the TaskShelf.
categoryName - The name of the Category that contains the Item that the Task operated on.
itemSelector - The selector of the Item that the Task operated on.
message - A localized string to display in the ResultViewPanel. The string can contain any markup that RichText can understand.
 o ResultViewPanel
 public ResultViewPanel(UIContext uic,
                        ResourceStack rs,
                        TaskLoader loaders[],
                        String categoryName,
                        String message)
A constructor that contains a Category name and message. The Result view will display the message, and a list of Tasks that are logical for that category (as returned by TaskRegistry), with the Tasks in loaders prepended. This is meant to be used when the Task does not have a specific Item to show the status of, but has operated on a particular Category (for example, a delete Task).

Parameters:
uic - The UIContext to use for this ResultViewPanel.
rs - The ResourceStack to use to control this ResultViewPanel.
loaders - An array of Task loaders. These Tasks will appear first in the TaskShelf.
categoryName - The name of the Category that contains the Item that the Task operated on.
message - A localized string to display in the ResultViewPanel. The string can contain any markup that RichText can understand.
 o ResultViewPanel
 public ResultViewPanel(UIContext uic,
                        ResourceStack rs,
                        String categoryName,
                        String message)
A constructor that contains a Category name and message. The Result view will display the message, and a list of Tasks that are logical for that Category (as returned by TaskRegistry). This is meant to be used when the Task has operated on a Category, but doesn't have a specific Item to display the state of.

Parameters:
uic - The UIContext to use for this ResultViewPanel.
rs - The ResourceStack to use to control this ResultViewPanel.
categoryName - The name of the Category that contains the Item that the Task operated on.
message - A localized string to display in the ResultViewPanel. The string can contain any markup that RichText can understand.
 o ResultViewPanel
 public ResultViewPanel(UIContext uic,
                        ResourceStack rs,
                        String categoryName,
                        String itemSelector,
                        String message)
A constructor that takes a TaskLoader[], a Category name, Item name, and message. The ResultView will display the message, a list of Tasks that are logical for the Item in its current state (as returned by TaskRegistry), and a way to show the ItemView for the Item. This is meant to be used when the Task creates or modifies an Item, and the Item's selector is known.

Parameters:
uic - The UIContext to use for this ResultViewPanel.
rs - The ResourceStack to use to control this ResultViewPanel.
categoryName - The name of the Category that contains the Item that the Task operated on.
itemSelector - The selector of the Item that the Task operated on.
message - A localized string to display in the ResultViewPanel. The string can contain any markup that RichText can understand.
 o ResultViewPanel
 public ResultViewPanel(UIContext uic,
                        ResourceStack rs,
                        String categoryName,
                        ItemTester itemTester,
                        String message)
A constructor that takes a TaskLoader[], a Category name, Item tester, and message. The ResultView will display the message, a list of Tasks that are logical for the Item found by the tester in its current state (as returned by TaskRegistry), and a way to show the ItemView for the Item. This is meant to be used when the Task creates or modifies an Item, and the Item's selector in not known, but the Item can be identified with an ItemTester.

Parameters:
uic - The UIContext to use for this ResultViewPanel.
rs - The ResourceStack to use to control this ResultViewPanel.
categoryName - The name of the Category that contains the Item that the Task operated on.
itemTester - An ItemTester that returns TEST_PASSED when it identifies the Item that the Task operated on.
message - A localized string to display in the ResultViewPanel. The string can contain any markup that RichText can understand.
 o ResultViewPanel
 public ResultViewPanel(UIContext uic,
                        ResourceStack rs,
                        TaskLoader loaders[],
                        String categoryName,
                        ItemTester itemTester,
                        String message)
A constructor that takes a TaskLoader[], a Category name, Item tester, and message. The ResultView will display the message, a list of Tasks that are logical for the Item found by the tester in its current state (as returned by TaskRegistry) with the tasks from loaders prepended, and a way to show the ItemView for the Item. This is meant to be used when the Task creates or modifies an Item and the Item's selector in not known, but the Item can be identified with an ItemTester.

Parameters:
uic - The UIContext to use for this ResultViewPanel.
rs - The ResourceStack to use to control this ResultViewPanel.
loaders - An array of Task loaders. These Tasks will appear first in the TaskShelf.
categoryName - The name of the Category that contains the Item that the Task operated on.
itemTester - An ItemTester that returns TEST_PASSED when it identifies the Item that the Task operated on.
message - A localized string to display in the ResultViewPanel. The string can contain any markup that RichText can understand.

Methods

 o addItemViewLaunchRequestListener
 public void addItemViewLaunchRequestListener(ItemViewLaunchRequestListener listener)
Adds an ItemViewLaunchRequestListener to the list of listeners that will be notified if an ItemView launch is requested. If there are no listeners added, then the default behavior is to launch the ItemView in a new ItemViewFrame.

Parameters:
listener - The ItemViewLaunchRequestListener to add.
 o addTaskLaunchRequestListener
 public void addTaskLaunchRequestListener(TaskLaunchRequestListener listener)
Adds a TaskLaunchRequestListener to the list of listeners that will be notified if an Task launch is requested. If there are no listeners added, then the default behavior is to launch the Task in a new TaskFrame.

Parameters:
listener - The TaskLaunchRequestListener to add
 o destroy
 public void destroy()
Destroys this ResultViewPanel for garbage collection purposes.


All Packages  Class Hierarchy  This Package  Previous  Next  Index