public static class ItemList.Entry extends Object implements Copyable<ItemList.Entry>
ItemList
holding
Constructor and Description |
---|
Entry(Object data)
Creates a new entry with the specified
data object, the
display item is the String value of data . |
Entry(Object item,
Object data)
Creates a new entry with the specified
data object and
display item . |
Entry(Object item,
Object data,
Icon icon)
Creates a new entry with the specified
data object, a
display item and an icon . |
Modifier and Type | Method and Description |
---|---|
ItemList.Entry |
clone()
Returns a field-for-field copy of this instance.
|
boolean |
equals(Object obj)
Compares
obj with this entry. |
Object |
getClientProperty(Object key)
Returns the value of the property with the specified key.
|
Object |
getData()
Returns the data object of this entry.
|
Icon |
getIcon()
Returns the optional icon of this entry.
|
Object |
getItem()
Returns the diplay item of this entry.
|
int |
hashCode() |
boolean |
isEnabled()
Determines whether this entry is enabled.
|
void |
putClientProperty(Object key,
Object value)
Adds an arbitrary key/value "client property" to this entry.
|
void |
setData(Object data)
Sets a new data object for this entry.
|
void |
setEnabled(boolean enabled)
Enables or disables this entry, depending on the value of the
parameter
enabled . |
void |
setIcon(Icon icon)
Sets the display icon of this entry.
|
void |
setItem(Object item)
Sets a new display item for this entry.
|
String |
toString() |
public Entry(Object data)
data
object, the
display item is the String value of data
.data
- the data objectpublic Entry(Object item, Object data)
data
object and
display item
.item
- the display itemdata
- the data objectpublic Object getItem()
public void setItem(Object item)
item
- the new display itempublic Object getData()
public void setData(Object data)
data
- the new data objectpublic Icon getIcon()
null
)public void setIcon(Icon icon)
icon
- the new diplay iconpublic boolean isEnabled()
true
if the entry is enabled, false
otherwisepublic void setEnabled(boolean enabled)
enabled
.
A disabled entry is renderered disabled and cannot be selected.
enabled
- If true
, this entry is enabled; otherwise
this entry is disabledpublic void putClientProperty(Object key, Object value)
The get/putClientProperty
methods provide access to a
small per-instance hashtable. Callers can use get/putClientProperty
to annotate entries.
If value is null
this method will remove the property.
key
- the new client property keyvalue
- the new client property value; if null
this
method will remove the propertygetClientProperty(java.lang.Object)
public Object getClientProperty(Object key)
putClientProperty
will return a
non-null
value.key
- the being queriednull
putClientProperty(java.lang.Object, java.lang.Object)
public boolean equals(Object obj)
obj
with this entry.
Two entries are considered equal if their item and data objects are equal.
public ItemList.Entry clone()
clone
in interface Copyable<ItemList.Entry>
clone
in class Object
Copyright © 2003–2023 XDEV Software. All rights reserved.