borland Packages  Class Hierarchy  jbcl.model Package  Index 

WritableSingletonModel interface

borland.jbcl.model.SingletonModel
   +----borland.jbcl.model.WritableSingletonModel

About the WritableSingletonModel interface

Methods  Event Listeners

Implemented by CheckboxControl, ChoiceControl, FieldControl, ImageControl, LocatorControl, TextAreaControl, TextFieldControl, SingletonDataSetManager, BasicSingletonContainer

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.


WritableSingletonModel methods

Methods defined in this interface

Methods implemented in borland.jbcl.model.SingletonModel

WritableSingletonModel event listeners


WritableSingletonModel methods

canSet(boolean)

  public boolean canSet(boolean startEditing)
Returns true if model can set data object.

Parameters:

startEdit
Indicates intent to start editing.

enableModelEvents(boolean)

  public void enableModelEvents(boolean enable)
Enables and disables event broadcasting.

Parameters:

enable
If enable is false, events are disabled. If enabled is true, events are enabled, and a CONTENT_CHANGED event is sent to all model listeners.

set(java.lang.Object)

  public void set(java.lang.Object data)
Changes the value of the singleton data item to a new value.

Parameters:

data
The new singleton-model data object.

touched()

  public void touched()
Notifies all the model listeners that the data object has been manipulated.

WritableSingletonModel event listeners

This interface is a source for the following event sets. For information on the JBCL event sets, see Events in JBCL.

model

 public void addModelListener(borland.jbcl.model.SingletonModelListener listener)
 public void removeModelListener(borland.jbcl.model.SingletonModelListener listener)