ListView Class

ListView Class

This Package | All Packages

Component
  |
  +--Control
    |
    +--ListView
public class ListView
extends Control

Topic under construction.

Methods
Name Description
addOnAfterLabelEdit(EventHandler eh) Topic under construction.
addOnBeforeLabelEdit(EventHandler handler) Topic under construction.
addOnColumnClick(EventHandler handler) Topic under construction.
addOnItemClick(EventHandler handler) Topic under construction.
clear() Clear the ListView of all columns and ListItems.
getAlignment() Returns the Alignment style the ListView is curently using.
getAllowColumnReorder() Indicates whether the Column Reordering style is set.
getAutoArrange() Indicates whether the AutoArrange style is set.
getBorderStyle() Returns current BorderStyle setting.
getCheckBoxes() Indicates whether the CheckBox style is set.
getColumnCount() Returns the number of columns the ListView currently has.
getColumnHeader(int index) Given a zero-based index, returns the ColumnHeader object for the column at that index.
getFirstVisible() Retrieves the first visible ListItem in the list view.
getFullRowSelect() Indicates whether the FullRowSelect style is set.
getGridLines() Indicates whether the GridLines style is set.
getHideColumnHeaders() Indicates whether ColumnHeaders are visible.
getHideSelection() Indicates whether the currently selected item is always visible, even when focus is lost.
getIconArrange() Topic under construction.
getImageList() Returns the currently set ImageList for Large Icon mode.
getItemCount() Returns the total number of items within the list view.
getLabelEdit() Indicates whether the LabelEdit style is currently set.
getLabelWrap() Indicates whether the LabelWrap style is currently set.
getListItem(int index) Returns a ListItem given its zero-based index into the ListView.
getMultiSelect() Indicates whether the MultiSelect style is currently set.
getOneClickActivate() Indicates whether the OneClickActivet style is currently set.
getScrollbar() Indicates whether the ScrollBars are visible or not.
getSelectedItems() Returns an array of currently selected list items.
getSmallImageList() Returns the currently set SmallIcon image list.
getSortByHeader() Indicates whether the SortByHeader style is currently set.
getSorting() Returns currently selected sorting styles.
getStateImageList() Returns the currently set State image list.
getStyleEx() Topic under construction.
getTag() Returns the current tag object.
getTrackSelect() Indicates whether the TrackSelect style is currently set.
getTwoClickActivate() Indicates whether the TwoClickActivet style is currently set.
getView() Returns currently selected ListView View style.
hitTest(int x, int y) Returns the current ListItem corresponding to the specific x,y co-ordinate.
insertColumn(int index, String str, int width, int subItemIndex, int columnformat) Inserts a new column into the ListView

Return Value:

Returns the ColumnHeader object representing the new column.

insertItem(int index, String text, int imageIndex, int data) Inserts a new ListItem into the ListView.
removeAll() Removes all elements from the ListView.
removeColumn(int index) removes a column from the ListView.
removeItem(int index) Removes an item from the ListView.
setAlignment(int alignflag) Sets Alignment style for ListView.
setAllowColumnReorder(boolean flag) Sets Column Reorder style on the ListView.
setAutoArrange(boolean value) Sets AutoArrange style on the ListView.
setBorderStyle(int borderstyle) Sets BorderStyle style on the ListView.
setCheckBoxes(boolean flag) Sets CheckBoxes style on the ListView.
setFullRowSelect(boolean flag) Sets Full Row Select style on the ListView.
setGridLines(boolean flag) Sets Grid LInes style on the ListView.
setHideColumnHeaders(boolean flag) Sets Hide Column Headers style on the ListView.
setHideSelection (boolean flag) Sets Selection Always Visible style on the ListView.
setIconArrange(int flag) Sets Icon arrangement options in Large/Small Icon view.
setImageList(ImageList v) Sets the Large Icon Image list.
setLabelEdit (boolean flag) Sets Label Edit style on the ListView.
setLabelWrap(boolean flag) Sets Label Wrap style on the ListView.
setMultiSelect(boolean flag) Sets MultiSelection style on the ListView.
setOneClickActivate(boolean flag) Sets One Click Activate style on the ListView.
setScrollbar(boolean flag) Sets Scroll Bar visible style on the ListView.
setSmallImageList(ImageList v) Sets the Small Icon Image list.
setSortByHeader(boolean flag) Sets Column Sort style on the ListView.
setSorting(int sortflag) Sets Sorting style for the ListView.
setStateImageList(ImageList v) Sets the State Image list.
setTag(Object tag) Sets Tag value of the ListView.
setTrackSelect(boolean flag) Sets Track Select style on the ListView

