All Packages Class Hierarchy This Package Previous Next Index
Interface com.sgi.sysadm.ui.ItemViewFieldRenderer
- public interface ItemViewFieldRenderer
An interface that describes how to convert an Item into various fields
that are displayed in an ItemView.
The sequence that the methods will be called in is as follows:
- initializeFieldRenderer
- getComponentForField (once for each field using the
renderer)
- renderFields
- renderFieldsAgain (zero or more times)
- renderFieldsBlank
- repeat from step 3 (only if ItemView is used to display another
Item)
The ItemViewFieldRenderer is used by the ItemViewController to
render fields in ways that are not automatically handled by the
ItemViewController. To
use a ItemViewFieldRenderer, the programmer should set the METHOD
resource to "renderer" in the Category's property file and set the
FIELD_RENDERER property to a class that implements this interface.
See the ItemView and ItemViewController documentation for more information.
- See Also:
- METHOD, FIELD_RENDERER, ItemView, ItemViewController
-
getComponentForField(String)
- Returns the Component that this ItemViewFieldRenderer
is using to render a particular field.
-
initializeFieldRenderer(ItemViewContext, ItemViewController)
- A method to initialize the ItemViewFieldRenderer.
-
renderFields(Item)
- Tells the renderer to render all the fields that it is
supporting.
-
renderFieldsAgain(Item)
- Tells the renderer to render the fields after the Item has changed.
-
renderFieldsBlank()
- Tells the renderer to render all the fields as blanks.
initializeFieldRenderer
public abstract void initializeFieldRenderer(ItemViewContext ivc,
ItemViewController controller)
- A method to initialize the ItemViewFieldRenderer. The renderer
need take no action, but can initialize variables, etc.
Typically, this is also the place where the renderer creates
the components that are later returned in getComponentForField
- Parameters:
- ivc - The ItemViewContext
- controller - The ItemViewController.
getComponentForField
public abstract Component getComponentForField(String field)
- Returns the Component that this ItemViewFieldRenderer
is using to render a particular field. After initializing
the renderer with initializeFieldRenderer, this method
will be called once for each
field that is using the "renderer" method of display (set
via the METHOD property).
For convenience, ItemViewController has methods
getRLabelForFieldRenderer and
getRichTextForFieldRenderer that
return components that look like other Labels and RichText
components. Other components may be returned, though.
- Parameters:
- field - The field that is using the renderer, as
defined in the FIELDS string array in the
Category's property file.
- See Also:
- getRichTextForFieldRenderer, getRLabelForFieldRenderer, METHOD, FIELDS
renderFields
public abstract void renderFields(Item item)
- Tells the renderer to render all the fields that it is
supporting. This will be called the
first time the Item arrives in the ItemView. The Renderer
should setup anything that depends on the Item's selector, and
fill in all the Components that were returned by
getComponentForField. If any of the components change
after this method returns, then you should
call the fireFieldChanged method on the
ItemViewController that was passed to
initializeFieldRenderer.
- Parameters:
- item - The Item to render.
- See Also:
- fireFieldChanged
renderFieldsAgain
public abstract void renderFieldsAgain(Item item)
- Tells the renderer to render the fields after the Item has changed.
This will be called if the Item changes. The renderer can be
guaranteed that the Item's selector is unchanged from the prior
renderFields call, and therefore only needs to re-render
the fields that depend on the Item's Attributes. It's
only necessary to update the components whose apperance has
changed, but it's okay to update all components. If any of the
components change after this method returns,
then you should call the fireFieldsChanged method on the
ItemViewController that was passed to initializeFieldRenderer.
- Parameters:
- item - The Item to render.
- See Also:
- fireFieldChanged
renderFieldsBlank
public abstract void renderFieldsBlank()
- Tells the renderer to render all the fields as blanks. The
renderer should forget all about the Item that it learned about
in renderFields, and it's also the appropriate time to undo
any actions that have been done in the rendererFields
method so that this object can be garbage collected. This may
be the last call to the renderer, but if it's not, then it's
guaranteed that the next call will be to the renderFields
method.
All Packages Class Hierarchy This Package Previous Next Index