Package org.dellroad.stuff.vaadin7
Class ReadOnlyProperty<V>
- java.lang.Object
-
- org.dellroad.stuff.vaadin7.ReadOnlyProperty<V>
-
- Type Parameters:
V- the type of the property
- All Implemented Interfaces:
Property<V>,Property.ReadOnlyStatusChangeNotifier,Property.ValueChangeNotifier,Serializable
- Direct Known Subclasses:
SimpleItem.Property,SimpleProperty
public abstract class ReadOnlyProperty<V> extends Object implements Property<V>, Property.ValueChangeNotifier, Property.ReadOnlyStatusChangeNotifier
Support superclass forPropertys with read-only values. Provides a somewhat more space-efficient implementation than Vaadin'sAbstractProperty, which is useful when there are many instances in memory.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.data.Property
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T extends Object>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer
-
-
Constructor Summary
Constructors Constructor Description ReadOnlyProperty()
-
Method Summary
-
-
-
Method Detail
-
setValue
public void setValue(V value)
Change this instance's value.The implementation in
ReadOnlyPropertyalways throwsProperty.ReadOnlyException.
-
isReadOnly
public boolean isReadOnly()
Determine if this instance is read-only.The implementation in
ReadOnlyPropertyalways returns true.- Specified by:
isReadOnlyin interfaceProperty<V>
-
setReadOnly
public void setReadOnly(boolean readOnly)
Change this instance's read-only setting.The implementation in
ReadOnlyPropertythrowsUnsupportedOperationExceptionifreadOnlyis false.- Specified by:
setReadOnlyin interfaceProperty<V>
-
fireValueChange
protected void fireValueChange()
Issue aProperty.ValueChangeEventto all registeredProperty.ValueChangeListeners.
-
firstListenerAdded
protected void firstListenerAdded()
Invoked when the firstProperty.ValueChangeListenerhas been added.The implementation in
ReadOnlyPropertydoes nothing.
-
lastListenerRemoved
protected void lastListenerRemoved()
Invoked when the lastProperty.ValueChangeListenerhas been removed.The implementation in
ReadOnlyPropertydoes nothing.
-
addValueChangeListener
public void addValueChangeListener(Property.ValueChangeListener listener)
- Specified by:
addValueChangeListenerin interfaceProperty.ValueChangeNotifier
-
removeValueChangeListener
public void removeValueChangeListener(Property.ValueChangeListener listener)
- Specified by:
removeValueChangeListenerin interfaceProperty.ValueChangeNotifier
-
addListener
public void addListener(Property.ValueChangeListener listener)
- Specified by:
addListenerin interfaceProperty.ValueChangeNotifier
-
removeListener
public void removeListener(Property.ValueChangeListener listener)
- Specified by:
removeListenerin interfaceProperty.ValueChangeNotifier
-
addReadOnlyStatusChangeListener
public void addReadOnlyStatusChangeListener(Property.ReadOnlyStatusChangeListener listener)
- Specified by:
addReadOnlyStatusChangeListenerin interfaceProperty.ReadOnlyStatusChangeNotifier
-
removeReadOnlyStatusChangeListener
public void removeReadOnlyStatusChangeListener(Property.ReadOnlyStatusChangeListener listener)
- Specified by:
removeReadOnlyStatusChangeListenerin interfaceProperty.ReadOnlyStatusChangeNotifier
-
addListener
public void addListener(Property.ReadOnlyStatusChangeListener listener)
- Specified by:
addListenerin interfaceProperty.ReadOnlyStatusChangeNotifier
-
removeListener
public void removeListener(Property.ReadOnlyStatusChangeListener listener)
- Specified by:
removeListenerin interfaceProperty.ReadOnlyStatusChangeNotifier
-
-