ParameterDescription
setTwoClickActivate(boolean flag) Sets Two Click Activate style on the ListView.
setView(int viewflag) Sets View style for the ListView.

Methods

ListView.addOnAfterLabelEdit

Syntax
public void addOnAfterLabelEdit( EventHandler eh );
Description

Topic under construction.

ListView.addOnBeforeLabelEdit

Syntax
public void addOnBeforeLabelEdit( EventHandler handler );
Description

Topic under construction.

ListView.addOnColumnClick

Syntax
public void addOnColumnClick( EventHandler handler );
Description

Topic under construction.

ListView.addOnItemClick

Syntax
public void addOnItemClick( EventHandler handler );
Description

Topic under construction.

ListView.clear

Syntax
public void clear();
Description

Clear the ListView of all columns and ListItems.

ListView.getAlignment

Syntax
public int getAlignment();
Return Value

Returns Integer ListView Aligment style.

Description

Returns the Alignment style the ListView is curently using.

ListView.getAllowColumnReorder

Syntax
public boolean getAllowColumnReorder();
Return Value

Returns Boolean whether Column Reording is set.

Description

Indicates whether the Column Reordering style is set.

ListView.getAutoArrange

Syntax
public boolean getAutoArrange();
Return Value

Returns a boolean value indicating whether AutoArrange is set.

Description

Indicates whether the AutoArrange style is set.

ListView.getBorderStyle

Syntax
public int getBorderStyle();
Return Value

Returns int A value representing the BorderStyle setting.

Description

Returns current BorderStyle setting.

ListView.getCheckBoxes

Syntax
public boolean getCheckBoxes();
Return Value

Returns A boolean indicating whether the CheckBox style is set.

Description

Indicates whether the CheckBox style is set.

ListView.getColumnCount

Syntax
public int getColumnCount();
Return Value

Returns an interger indicating the number of columns in ListView.

Description

Returns the number of columns the ListView currently has.

ListView.getColumnHeader

Syntax
public ColumnHeader getColumnHeader( int index );
Parameters
index
Zero-based index of specific column.
Return Value

Returns a ColumnHeader object.

Description

Given a zero-based index, returns the ColumnHeader object for the column at that index.

Exceptions

IllegalArgumenException thrown if index is out of bounds.

ListView.getFirstVisible

Syntax
public ListItem getFirstVisible();
Return Value

Returns the first Visible ListItem, or returns null if no ListItems exist.

Description

Retrieves the first visible ListItem in the list view.

ListView.getFullRowSelect

Syntax
public boolean getFullRowSelect();
Return Value

Returns a boolean value indicating whether FullRowSelect is set.

Description

Indicates whether the FullRowSelect style is set.

ListView.getGridLines

Syntax
public boolean getGridLines();
Return Value

Returns a boolean value indicating whether GridLines is set.

Description

Indicates whether the GridLines style is set.

ListView.getHideColumnHeaders

Syntax
public boolean getHideColumnHeaders();
Return Value

Returns Boolean whther ColumnHeaders are visible or not.

Description

Indicates whether ColumnHeaders are visible.

ListView.getHideSelection

Syntax
public boolean getHideSelection();
Return Value

Returns a boolean value indicating whether the selected item is always visible.

Description

Indicates whether the currently selected item is always visible, even when focus is lost.

ListView.getIconArrange

Syntax
public int getIconArrange();
Description

Topic under construction.

ListView.getImageList

Syntax
public ImageList getImageList();
Return Value

Returns the ImageList, or returns null if none is set.

Description

Returns the currently set ImageList for Large Icon mode.

ListView.getItemCount

Syntax
public int getItemCount();
Return Value

Returns the integer count of items.

Description

Returns the total number of items within the list view.

ListView.getLabelEdit

Syntax
public boolean getLabelEdit();
Return Value

Returns a boolean value indicating whether LabelEdit is set.

Description

Indicates whether the LabelEdit style is currently set.

ListView.getLabelWrap

Syntax
public boolean getLabelWrap();
Return Value

Returns a boolean value indicating whether LabelWrap is set.

Description

Indicates whether the LabelWrap style is currently set.

ListView.getListItem

Syntax
public ListItem getListItem( int index );
Parameters
index
Zero-based index into ListView's list of items.
Return Value

Returns a ListItem representing item at specified index.

Description

Returns a ListItem given its zero-based index into the ListView.

Exceptions

IllegalArgumentException thrown if index is out of bounds.

ListView.getMultiSelect

Syntax
public boolean getMultiSelect();
Return Value

Returns a boolean value indicating whether MultiSelect is set.

