Eclipse eRCP
Release 1.1

org.eclipse.ercp.swt.mobile
Class ListBoxItem

java.lang.Object
  extended byorg.eclipse.ercp.swt.mobile.ListBoxItem

public class ListBoxItem
extends Object

Instances of this class represent an item in a ListBox widget. Heading and detail icons, if provided, are displayed at the size provided, or stretched to fit the ListBox styles. For consistancy, all heading icons should be the same size and all detail icons should be the same size for any one list. Elements of a ListBoxItem which are null are not displayed in the ListBox layout.

See Also:
ListBox

Constructor Summary
ListBoxItem()
          Constructs a new instance of this class.
ListBoxItem(String detailText, Image detailIcon, String headingText, Image headingIcon)
          Constructs a new instance of this class and initializes it using provided data.
 
Method Summary
 Image[] getDetailIcons()
          Gets the detail icons of the item.
 String getDetailText()
          Gets the detail text of the item.
 Image[] getHeadingIcons()
          Gets the heading icons for this item.
 String getHeadingText()
          Gets the heading text of the item.
 void setDetailIcons(Image[] icons)
          Sets the detail icons of the item.
 void setDetailText(String detailText)
          Sets the detail text of the item.
 void setHeadingIcons(Image[] icons)
          Sets the heading icons for this item.
 void setHeadingText(String headingText)
          Sets the heading text of the item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListBoxItem

public ListBoxItem()
Constructs a new instance of this class.


ListBoxItem

public ListBoxItem(String detailText,
                   Image detailIcon,
                   String headingText,
                   Image headingIcon)
Constructs a new instance of this class and initializes it using provided data. Arguments may be null except for detailText.

Parameters:
detailText - string providing detail text
detailIcon - Image providing single detail icon
headingText - detail string providing detail text
headingIcon - Image providing single heading icon
Throws:
IllegalArgumentException -
Method Detail

getDetailIcons

public Image[] getDetailIcons()
Gets the detail icons of the item. The return value may be null.

Returns:
array of detail icons

getDetailText

public String getDetailText()
Gets the detail text of the item.

Returns:
string providing detail text

getHeadingIcons

public Image[] getHeadingIcons()
Gets the heading icons for this item. The return value may be null.

Returns:
array of heading icons

getHeadingText

public String getHeadingText()
Gets the heading text of the item. The return value may be null.

Returns:
string providing heading text

setDetailIcons

public void setDetailIcons(Image[] icons)
Sets the detail icons of the item. If null is provided for either the array or an individual element then no icon is displayed. Semantically, the detail icons represent attributes of the item and are always small. They may come and go or change frequently. Only one detail icon is guaranteed to be displayed. Use of more than one detail icon is implementation dependent.

Parameters:
icons - array providing detail icons

setDetailText

public void setDetailText(String detailText)
Sets the detail text of the item.

Parameters:
detailText - string providing detail text
Throws:
IllegalArgumentException -
  • ERROR_NULL_ARGUMENT - if detail text is null

setHeadingIcons

public void setHeadingIcons(Image[] icons)
Sets the heading icons for this item. If null is provided for either the whole array or an individual array element no icon is displayed. Semantically, the heading icon is the primary icon, representing the item itself or a catagory. It is likely to be static and could be small or large. Only one heading icon is guaranteed to be displayed. Use of more than one heading icon is implementation dependent.

Parameters:
icons - array providing heading icons, or null.

setHeadingText

public void setHeadingText(String headingText)
Sets the heading text of the item. If null is provided, no heading is displayed.

Parameters:
headingText - string providing heading text

Eclipse eRCP
Release 1.1