A simple data object containing one typed value. This class is a
straightforward implementation of the the
com.itmill.toolkit.data.Property
interface.
Parameters
value
Initial value of the Property
Creates a new instance of ObjectProperty with the given value. The type of the property is automatically initialized to be the type of the given value.
Parameters
value
Initial value of the Property
type
The type of the value. The value must be assignable to given type
Creates a new instance of ObjectProperty with the given value and type.
Parameters
value
Initial value of the property.
type
The type of the value.
value
must be
assignable to this type.
readOnly
Sets the read-only mode.
Creates a new instance of ObjectProperty with the given value, type and read-only mode status.
Parameters
listener
the new Listener to be registered
Registers a new read-only status change listener for this Property.
Parameters
listener
the new Listener to be registered
Registers a new value change listener for this ObjectProperty.
Parameters
type of the Property
Returns the type of the ObjectProperty. The methods
getValue
and
setValue
must be compatible
with this type: one must be able to safely cast the value returned
from
getValue
to the given type and pass any variable
assignable to this type as an argument to
setValue
.
Parameters
the value stored in the Property
Gets the value stored in the Property.
Parameters
true
if the Property is in read-only mode,
false
if it's not
Tests if the Property is in read-only mode. In read-only mode calls
to the method
setValue
will throw
ReadOnlyException
s and will not modify the value of the
Property.
Parameters
listener
listener to be removed
Remove a previously registered read-only status change listener.
Parameters
listener
listener to be removed
Remove a previously registered value change listener.
Parameters
newStatus
new read-only status of the Property
Sets the Property's read-only mode to the specified status.
Parameters
newValue
New value of the property.
Exceptions
if the object is in read-only mode
if
newValue
can't be converted into the Property's native
type directly or through
String
Set the value of the property. This method supports setting from
String
s if either
String
is directly
assignable to property type, or the type class contains a string
constructor.