Description

Indicates whether the MultiSelect style is currently set.

ListView.getOneClickActivate

Syntax
public boolean getOneClickActivate();
Return Value

Returns a boolean value indicating whether OneClickActivate is set.

Description

Indicates whether the OneClickActivet style is currently set. If not, the ListView resorts to double clicking to activate an item.

ListView.getScrollbar

Syntax
public boolean getScrollbar();
Return Value

Returns a boolean value indicating whether ScrollBars are visible.

Description

Indicates whether the ScrollBars are visible or not.

ListView.getSelectedItems

Syntax
public ListItem[] getSelectedItems();
Return Value

Returns ListItem[] array of currently selected list items.

Description

Returns an array of currently selected list items.

Exceptions

RuntimeException yhrown if the number of selected items < the number of actual items selected.

ListView.getSmallImageList

Syntax
public ImageList getSmallImageList();
Return Value

Returns ImageList representing SmallIcon image list, or returns null if not set.

Description

Returns the currently set SmallIcon image list.

ListView.getSortByHeader

Syntax
public boolean getSortByHeader();
Return Value

Returns a boolean value indicating whether SortByHeader is set.

Description

Indicates whether the SortByHeader style is currently set. If this is false, column headers do not sort list items.

ListView.getSorting

Syntax
public int getSorting();
Return Value

Returns Integer Current sorting style. Possibilites are: Ascending Descending None

Description

Returns currently selected sorting styles.

ListView.getStateImageList

Syntax
public ImageList getStateImageList();
Return Value

Returns ImageList representing State image list, or returns null if not set.

Description

Returns the currently set State image list.

ListView.getStyleEx

Syntax
public int getStyleEx();
Description

Topic under construction.

ListView.getTag

Syntax
public Object getTag();
Return Value

Returns the object representing current tag.

Description

Returns the current tag object.

ListView.getTrackSelect

Syntax
public boolean getTrackSelect();
Return Value

Returns a boolean value indicating whether TrackSelect is set.

Description

Indicates whether the TrackSelect style is currently set.

ListView.getTwoClickActivate

Syntax
public boolean getTwoClickActivate();
Return Value

Returns a boolean value indicating whether TwoClickActivate is set.

Description

Indicates whether the TwoClickActivet style is currently set. If not, th the ListView resorts to double clicking to activate an item.

ListView.getView

Syntax
public int getView();
Return Value

Returns the current view style. Possibilites are: Icon SmallIcon List Report

Description

Returns currently selected ListView View style.

ListView.hitTest

Syntax
public ListItem hitTest( int x, int y );
Parameters
x
x position to check against.
y
y position to check against.
Return Value

Returns ListItem ListItem at position, or returns null if no item exists there.

Description

Returns the current ListItem corresponding to the specific x,y co-ordinate.

ListView.insertColumn

Syntax
public ColumnHeader insertColumn( int index, String str, int width, int subItemIndex, int columnformat );
Parameters
index
Index for the new column.
str
Text for new column.
width
Width of new column.
subItemIndex
SubItem associated with this column.
columnFormat
Format for this column. This may be one of the following: Left, Center, Right.
Return Value

Returns the ColumnHeader object representing the new column.

Description

Inserts a new column into the ListView

Exceptions

IllegalArgumentException hrown is ColumnFormat is not one of the specified.

runtimeException thrown if there is a problem creating the new column.

ListView.insertItem

Syntax
public ListItem insertItem( int index, String text, int imageIndex, int data );
Parameters
index
Index for new item.
text
Text for new item.
imageIndex
Index into ImageList for this item.
data
Handle to external data to be stored by this item.
Return Value

Returns the ListItem object representing the new item.

Description

Inserts a new ListItem into the ListView.

Exceptions

runtimeException thrown if there is a problem creating the new item.

ListView.removeAll

Syntax
public void removeAll();
Description

Removes all elements from the ListView.

ListView.removeColumn

Syntax
public void removeColumn( int index );
Parameters
index
Zero-based index of the column that is to be removed.
Description

removes a column from the ListView.

Exceptions

ArrayIndexOutOfBoundsException thrown is index is out of bounds.

ListView.removeItem

Syntax
public void removeItem( int index );
Parameters
index
Zero-based index of the item that is to be removed.
Description

Removes an item from the ListView.

Exceptions

ArrayIndexOutOfBoundsException thrown is index is out of bounds.

ListView.setAlignment

Syntax
public void setAlignment( int alignflag );
Parameters
alignflag
Specifies alignment style for ListView.
Description

Sets Alignment style for ListView.

Exceptions

IllegalArgumentException thrown if alignment style is unknown.

