de.kupzog.ktable.editors
Class KTableCellEditorCheckbox2

java.lang.Object
  extended by de.kupzog.ktable.KTableCellEditor
      extended by de.kupzog.ktable.editors.KTableCellEditorCheckbox
          extended by de.kupzog.ktable.editors.KTableCellEditorCheckbox2

public class KTableCellEditorCheckbox2
extends KTableCellEditorCheckbox

This class is an implementation of KTableCellEditorCheckbox that simply inverts a boolean cell value.

In contrast to KTableCellEditorCheckbox, this class only allows its activation on a mouse event when the user clicked on a special area inside the cell. The area itself can be specified when calling the constructor.

Author:
Lorenz Maierhofer
See Also:
KTableCellEditorCheckbox, 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
KTableCellEditorCheckbox2(org.eclipse.swt.graphics.Point activeArea, int hAlign, int vAlign)
          Creates a checkbox celleditor that is only sensible for mouse activation in the specified area.
 
Method Summary
 boolean isApplicable(int eventType, KTable table, int col, int row, org.eclipse.swt.graphics.Point clickLocation, java.lang.String keyInput, int stateMask)
          Is called when an activation is triggered via a mouse click.
 
Methods inherited from class de.kupzog.ktable.editors.KTableCellEditorCheckbox
close, getActivationSignals, open, setContent
 
Methods inherited from class de.kupzog.ktable.KTableCellEditor
dispose, getBounds, getControl, isFocused, setBounds, setToolTipText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KTableCellEditorCheckbox2

public KTableCellEditorCheckbox2(org.eclipse.swt.graphics.Point activeArea,
                                 int hAlign,
                                 int vAlign)
Creates a checkbox celleditor that is only sensible for mouse activation in the specified area.

Parameters:
activeArea - The size of the active area inside the cell. x means width, y means height.
hAlign - The horizontal alignment of the active area inside the cell. Defined in the SWTX class. Possible values: ALIGN_HORIZONTAL_CENTER, ALIGN_HORIZONTAL_LEFT, ALIGN_HORIZONTAL_RIGHT
vAlign - The vertical alignment of the active area inside the cell. Defined in the SWTX class. Possible values: ALIGN_VERTICAL_CENTER, ALIGN_VERTICAL_BOTTOM, ALIGN_VERTICAL_TOP
Throws:
java.lang.ClassCastException - if an invalid input is given.
Method Detail

isApplicable

public boolean isApplicable(int eventType,
                            KTable table,
                            int col,
                            int row,
                            org.eclipse.swt.graphics.Point clickLocation,
                            java.lang.String keyInput,
                            int stateMask)
Is called when an activation is triggered via a mouse click.

If false is returned, the editor does not get activated.

All coordinates must be relative to the KTable.

Overrides:
isApplicable in class KTableCellEditor
Parameters:
clickLocation - The point where the mouseclick occured.
eventType - The reason why the KTable wants to open the editor. Either:
KTableCellEditor.DOUBLECLICK
KTableCellEditor.SINGLECLICK
KTableCellEditor.KEY_ANY
KTableCellEditor.KEY_RETURN_AND_SPACE
table - The KTable instance this editor operates on.
col - The column index to operate on.
row - The row index to operate on.
keyInput - The character input in case of keyboard event. null if activated because of a mouse event.
stateMask - The statemask from the causing event.
Returns:
Returns true if the editor activation should happen.