org.tigris.swidgets

Class Property

Implemented Interfaces:
Comparable

public class Property
extends java.lang.Object
implements Comparable

A property that can be displayed and edited within a PropertyTable.
Author:
Jeremy Jones

Constructor Summary

Property(String theName, Class theValueType, Object theInitialValue)
Constructs a new Property.
Property(String theName, Class theValueType, Object theInitialValue, Object[] values)
Constructs a new Property.

Method Summary

int
compareTo(Object o)
Compares two Properties by comparing their names.
Object[]
getAvailableValues()
Returns the set of available property values, or null if no such finite set exists.
Object
getCurrentValue()
Returns the currently selected property value.
Object
getInitialValue()
Returns the initial property value.
String
getName()
Returns the property name.
Class
getValueType()
Property editors should be configured to edit objects of this type.
void
setCurrentValue(Object value)
Sets the currently selected property value.

Constructor Details

Property

public Property(String theName,
                Class theValueType,
                Object theInitialValue)
Constructs a new Property. This version of the constructor does not specify a finite set of available values.
Parameters:
theName - the property name
theValueType - the value type class
theInitialValue - the initial value

Property

public Property(String theName,
                Class theValueType,
                Object theInitialValue,
                Object[] values)
Constructs a new Property. This version of the constructor does not specify a finite set of available values.
Parameters:
theName - the property name
theValueType - the value type class
theInitialValue - the initial value
values - the set of available values to choose from

Method Details

compareTo

public int compareTo(Object o)
Compares two Properties by comparing their names.
See Also:
java.lang.Comparable.compareTo(java.lang.Object)

getAvailableValues

public Object[] getAvailableValues()
Returns the set of available property values, or null if no such finite set exists.
Returns:
set of available property values

getCurrentValue

public Object getCurrentValue()
Returns the currently selected property value.
Returns:
current property value

getInitialValue

public Object getInitialValue()
Returns the initial property value.
Returns:
initial property value

getName

public String getName()
Returns the property name.
Returns:
property name

getValueType

public Class getValueType()
Property editors should be configured to edit objects of this type.
Returns:
the property value class

setCurrentValue

public void setCurrentValue(Object value)
Sets the currently selected property value.
Parameters:
value - new property value