de.jaret.util.ui.table.editor
Interface ICellEditor

All Known Implementing Classes:
BooleanCellEditor, CellEditorBase, DateCellEditor, DoubleCellEditor, EnumComboEditor, IntegerCellEditor, ObjectComboEditor, TextCellEditor

public interface ICellEditor

Interface for a cell editor to be used in the jaret table.

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

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.
 int getPreferredHeight()
          If the renderer *wishes* to be sized not the height of the cell, this method may be used to announce the preferred height of the control.
 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.
 

Method Detail

getEditorControl

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.

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

void stopEditing(boolean storeInput)
End editing.

Parameters:
storeInput - if true the editor shall save the current input.

handleClick

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.

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

void dispose()
Dispose whatever resouces have been allocated.


getPreferredHeight

int getPreferredHeight()
If the renderer *wishes* to be sized not the height of the cell, this method may be used to announce the preferred height of the control. A value of -1 signals no preference.

Returns:
preferred height or -1 for no preference.


Copyright © 2012. All Rights Reserved.