|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.Component
org.apache.pivot.wtk.ListView
public class ListView
Component that displays a sequence of items, optionally allowing a user to select or check one or more items.
Nested Class Summary | |
---|---|
static interface |
ListView.ItemEditor
List item editor interface. |
static interface |
ListView.ItemRenderer
List item renderer interface. |
static class |
ListView.SelectMode
Enumeration defining supported selection modes. |
static interface |
ListView.Skin
List view skin interface. |
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component |
---|
Component.ComponentDictionary, Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary |
Constructor Summary | |
---|---|
ListView()
Creates a list view populated with an empty array list. |
|
ListView(List<?> listData)
Creates a list view populated with the given list data. |
Method Summary | |
---|---|
boolean |
addSelectedIndex(int index)
Adds a single index to the selection. |
Sequence<Span> |
addSelectedRange(int start,
int end)
Adds a range of indexes to the selection. |
Sequence<Span> |
addSelectedRange(Span range)
Adds a range of indexes to the selection. |
void |
clearSelection()
Clears the selection. |
Sequence<Integer> |
getCheckedIndexes()
Returns the indexes of currently checked items. |
boolean |
getCheckmarksEnabled()
Returns the current check mode. |
Filter<?> |
getDisabledItemFilter()
Returns the disabled item filter. |
int |
getFirstSelectedIndex()
Returns the first selected index. |
int |
getItemAt(int y)
Returns the index of the item at a given location. |
Bounds |
getItemBounds(int index)
Returns the bounding area of a given item. |
ListView.ItemEditor |
getItemEditor()
Returns the editor used to edit items in this list. |
int |
getItemIndent()
Returns the item indent. |
ListView.ItemRenderer |
getItemRenderer()
Returns the item renderer used for items in this list. |
int |
getLastSelectedIndex()
Returns the last selected index. |
List<?> |
getListData()
Returns the list data. |
ListenerList<ListViewItemListener> |
getListViewItemListeners()
Returns the list view item listener list. |
ListenerList<ListViewItemStateListener> |
getListViewItemStateListeners()
Returns the list view item state listener list. |
ListenerList<ListViewListener> |
getListViewListeners()
Returns the list view listener list. |
ListenerList<ListViewSelectionListener> |
getListViewSelectionListeners()
Returns the list view selection detail listener list. |
int |
getSelectedIndex()
When in single-select mode, returns the currently selected index. |
Object |
getSelectedItem()
|
String |
getSelectedItemKey()
|
Sequence<?> |
getSelectedItems()
|
String |
getSelectedItemsKey()
|
Sequence<Span> |
getSelectedRanges()
Returns the list's current selection. |
ListView.SelectMode |
getSelectMode()
Returns the current selection mode. |
boolean |
isItemChecked(int index)
Returns an item's checked state. |
boolean |
isItemDisabled(int index)
Returns an item's disabled state. |
boolean |
isItemSelected(int index)
Returns the selection state of a given index. |
void |
load(Dictionary<String,?> context)
Copies bound values from the bind context to the component. |
boolean |
removeSelectedIndex(int index)
Removes a single index from the selection. |
Sequence<Span> |
removeSelectedRange(int start,
int end)
Removes a range of indexes from the selection. |
Sequence<Span> |
removeSelectedRange(Span range)
Removes a range of indexes from the selection. |
void |
selectAll()
Selects all items in the list. |
void |
setCheckmarksEnabled(boolean checkmarksEnabled)
Enables or disabled checkmarks. |
void |
setDisabledItemFilter(Filter<?> disabledItemFilter)
Sets the disabled item filter. |
void |
setItemChecked(int index,
boolean checked)
Sets an item's checked state. |
void |
setItemEditor(ListView.ItemEditor itemEditor)
Sets the editor used to edit items in this list. |
void |
setItemRenderer(ListView.ItemRenderer itemRenderer)
Sets the item renderer to be used for items in this list. |
void |
setListData(List<?> listData)
Sets the list data. |
void |
setListData(String listData)
Sets the list data. |
void |
setSelectedIndex(int index)
Sets the selection to a single index. |
void |
setSelectedItem(Object item)
|
void |
setSelectedItemKey(String selectedItemKey)
|
void |
setSelectedItems(Sequence<Object> items)
|
void |
setSelectedItemsKey(String selectedItemsKey)
|
void |
setSelectedRange(int start,
int end)
Sets the selection to a single range. |
Sequence<Span> |
setSelectedRanges(Sequence<Span> selectedRanges)
Sets the selection to the given range sequence. |
Sequence<Span> |
setSelectedRanges(String selectedRanges)
Sets the selection to the given range sequence. |
void |
setSelectMode(ListView.SelectMode selectMode)
Sets the selection mode. |
void |
setSelectMode(String selectMode)
Sets the selection mode. |
protected void |
setSkin(Skin skin)
Sets the skin, replacing any previous skin. |
void |
store(Dictionary<String,?> context)
Copies bound values from the component to the bind context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ListView()
public ListView(List<?> listData)
listData
- Method Detail |
---|
public List<?> getListData()
public void setListData(List<?> listData)
listData
- The data to be presented by the list view.public void setListData(String listData)
listData
- The data to be presented by the list view as a JSON array.protected void setSkin(Skin skin)
Component
setSkin
in class Component
skin
- The new skin.public ListView.ItemRenderer getItemRenderer()
public void setItemRenderer(ListView.ItemRenderer itemRenderer)
itemRenderer
- The item renderer for the list.public ListView.ItemEditor getItemEditor()
public void setItemEditor(ListView.ItemEditor itemEditor)
itemEditor
- The item editor for the list.public int getSelectedIndex()
public void setSelectedIndex(int index)
index
- The index to select, or -1 to clear the selection.public void setSelectedRange(int start, int end)
start
- end
- public Sequence<Span> getSelectedRanges()
public Sequence<Span> setSelectedRanges(Sequence<Span> selectedRanges)
selectedRanges
-
public final Sequence<Span> setSelectedRanges(String selectedRanges)
selectedRanges
- A JSON-formatted string containing the ranges to select.
setSelectedRanges(Sequence)
public int getFirstSelectedIndex()
public int getLastSelectedIndex()
public boolean addSelectedIndex(int index)
index
- The index to add.
public Sequence<Span> addSelectedRange(int start, int end)
start
- The first index in the range.end
- The last index in the range.
public Sequence<Span> addSelectedRange(Span range)
range
- The range to add.
public boolean removeSelectedIndex(int index)
index
- The index to remove.
public Sequence<Span> removeSelectedRange(int start, int end)
start
- The start of the range to remove.end
- The end of the range to remove.
public Sequence<Span> removeSelectedRange(Span range)
range
- The range to remove.
public void selectAll()
public void clearSelection()
public boolean isItemSelected(int index)
index
- The index whose selection state is to be tested.
public Object getSelectedItem()
public void setSelectedItem(Object item)
public Sequence<?> getSelectedItems()
public void setSelectedItems(Sequence<Object> items)
public ListView.SelectMode getSelectMode()
public void setSelectMode(ListView.SelectMode selectMode)
selectMode
- The new selection mode.public void setSelectMode(String selectMode)
selectMode
- setSelectMode(org.apache.pivot.wtk.ListView.SelectMode)
public boolean getCheckmarksEnabled()
public void setCheckmarksEnabled(boolean checkmarksEnabled)
checkmarksEnabled
- public boolean isItemChecked(int index)
index
- public void setItemChecked(int index, boolean checked)
index
- checked
- public Sequence<Integer> getCheckedIndexes()
public boolean isItemDisabled(int index)
index
- The index of the item whose disabled state is to be tested.
public Filter<?> getDisabledItemFilter()
public void setDisabledItemFilter(Filter<?> disabledItemFilter)
disabledItemFilter
- The disabled item filter, or null for no disabled item filter.public String getSelectedItemKey()
public void setSelectedItemKey(String selectedItemKey)
public String getSelectedItemsKey()
public void setSelectedItemsKey(String selectedItemsKey)
public void load(Dictionary<String,?> context)
Component
load
in class Component
public void store(Dictionary<String,?> context)
Component
store
in class Component
public int getItemAt(int y)
y
- The y-coordinate of the item to identify.
public Bounds getItemBounds(int index)
index
- The item index.
public int getItemIndent()
public ListenerList<ListViewListener> getListViewListeners()
public ListenerList<ListViewItemListener> getListViewItemListeners()
public ListenerList<ListViewItemStateListener> getListViewItemStateListeners()
public ListenerList<ListViewSelectionListener> getListViewSelectionListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |