All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sgi.sysadm.ui.GenericItemRenderer

java.lang.Object
   |
   +----com.sgi.sysadm.ui.GenericItemRenderer

public abstract class GenericItemRenderer
extends Object
A class that can turn an Item into something else (For example a String or a Icon). Exactly what the Item is turned into is determined by subclasses.


Variable Index

 o CATEGORY_ONLY
A string that is passed as itemSelector to addRenderedObjectListener and removeRenderedObjectListener to signal that the caller is requesting that the rendered object contain information about the Category in general, instead of a particular Item.
 o ITEM_TABLE
A Object that is passed as context to createRenderedObject when the Item is being rendered for an ItemTable.
 o ITEM_VIEW
A Object that is passed as context to createRenderedObject when the Item is being rendered for an ItemView.
 o RESULT_VIEW
A Object that is passed as context to createRenderedObject when the Item is being rendered for an ResultView.
 o TREE_NODE
A Object that is passed as context to createRenderedObject when the Item is being rendered for a TreeView.

Constructor Index

 o GenericItemRenderer(String, ResourceStack, HostContext)
The constructor.

Method Index

 o addRenderedObjectListener(String, RenderedObjectListener, Object)
Adds a RenderedObjectListener to the renderer
 o createRenderedObject(Item, Object)
A method to generate the rendered object
 o getFullCategoryName()
 o getResourceStack()
 o notifyListeners(Item, boolean)
Notifies the listeners that the rendered object has changed
 o removeRenderedObjectListener(String, RenderedObjectListener)
Removes a RenderedObjectListener

Variables

 o ITEM_VIEW
 public static final Object ITEM_VIEW
A Object that is passed as context to createRenderedObject when the Item is being rendered for an ItemView.

 o RESULT_VIEW
 public static final Object RESULT_VIEW
A Object that is passed as context to createRenderedObject when the Item is being rendered for an ResultView.

 o ITEM_TABLE
 public static final Object ITEM_TABLE
A Object that is passed as context to createRenderedObject when the Item is being rendered for an ItemTable.

 o TREE_NODE
 public static final Object TREE_NODE
A Object that is passed as context to createRenderedObject when the Item is being rendered for a TreeView.

 o CATEGORY_ONLY
 public static final String CATEGORY_ONLY
A string that is passed as itemSelector to addRenderedObjectListener and removeRenderedObjectListener to signal that the caller is requesting that the rendered object contain information about the Category in general, instead of a particular Item.

Constructors

 o GenericItemRenderer
 protected GenericItemRenderer(String fullCategoryName,
                               ResourceStack rs,
                               HostContext hc)
The constructor. The arguments passed to this constructor are stored in protected member variables for use by subclasses.

Parameters:
fullCategoryName - The name of the Category that this should render Items of.
rs - A ResourceStack that is used to look up properties.
hc - The HostContext that is used to obtain Categories.

Methods

 o addRenderedObjectListener
 protected void addRenderedObjectListener(String itemSelector,
                                          RenderedObjectListener listener,
                                          Object context)
Adds a RenderedObjectListener to the renderer

Parameters:
itemSelector - The Item the listener is interested in. The caller can pass CATEGORY_ONLY to indicate that it is interested in the Category, rather than a particular Item.
listener - The listener
context - An Object that is passed to the renderer to control how the object is to be rendered. The GenericItemRenderer subclass and the caller of this method can create a protocol about how the context will be used. When the infrastructure uses ItemRenderers, it uses ITEM_VIEW, RESULT_VIEW, ITEM_TABLE, and TREE_NODE as contexts.
See Also:
CATEGORY_ONLY, ITEM_VIEW, RESULT_VIEW, ITEM_TABLE, TREE_NODE
 o removeRenderedObjectListener
 protected void removeRenderedObjectListener(String itemSelector,
                                             RenderedObjectListener listener)
Removes a RenderedObjectListener

Parameters:
itemSelector - The Item that the listener is no longer interested in. The listener will continue to receive notification about other Items that it has registered interest in. CATEGORY_ONLY is a legal value, if it was passed to a corresponding addRenderedObjectListener call.
listener - The listener to remove.
See Also:
CATEGORY_ONLY
 o notifyListeners
 protected void notifyListeners(Item item,
                                boolean removed)
Notifies the listeners that the rendered object has changed

Parameters:
item - The Item that changed
removed - true if the Item has been deleted, else false
 o createRenderedObject
 protected abstract Object createRenderedObject(Item item,
                                                Object context)
A method to generate the rendered object

Parameters:
item - The Item to base the object on.
context - The context to use to render the object.
 o getResourceStack
 protected ResourceStack getResourceStack()
Returns:
The renderer's ResourceStack.
 o getFullCategoryName
 protected String getFullCategoryName()
Returns:
The full name of the Category for which items are being rendered.

All Packages  Class Hierarchy  This Package  Previous  Next  Index