borland Packages Class Hierarchy jbcl.control Package Index
java.lang.Object +----java.awt.Component +----java.awt.Checkbox +----borland.jbcl.view.CheckboxView +----borland.jbcl.control.CheckboxControl
Variables Constructors Properties Methods Event Listeners
Implements AccessListener, ColumnAware, DataSetAware, NavigationListener, SingletonModel, SingletonModelListener, WritableSingletonModel, BlackBox, SingletonModelView, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener
CheckboxControl is a graphical user interface element that has a boolean state. It is designed to function similarly to java.awt.Checkbox but provides the greater flexibility of model-view composition. It can also be used as a data-aware control.
When the checked property is true, a checkmark appears in the checkbox.
To make CheckboxControl data-aware, set its dataSet and columnName properties so that it is linked to the desired column in the data set. Values in that column must denote a boolean value. If this is the case, a value that evaluates to true checks the checkbox, and a false value removes the checkmark. If the user checks the checkbox, a value that equates to true is entered in column of the active record in the data set. Unchecking the checkbox puts a value that equates to false in the data set.
CheckBoxControl inherits much of its behavior from CheckBoxView, such as the state and readOnly properties. See CheckBoxView for more information.
For an example that uses a CheckboxControl, see the project file CheckboxControlSample.jpr located in the jbuilder\samples\borland\samples\jbcl\checkboxcontrol directory of your JBuilder installation. This simple application demonstrates a CheckboxControl that can be enabled or dimmed. When disabled, it ignores all keyboard or mouse input. When enabled, it can be toggled using the CheckboxControl itself or an associated menu option. A grid displays its property settings as you change them through the UI of this application.
public CheckboxControl()
Constructs a CheckboxControl with default property values.
public boolean isChecked() public void setChecked(boolean value)
Stores whether the checkbox is set (rather than cleared).
public String getColumnName() public void setColumnName(java.lang.String newColumnName)
The DataSet column to which the checkbox control is bound.
public DataSet getDataSet() public void setDataSet(borland.jbcl.dataset.DataSet newDataSet)
The dataSet property specifies a borland.jbcl.dataset.DataSet object to display data from in the field.
public void setModel(borland.jbcl.model.SingletonModel sm)
Does exception checking to prevent recursive model declaration. Overrides and calls borland.jbcl.view.CheckboxView.setModel(SingletonModel p), which specifies the model object that contains the component's data item.
public void addNotify()
Creates the peer of the checkbox, so the checkbox has the standard appearance for each platform. Also, if the dataSet property is set, and that cursor's autoOpen property is set to true, opens the cursor.
Overrides: java.awt.Checkbox.addNotify()
public synchronized void addComponentListener(java.awt.event.ComponentListener ) public synchronized void removeComponentListener(java.awt.event.ComponentListener )
public synchronized void addFocusListener(java.awt.event.FocusListener ) public synchronized void removeFocusListener(java.awt.event.FocusListener )
public synchronized void addItemListener(java.awt.event.ItemListener ) public synchronized void removeItemListener(java.awt.event.ItemListener )
public synchronized void addKeyListener(java.awt.event.KeyListener ) public synchronized void removeKeyListener(java.awt.event.KeyListener )
public void addModelListener(borland.jbcl.model.SingletonModelListener l) public void removeModelListener(borland.jbcl.model.SingletonModelListener l)
public synchronized void addMouseListener(java.awt.event.MouseListener ) public synchronized void removeMouseListener(java.awt.event.MouseListener )
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener ) public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )