de.kupzog.ktable
Class KTableCellEditor

java.lang.Object
  extended by de.kupzog.ktable.KTableCellEditor
Direct Known Subclasses:
KTableCellEditorCheckbox, KTableCellEditorCombo, KTableCellEditorComboText, KTableCellEditorMultilineText, KTableCellEditorMultilineWrapText, KTableCellEditorText, KTableCellEditorText2, TableCellEditorDialog

public abstract class KTableCellEditor
extends java.lang.Object


Field Summary
static int DOUBLECLICK
           
static int KEY_ANY
           
static int KEY_RETURN_AND_SPACE
           
static int SINGLECLICK
           
 
Constructor Summary
KTableCellEditor()
           
 
Method Summary
 void close(boolean save)
          Deactivates the editor.
 void dispose()
          disposes the editor and its components
 int getActivationSignals()
           
 org.eclipse.swt.graphics.Rectangle getBounds()
           
 org.eclipse.swt.widgets.Control getControl()
           
 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.
 boolean isFocused()
          Returns true if the editor has the focus.
 void open(KTable table, int col, int row, org.eclipse.swt.graphics.Rectangle rect)
          Activates the editor at the given position.
 void setBounds(org.eclipse.swt.graphics.Rectangle rect)
          Sets the editor's position and size
abstract  void setContent(java.lang.Object content)
          Allows that external classes can set the content of the underlying
 void setToolTipText(java.lang.String toolTip)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOUBLECLICK

public static final int DOUBLECLICK
See Also:
Constant Field Values

SINGLECLICK

public static final int SINGLECLICK
See Also:
Constant Field Values

KEY_ANY

public static final int KEY_ANY
See Also:
Constant Field Values

KEY_RETURN_AND_SPACE

public static final int KEY_RETURN_AND_SPACE
See Also:
Constant Field Values
Constructor Detail

KTableCellEditor

public KTableCellEditor()
Method Detail

dispose

public void dispose()
disposes the editor and its components


open

public void open(KTable table,
                 int col,
                 int row,
                 org.eclipse.swt.graphics.Rectangle rect)
Activates the editor at the given position.

Parameters:
row -
col -
rect -

close

public void close(boolean save)
Deactivates the editor.

Parameters:
save - If true, the content is saved to the underlying table.

isFocused

public boolean isFocused()
Returns true if the editor has the focus.

Returns:
boolean

setBounds

public void setBounds(org.eclipse.swt.graphics.Rectangle rect)
Sets the editor's position and size

Parameters:
rect -

getBounds

public org.eclipse.swt.graphics.Rectangle getBounds()
Returns:
Returns the current bounds of the celleditor.

setToolTipText

public void setToolTipText(java.lang.String toolTip)
Parameters:
toolTip -

setContent

public abstract void setContent(java.lang.Object content)
Allows that external classes can set the content of the underlying

Parameters:
content - The new content to set.

getActivationSignals

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

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.

Parameters:
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.
clickLocation - The point where the mouseclick occured. null if not activated when called for a non-mouse event. (keyboard input).
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.

getControl

public org.eclipse.swt.widgets.Control getControl()