ListView.setAllowColumnReorder

Syntax
public void setAllowColumnReorder( boolean flag );
Parameters
flag
Sets Column Reorder on or off.
Description

Sets Column Reorder style on the ListView.

ListView.setAutoArrange

Syntax
public void setAutoArrange( boolean value );
Parameters
flag
Sets AutoArrange Reorder on or off.
Description

Sets AutoArrange style on the ListView.

ListView.setBorderStyle

Syntax
public void setBorderStyle( int borderstyle );
Parameters
flag
Sets BorderStyle to one of the following: NONE SUNKEN3D
Description

Sets BorderStyle style on the ListView.

ListView.setCheckBoxes

Syntax
public void setCheckBoxes( boolean flag );
Parameters
flag
Sets CheckBoxes on or off.
Description

Sets CheckBoxes style on the ListView.

ListView.setFullRowSelect

Syntax
public void setFullRowSelect( boolean flag );
Parameters
flag
Sets Full Row Select on or off.
Description

Sets Full Row Select style on the ListView.

ListView.setGridLines

Syntax
public void setGridLines( boolean flag );
Parameters
flag
Sets GridLines on or off.
Description

Sets Grid LInes style on the ListView.

ListView.setHideColumnHeaders

Syntax
public void setHideColumnHeaders( boolean flag );
Parameters
flag
Sets Hide Column Headers on or off.
Description

Sets Hide Column Headers style on the ListView.

ListView.setHideSelection

Syntax
public void setHideSelection ( boolean flag );
Parameters
flag
Sets Selection Always Visible on or off.
Description

Sets Selection Always Visible style on the ListView.

ListView.setIconArrange

Syntax
public void setIconArrange( int flag );
Parameters
flag
Icon Arangement styles. Styles can be: Default Align Left Align Top Snap To Grid
Description

Sets Icon arrangement options in Large/Small Icon view.

Exceptions

IllegalArgumentException thrown if flag is not one of the supported Icon Arrangement styles.

ListView.setImageList

Syntax
public void setImageList( ImageList v );
Parameters
v
ImageList containing Large Icons.
Description

Sets the Large Icon Image list.

ListView.setLabelEdit

Syntax
public void setLabelEdit ( boolean flag );
Parameters
flag
Sets Label Edit on or off.
Description

Sets Label Edit style on the ListView.

ListView.setLabelWrap

Syntax
public void setLabelWrap( boolean flag );
Parameters
flag
Sets Label Wrap on or off.
Description

Sets Label Wrap style on the ListView.

ListView.setMultiSelect

Syntax
public void setMultiSelect( boolean flag );
Parameters
flag
Sets MultiSelection on or off.
Description

Sets MultiSelection style on the ListView.

ListView.setOneClickActivate

Syntax
public void setOneClickActivate( boolean flag );
Parameters
flag
Sets One Click Activate on or off.
Description

Sets One Click Activate style on the ListView.

ListView.setScrollbar

Syntax
public void setScrollbar( boolean flag );
Parameters
flag
Sets Scroll Bar visible on or off.
Description

Sets Scroll Bar visible style on the ListView.

ListView.setSmallImageList

Syntax
public void setSmallImageList( ImageList v );
Parameters
v
ImageList containing Small Icons.
Description

Sets the Small Icon Image list.

ListView.setSortByHeader

Syntax
public void setSortByHeader( boolean flag );
Parameters
flag
Sets Column Sort on or off.
Description

Sets Column Sort style on the ListView.

ListView.setSorting

Syntax
public void setSorting( int sortflag );
Parameters
sortflag
Sets Sort style on the ListView. Style can be one of the following: None Ascending Descending
Description

Sets Sorting style for the ListView.

ListView.setStateImageList

Syntax
public void setStateImageList( ImageList v );
Parameters
v
ImageList containing State Icons.
Description

Sets the State Image list.

ListView.setTag

Syntax
public void setTag( Object tag );
Parameters
tag
Object to set the tag on.
Description

Sets Tag value of the ListView.

ListView.setTrackSelect

Syntax
public void setTrackSelect( boolean flag );
Parameters
flag
Sets Track Select on or off.
Description

Sets Track Select style on the ListView

ListView.setTwoClickActivate

Syntax
public void setTwoClickActivate( boolean flag );
Parameters
flag
Sets Two Click Activate on or off.
Description

Sets Two Click Activate style on the ListView.

ListView.setView

Syntax
public void setView( int viewflag );
Parameters
viewflag
Sets View style on the ListView. Style can be one of the following: Icon SmallIcon List Report
Description

Sets View style for the ListView.