jbcl.model Package
com.borland.jbcl.model.SingletonModel +----com.borland.jbcl.model.WritableSingletonModel
Methods Event Listeners
Implemented by CheckboxControl, ChoiceControl, FieldControl, ImageControl, LocatorControl, TextAreaControl, TextFieldControl, BasicSingletonContainer, SingletonDataSetManager
Contains the methods required for a read-and-write component that accesses a single data item only, such as a check box control. Usually you extend a class that implements this interface, such as BasicSingletonContainer
. You can, however, implement the interface directly.
If you are developing a read-only component that accesses a single data item, you can implement the SingletonModel
interface instead.
To set the data object, call the set() method. If canset()
returns true, the data can be changed; otherwise, it cannot. The touched()
method notifies all listeners whenever the data object is manipulated.
public boolean canSet(boolean startEditing)Returns true if model can set data object.
Parameters:
startEdit
public void enableModelEvents(boolean enable)Enables and disables event broadcasting.
Parameters:
enable
enable
is false, events are disabled. If enabled is true, events are enabled, and a CONTENT_CHANGED event is sent to all model listeners.
public void set(Object data)Changes the value of the singleton data item to a new value.
Parameters:
data
public void touched()Notifies all the model listeners that the data object has been manipulated.
public void addModelListener(SingletonModelListener listener) public void removeModelListener(SingletonModelListener listener)