org.apache.pivot.wtk
Interface ListView.ItemRenderer
- All Superinterfaces:
- ConstrainedVisual, Renderer, Visual
- All Known Implementing Classes:
- ListViewColorItemRenderer, ListViewItemRenderer, TerraFileBrowserSkin.ListViewDriveRenderer, TerraFileBrowserSkin.ListViewFileRenderer
- Enclosing class:
- ListView
public static interface ListView.ItemRenderer
- extends Renderer
Renderer
interface to customize the appearance of items in a ListView.
Method Summary |
void |
render(Object item,
int index,
ListView listView,
boolean selected,
boolean checked,
boolean highlighted,
boolean disabled)
Prepares the renderer for layout or paint. |
String |
toString(Object item)
Converts a list item to a string representation. |
render
void render(Object item,
int index,
ListView listView,
boolean selected,
boolean checked,
boolean highlighted,
boolean disabled)
- Prepares the renderer for layout or paint.
- Parameters:
item
- The item to render, or null if called to calculate preferred
height for skins that assume a fixed renderer height.index
- The index of the item being rendered, or -1 if item
is null.listView
- The host component.selected
- If true, the item is selected.
the item.checked
- If true, the item is checked.highlighted
- If true, the item is highlighted.disabled
- If true, the item is disabled.
toString
String toString(Object item)
- Converts a list item to a string representation.
- Parameters:
item
-
- Returns:
- The item's string representation, or null if the item does not
have a string representation.
Note that this method may be called often during keyboard navigation, so
implementations should avoid unnecessary string allocations.