|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.gui.components.table.cells.TableCell
public class TableCell
TableCell is most basic kind of table cells, which has own renderers and
editors in com.cosylab.gui.components.table.renderers
.
This cell may contain arbitrary set of characteristics. They hint renderers, how to display particular cell. Consult JavaDoc of particular cell to see which characteristics are supported and compatible with available renderers.
User of this cell migth decide to define values for following characteristics: TIMEOUT, ERROR, SUSPENDED, OUT_OF_BOUNDS.
Note that characteristic map is optimized for number of characteristics up to 10 because is implemented around linear array.
Note that all characteristics are optional. If they are null, renderers will try best to use value without them.
Field Summary | |
---|---|
static java.lang.String |
ALARM
Characteristic name for alarm state, value must be Boolean.TRUE if data source is in alarm condition. |
protected Command[] |
commands
|
protected java.lang.Object |
dataSource
|
static java.lang.String |
ERROR
Characteristic name for error state, value must be Boolean.TRUE if data source is in error condition. |
protected java.lang.String |
identifier
|
static java.lang.String |
OUT_OF_BOUNDS
Characteristic name for out of bouds value state, when cell value is out of designated value range, characteristic value must be Boolean.TRUE. |
static java.lang.String |
SEVERITY
Characteristic name for severity of alarm or error state. |
static java.lang.String |
SUSPENDED
Characteristic name for suspended state, value must be Boolean.TRUE if data source is in suspended condition (eg. |
static java.lang.String |
TIMEOUT
Characteristic name for timeout state, value must be Boolean.TRUE if data source in timeout. |
protected long |
timestamp
|
static java.lang.String |
TOOLTIP
Characteristic name for tooltip. |
protected java.lang.Object |
value
|
static java.lang.String |
WARNING
Characteristic name for warning state, value must be Boolean.TRUE if value is out of bounds or source is in warning condition. |
Constructor Summary | |
---|---|
protected |
TableCell()
Creates new noninitialized instance of cell proxy. |
|
TableCell(java.lang.String identifier,
java.lang.Object dataSource,
java.lang.Object value,
Command[] commands)
Creates a new TableCell object. |
Method Summary | |
---|---|
void |
addSupportedCharacteristic(java.lang.String name)
DOCUMENT ME! |
int |
compareTo(java.lang.Object o)
|
java.lang.Object |
getCharacteristic(java.lang.String name)
Return scharacteristic value with specific name. |
java.lang.Object |
getCharacteristic(java.lang.String name,
java.lang.Object defaultValue)
Return scharacteristic value with specific name. |
java.util.Map<java.lang.String,java.lang.Object> |
getCharacteristics()
Return map with all characteristics. |
Command[] |
getCommands()
Returns commands, which can be executed on this cell. |
java.lang.Object |
getDataSource()
Object which deliveres values for this cell. |
java.lang.String |
getIdentifier()
Generally expected to be unique string within context of current table. |
java.lang.String[] |
getSupportedCharacteristics()
DOCUMENT ME! |
long |
getTimestamp()
Returns time of latest change of value. |
java.lang.String |
getTooltip()
Return tooltip value or null if none is set. |
java.lang.Object |
getValue()
Return tooltip value or null if none is set. |
boolean |
isAlarm()
Returns true if ALARM characteristic is true. |
boolean |
isError()
Returns true if ERROR characteristic is true. |
boolean |
isOutOfBounds()
Returns true if OUT_OF_BOUNDS characteristic is true. |
boolean |
isSuspended()
Returns true if SUSPENDED characteristic is true. |
boolean |
isTimeout()
Returns true if TIMEOUT characteristic is true. |
boolean |
isWarning()
Returns true if WARNING characteristic is true. |
void |
putAllCharacteristics(java.util.Map<java.lang.String,java.lang.Object> characteristics)
Puts all characteristics to this cell. |
java.lang.Object |
putCharacteristic(java.lang.String name,
java.lang.Object value)
Puts new characteristic value with provided name. |
void |
removeSupportedCharacteristic(java.lang.String name)
DOCUMENT ME! |
void |
setTimestamp(long timestamp)
Sets time of latest change of value. |
void |
setValue(java.lang.Object newValue)
Sets new value to this cell. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TOOLTIP
public static final java.lang.String OUT_OF_BOUNDS
public static final java.lang.String TIMEOUT
public static final java.lang.String ERROR
public static final java.lang.String ALARM
public static final java.lang.String WARNING
public static final java.lang.String SEVERITY
public static final java.lang.String SUSPENDED
protected java.lang.Object value
protected java.lang.Object dataSource
protected Command[] commands
protected java.lang.String identifier
protected long timestamp
Constructor Detail |
---|
protected TableCell()
public TableCell(java.lang.String identifier, java.lang.Object dataSource, java.lang.Object value, Command[] commands)
identifier
- unique string within context of current tabledataSource
- object which provides values for this cellvalue
- a cells valuecommands
- commands, which can be executed on this cellMethod Detail |
---|
public Command[] getCommands()
public java.lang.Object getDataSource()
public java.lang.String getIdentifier()
public java.lang.String getTooltip()
null
if none is set.
public java.lang.Object getValue()
null
if none is set.
public void setValue(java.lang.Object newValue)
newValue
- public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object getCharacteristic(java.lang.String name)
name
- a name of requested characteristic
null
if not definedpublic java.lang.Object getCharacteristic(java.lang.String name, java.lang.Object defaultValue)
name
- a name of requested characteristicdefaultValue
- DOCUMENT ME!
null
if not definedpublic java.lang.Object putCharacteristic(java.lang.String name, java.lang.Object value)
name
- characteristic namevalue
- new characteristic value
null
if nonepublic void putAllCharacteristics(java.util.Map<java.lang.String,java.lang.Object> characteristics)
characteristics
- Map with characteristicspublic java.util.Map<java.lang.String,java.lang.Object> getCharacteristics()
public long getTimestamp()
public void setTimestamp(long timestamp)
timestamp
- time of latest changepublic boolean isError()
true
if ERROR characteristic is true.
true
if ERROR characteristic is truepublic boolean isAlarm()
true
if ALARM characteristic is true.
true
if ALARM characteristic is truepublic boolean isWarning()
true
if WARNING characteristic is true.
true
if WARNING characteristic is truepublic boolean isTimeout()
true
if TIMEOUT characteristic is true.
true
if TIMEOUT characteristic is truepublic boolean isSuspended()
true
if SUSPENDED characteristic is true.
true
if SUSPENDED characteristic is truepublic boolean isOutOfBounds()
true
if OUT_OF_BOUNDS characteristic is true.
true
if OUT_OF_BOUNDS characteristic is truepublic java.lang.String[] getSupportedCharacteristics()
public void addSupportedCharacteristic(java.lang.String name)
name
- DOCUMENT ME!public void removeSupportedCharacteristic(java.lang.String name)
name
- DOCUMENT ME!public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |