|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object diamondedge.swing.DsListItem
public class DsListItem
An item in a DsListView or DsComboBox control that contains the index of icons associated with it, text, and an array of strings (cells) representing subitems that are displayed in the list.
Field Summary | |
---|---|
protected int |
lastItemAdded
|
protected Object |
smallIcon
|
protected Vector |
values
|
Method Summary | |
---|---|
DsListCell |
addCell(int index,
String key,
String text)
Adds a DsListCell object to the collection of DsListCells. |
protected DsListCell |
createListCell()
Creates a new DsListCell. |
DsListCell |
getCell(int index)
Returns a DsListCell representing the ListItem's data. |
DsListCell |
getCell(String key)
Returns a DsListCell that has the specified key if it exists. |
Object |
getCellValue(int index)
Returns an Object whose string representation will be displayed at the specified column. |
Object |
getData()
Returns the object associated with the item. |
Color |
getForeground()
Returns a value which determines the color of the label. |
String |
getKey()
Returns the unique string by which this item can be located. |
Object |
getSmallIcon()
Returns the icon or the index/key of the icon that is displayed in the list. |
Icon |
getSmallIcon(IconList iconList)
Returns the icon that is displayed in the list. |
String |
getText()
Returns the text displayed in the list for this item. |
Object |
getValue()
Returns the value displayed in the list for this item. |
int |
indexOf(DsListCell cell)
Returns the index of a DsListCell with in this DsListItem. |
int |
indexOf(String key)
Returns the index of a DsListCell by its key. |
boolean |
isFontBold()
Returns a value that determines whether the label for the item is displayed with a bold font. |
void |
loadData()
Load data from the object stored in setData() into each cell. |
void |
removeCell(int index)
Removes a DsListCell object from the collection of DsListCells. |
void |
setCellValue(int index,
Object text)
Sets the Object whose string representation will be displayed at the specified column. |
void |
setData(Object val)
Sets an object to be stored with the item. |
void |
setFontBold(boolean bold)
Sets a value that determines whether the label for the item is displayed with a bold font. |
void |
setForeground(Color c)
Sets a value which determines the color of the label. |
void |
setKey(String key)
Sets the unique string by which this item can be located. |
void |
setSmallIcon(Object indexOrKeyOrIcon)
Sets the index (Integer) or key (String) of an icon that is displayed in the list. |
void |
setText(String text)
Sets the text displayed in the list for this item. |
void |
setValue(Object val)
Sets the value displayed in the list for this item. |
String |
toString()
Returns the label for the item |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Object smallIcon
protected int lastItemAdded
protected Vector values
Method Detail |
---|
public void loadData()
public Icon getSmallIcon(IconList iconList)
iconList
- List of icons used if the stored value was actually a String or Integer which represents the index into the icon listpublic Object getSmallIcon()
public void setSmallIcon(Object indexOrKeyOrIcon)
public String getText()
public void setText(String text)
public Object getValue()
public void setValue(Object val)
public String getKey()
public void setKey(String key)
public boolean isFontBold()
public void setFontBold(boolean bold)
public Color getForeground()
public void setForeground(Color c)
public Object getData()
public void setData(Object val)
public String toString()
toString
in class Object
public Object getCellValue(int index)
public void setCellValue(int index, Object text)
This is the preferred way of setting values. Using getCell(index).setValue(text) forces the creation of a cell object and also does not cause list to be re-sorted.
public DsListCell getCell(int index)
public DsListCell getCell(String key)
protected DsListCell createListCell()
public int indexOf(DsListCell cell)
public int indexOf(String key)
key
- unique
public DsListCell addCell(int index, String key, String text)
index
- position to insert new cell. -1 means append to end.public void removeCell(int index)
|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |