de.kupzog.ktable.editors
Class KTableCellEditorCheckbox

java.lang.Object
  extended by de.kupzog.ktable.KTableCellEditor
      extended by de.kupzog.ktable.editors.KTableCellEditorCheckbox
Direct Known Subclasses:
KTableCellEditorCheckbox2

public class KTableCellEditorCheckbox
extends KTableCellEditor

A cell editor that expects a Boolean cell value and simply switches this value. It has no control, it just changes the value in the model and forces a cell redraw.

NOTE: This implementation makes the whole cell area sensible. It is activated by a RETURN, a SPACE or a single mouse click.

Note: If you need this behavior, but wish to have only a part of the cell area that is sensible (like che checkbox that must be clicked, independently of how big the cell area is), look at KTableCellEditorCheckbox2.

Author:
Lorenz Maierhofer
See Also:
KTableCellEditorCheckbox2, de.kupzog.ktable.cellrenderers.CheckableCellRenderer

Field Summary
 
Fields inherited from class de.kupzog.ktable.KTableCellEditor
DOUBLECLICK, KEY_ANY, KEY_RETURN_AND_SPACE, SINGLECLICK
 
Constructor Summary
KTableCellEditorCheckbox()
           
 
Method Summary
 void close(boolean save)
          Simply switches the boolean value in the model!
 int getActivationSignals()
           
 void open(KTable table, int col, int row, org.eclipse.swt.graphics.Rectangle rect)
          Activates the editor at the given position.
 void setContent(java.lang.Object content)
          This implementation does nothing!
 
Methods inherited from class de.kupzog.ktable.KTableCellEditor
dispose, getBounds, getControl, isApplicable, isFocused, setBounds, setToolTipText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KTableCellEditorCheckbox

public KTableCellEditorCheckbox()
Method Detail

open

public void open(KTable table,
                 int col,
                 int row,
                 org.eclipse.swt.graphics.Rectangle rect)
Activates the editor at the given position. Instantly closes the editor and switch the boolean content value.

Overrides:
open in class KTableCellEditor
Parameters:
row -
col -
rect -

close

public void close(boolean save)
Simply switches the boolean value in the model!

Overrides:
close in class KTableCellEditor
Parameters:
save - If true, the content is saved to the underlying table.

setContent

public void setContent(java.lang.Object content)
This implementation does nothing!

Specified by:
setContent in class KTableCellEditor
Parameters:
content - The new content to set.
See Also:
KTableCellEditor.setContent(java.lang.Object)

getActivationSignals

public int getActivationSignals()
Overrides:
getActivationSignals in class KTableCellEditor
Returns:
Returns a value indicating on which actions this editor should be activated.