Package com.vaadin.featurepack.data.util
Class AbstractProperty<T>
java.lang.Object
com.vaadin.featurepack.data.util.AbstractProperty<T>
- All Implemented Interfaces:
Property<T>,Property.ReadOnlyStatusChangeNotifier,Property.ValueChangeNotifier,Serializable
- Direct Known Subclasses:
MethodProperty,NestedMethodProperty,ObjectProperty,TransactionalPropertyWrapper
public abstract class AbstractProperty<T>
extends Object
implements Property<T>, Property.ValueChangeNotifier, Property.ReadOnlyStatusChangeNotifier
Abstract base class for
Property implementations.
Handles listener management for Property.ValueChangeListeners and
Property.ReadOnlyStatusChangeListeners.- Since:
- 6.6
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classAnEventobject specifying the Property whose read-only status has been changed.Nested classes/interfaces inherited from interface com.vaadin.featurepack.data.Property
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters a new read-only status change listener for this Property.voidRegisters a new value change listener for this Property.protected voidSends a read only status change event to all registered listeners.protected voidSends a value change event to all registered listeners.Collection<?> getListeners(Class<?> eventType) booleanTests if the Property is in read-only mode.voidRemoves a previously registered read-only status change listener.voidRemoves a previously registered value change listener.voidsetPropertyReadOnly(boolean newStatus) Sets the Property's read-only mode to the specified status.
-
Constructor Details
-
AbstractProperty
public AbstractProperty()
-
-
Method Details
-
isPropertyReadOnly
public boolean isPropertyReadOnly()Tests if the Property is in read-only mode. In read-only mode calls to the methodsetValuewill throwReadOnlyExceptionand will not modify the value of the Property. Override for additional restrictions on what is considered a read-only property.- Specified by:
isPropertyReadOnlyin interfaceProperty<T>- Returns:
trueif the Property is in read-only mode,falseif it's not
-
setPropertyReadOnly
public void setPropertyReadOnly(boolean newStatus) Description copied from interface:PropertySets the Property's read-only mode to the specified status. This functionality is optional, but all properties must implement theisReadOnlymode query correctly.- Specified by:
setPropertyReadOnlyin interfaceProperty<T>- Parameters:
newStatus- new read-only status of the Property
-
addReadOnlyStatusChangeListener
Registers a new read-only status change listener for this Property.- Specified by:
addReadOnlyStatusChangeListenerin interfaceProperty.ReadOnlyStatusChangeNotifier- Parameters:
listener- the new Listener to be registered.
-
removeReadOnlyStatusChangeListener
Removes a previously registered read-only status change listener.- Specified by:
removeReadOnlyStatusChangeListenerin interfaceProperty.ReadOnlyStatusChangeNotifier- Parameters:
listener- the listener to be removed.
-
fireReadOnlyStatusChange
protected void fireReadOnlyStatusChange()Sends a read only status change event to all registered listeners. -
addValueChangeListener
Description copied from interface:Property.ValueChangeNotifierRegisters a new value change listener for this Property.- Specified by:
addValueChangeListenerin interfaceProperty.ValueChangeNotifier- Parameters:
listener- the new Listener to be registered
-
removeValueChangeListener
Description copied from interface:Property.ValueChangeNotifierRemoves a previously registered value change listener.- Specified by:
removeValueChangeListenerin interfaceProperty.ValueChangeNotifier- Parameters:
listener- listener to be removed
-
fireValueChange
protected void fireValueChange()Sends a value change event to all registered listeners. -
getListeners
-