org.havi.ui
Class HListElement

java.lang.Object
  extended by org.havi.ui.HListElement

public class HListElement
extends java.lang.Object

HListElement is a holder for content used with the HListGroup component. It must contain a text string, and may also contain a single graphical image.

Applications should not directly manipulate HListElement objects. They are intended to be used in conjunction with an HListGroup which maintains a list of them, and is responsible for their rendering via the HListGroupLook class. The methods setIcon() and setLabel() of HListElement shall not be used for elements, which are part of HListGroup. If an application requires to alter the content, it shall either replace the entire element, or remove it temporarily and re-add it after the content was changed.


The parameters to the constructors are as follows, in cases where parameters are not used, then the constructor should use the default values.

Default parameter values exposed in the constructors

ParameterDescriptionDefault value Set methodGet method
label text content of this item no default - getLabel
icon image content of this item null - getIcon

Default parameter values not exposed in the constructors

DescriptionDefault valueSet method Get method
None.

See Also:
HListGroup, HListGroupLook

Constructor Summary
HListElement(java.awt.Image icon, java.lang.String label)
          Creates an HListElement object.
HListElement(java.lang.String label)
          Creates an HListElement object.
 
Method Summary
 java.awt.Image getIcon()
          Retrieve the icon for this HListElement.
 java.lang.String getLabel()
          Retrieve the label for this HListElement.
 void setIcon(java.awt.Image icon)
          Set the icon for this HListElement.
 void setLabel(java.lang.String label)
          Set the label for this HListElement.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HListElement

public HListElement(java.lang.String label)
Creates an HListElement object. See the class description for details of constructor parameters and default values.

Parameters:
label - The label for this HListElement.

HListElement

public HListElement(java.awt.Image icon,
                    java.lang.String label)
Creates an HListElement object. See the class description for details of constructor parameters and default values.

Parameters:
icon - The icon for this HListElement.
label - The label for this HListElement.
Method Detail

getLabel

public java.lang.String getLabel()
Retrieve the label for this HListElement.

Returns:
the text label for this HListElement.

getIcon

public java.awt.Image getIcon()
Retrieve the icon for this HListElement.

Returns:
the graphical icon for this HListElement, or null if no icon was set.

setLabel

public void setLabel(java.lang.String label)
Set the label for this HListElement.

Parameters:
label - The label for this HListElement.

setIcon

public void setIcon(java.awt.Image icon)
Set the icon for this HListElement. If icon is null, the HListElement will be in the same state as if no icon was set.

Parameters:
icon - The icon for this HListElement.