de.jaret.util.ui.table.editor
Class BooleanCellEditor

java.lang.Object
  extended by de.jaret.util.ui.table.editor.CellEditorBase
      extended by de.jaret.util.ui.table.editor.BooleanCellEditor
All Implemented Interfaces:
ICellEditor

public class BooleanCellEditor
extends CellEditorBase
implements ICellEditor

BooleanCellEditor is not a real editor. It toggles on double click, optional on click and on a typed SPACE.

Version:
$Id: BooleanCellEditor.java 179 2007-01-07 17:37:50Z olk $
Author:
Peter Kliem

Field Summary
protected  boolean _singleClick
          single clickk attribute: if true react on single clicks.
 
Fields inherited from class de.jaret.util.ui.table.editor.CellEditorBase
_column, _row, _table
 
Constructor Summary
BooleanCellEditor()
          Default constructor.
BooleanCellEditor(boolean singleClick)
          Constructor including the singelClick property.
 
Method Summary
 void dispose()
          Dispose whatever resouces have been allocated.
 org.eclipse.swt.widgets.Control getEditorControl(JaretTable table, IRow row, IColumn column, char typedKey)
          Provide the Control for editing the value at row/column.
 boolean handleClick(JaretTable table, IRow row, IColumn column, org.eclipse.swt.graphics.Rectangle drawingArea, int x, int y)
          Handle a click on the cell.
 void stopEditing(boolean storeInput)
          End editing.
 
Methods inherited from class de.jaret.util.ui.table.editor.CellEditorBase
getPreferredHeight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.jaret.util.ui.table.editor.ICellEditor
getPreferredHeight
 

Field Detail

_singleClick

protected boolean _singleClick
single clickk attribute: if true react on single clicks.

Constructor Detail

BooleanCellEditor

public BooleanCellEditor()
Default constructor.


BooleanCellEditor

public BooleanCellEditor(boolean singleClick)
Constructor including the singelClick property.

Parameters:
singleClick - if true the editor will react on single clicks in the cell
Method Detail

getEditorControl

public org.eclipse.swt.widgets.Control getEditorControl(JaretTable table,
                                                        IRow row,
                                                        IColumn column,
                                                        char typedKey)
Provide the Control for editing the value at row/column. Important: make shure _not_ to create a new control with every call!

This method may return null indicating that the editor will not supply a control.

Base implementation storing the table and row/col information.

Specified by:
getEditorControl in interface ICellEditor
Overrides:
getEditorControl in class CellEditorBase
Parameters:
table - the table requesting the editor
row - row
column - column
typedKey - the character typed when invoking the editor (may be 0 if the editor was invoked without typing any key)
Returns:
configured Control (parent has to be the table)

stopEditing

public void stopEditing(boolean storeInput)
End editing.

Specified by:
stopEditing in interface ICellEditor
Parameters:
storeInput - if true the editor shall save the current input.

handleClick

public boolean handleClick(JaretTable table,
                           IRow row,
                           IColumn column,
                           org.eclipse.swt.graphics.Rectangle drawingArea,
                           int x,
                           int y)
Handle a click on the cell. This could handle the whole edit for single click editors. The return value controls whether the click will be used for regular selection after handling.

Specified by:
handleClick in interface ICellEditor
Overrides:
handleClick in class CellEditorBase
Parameters:
table - the jaret table calling
row - row
column - column
drawingArea - the rectangle of the cell
x - clicked coordinate x
y - clicked coordinate y
Returns:
true if the click has been handled

dispose

public void dispose()
Dispose whatever resouces have been allocated.

Specified by:
dispose in interface ICellEditor
Overrides:
dispose in class CellEditorBase


Copyright © 2012. All Rights Reserved.