de.kupzog.ktable.editors
Class TableCellEditorDialog

java.lang.Object
  extended by de.kupzog.ktable.KTableCellEditor
      extended by de.kupzog.ktable.editors.TableCellEditorDialog

public abstract class TableCellEditorDialog
extends KTableCellEditor

An abstract base implementation for a cell editor that opens a dialog.

Implement the methods getDialog() and setupShellProperties() as needed. The dialog is automatically opened in blocking mode. The editor is closed when the dialog is closed by the user.

Author:
Lorenz Maierhofer

Field Summary
 
Fields inherited from class de.kupzog.ktable.KTableCellEditor
DOUBLECLICK, KEY_ANY, KEY_RETURN_AND_SPACE, SINGLECLICK
 
Constructor Summary
TableCellEditorDialog()
           
 
Method Summary
 void close(boolean save)
          Called when the open-method returns.
abstract  org.eclipse.jface.dialogs.Dialog getDialog(org.eclipse.swt.widgets.Shell shell)
           
 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 bounds of the dialog to the cell bounds.
 void setContent(java.lang.Object content)
          Ignored.
abstract  void setupShellProperties(org.eclipse.swt.widgets.Shell dialogShell)
          Changes the properties of the dialog shell.
 
Methods inherited from class de.kupzog.ktable.KTableCellEditor
dispose, getActivationSignals, getBounds, getControl, isApplicable, isFocused, setToolTipText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableCellEditorDialog

public TableCellEditorDialog()
Method Detail

open

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

Overrides:
open in class KTableCellEditor

getDialog

public abstract org.eclipse.jface.dialogs.Dialog getDialog(org.eclipse.swt.widgets.Shell shell)
Returns:
Returns the dialog that should be shown on editor activation.

setupShellProperties

public abstract void setupShellProperties(org.eclipse.swt.widgets.Shell dialogShell)
Changes the properties of the dialog shell. One could be the bounds of the dialog...

Overwrite to change the properties.

Parameters:
dialogShell - The shell of the dialog.

close

public void close(boolean save)
Called when the open-method returns.

Overrides:
close in class KTableCellEditor
Parameters:
save - If true, the content is saved to the underlying table.

setBounds

public void setBounds(org.eclipse.swt.graphics.Rectangle rect)
Sets the bounds of the dialog to the cell bounds. DEFAULT: Ignored. Set the required shell properties by overwriting the method setupShellProperties(Shell).

Overrides:
setBounds in class KTableCellEditor

setContent

public void setContent(java.lang.Object content)
Ignored.

Specified by:
setContent in class KTableCellEditor
Parameters:
content - The new content to set.
See Also:
de.kupzog.ktable.KTableCellEditor#setContent(java.lang.String)