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

java.lang.Object
  extended by de.jaret.util.ui.table.editor.CellEditorBase
All Implemented Interfaces:
ICellEditor
Direct Known Subclasses:
BooleanCellEditor, DateCellEditor, DoubleCellEditor, EnumComboEditor, IntegerCellEditor, ObjectComboEditor, TextCellEditor

public abstract class CellEditorBase
extends java.lang.Object
implements ICellEditor

Abstract base implementation for ICellEditors for the jaret table.

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

Field Summary
protected  IColumn _column
          member storing the last requested column.
protected  IRow _row
          member storing the last requested row.
protected  JaretTable _table
          member storing the requesting table.
 
Constructor Summary
CellEditorBase()
           
 
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.
 
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
stopEditing
 

Field Detail

_row

protected IRow _row
member storing the last requested row.


_column

protected IColumn _column
member storing the last requested column.


_table

protected JaretTable _table
member storing the requesting table.

Constructor Detail

CellEditorBase

public CellEditorBase()
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
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)

dispose

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

Specified by:
dispose in interface ICellEditor

getPreferredHeight

public 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. default will always return -1.

Specified by:
getPreferredHeight in interface ICellEditor
Returns:
preferred height or -1 for no preference.

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
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


Copyright © 2012. All Rights Reserved.