Holger's Java API

## com.antelmann.util.table
Class MultiLineCellTextEditor

    java.lang.Object
      javax.swing.AbstractCellEditor
          com.antelmann.util.table.AbstractSpecialCellEditor
              com.antelmann.util.table.MultiLineCellTextEditor

All Implemented Interfaces:
  Serializable, CellEditor, TableCellEditor

    public class MultiLineCellTextEditor

extends AbstractSpecialCellEditor
implements TableCellEditor

allows to edit String values in a cell in a JTextArea, optionally with dialog capabilities

Since:
  19. Februar 2008, 12:19
Author:
  Holger Antelmann
See Also:
  Serialized Form

Field Summary
`protected boolean` `fixTabKeys`
`protected JTextArea` `textArea`

Fields inherited from class javax.swing.AbstractCellEditor
`changeEvent, listenerList`

Constructor Summary
`MultiLineCellTextEditor()` calls this(null), dialog option is disabled
`MultiLineCellTextEditor(boolean fixTabKeys)`
`MultiLineCellTextEditor(String dialogTitle)`
`MultiLineCellTextEditor(String dialogTitle, boolean fixTabKeys)`
`MultiLineCellTextEditor(String dialogTitle, int dialogRows, int dialogColumns)`
`MultiLineCellTextEditor(String dialogTitle, int dialogRows, int dialogColumns, boolean fixTabKeys)`

Method Summary
`protected void` `customizeForDialog(JTextArea ta)` allows to customize the JTextArea that is shown in the dialog (called when it already has the text set); this implementation 'fixes' the tab keys if selected with the constructor
`Object` `getCellEditorValue()`
`JTextArea` `getJTextArea()` provides direct access to the JTextArea that is used to display the value for further customization; if the appropriate option is set with the constructor, the tab keys are already 'fixed'
`Component` `getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)`
`String` `showDialog(String title, Component parent, String initialText, int rows, int columns)` called when the doubleClickForDialog option takes effect

Methods inherited from class com.antelmann.util.table.AbstractSpecialCellEditor
`getClickCountToStart, isCellEditable, setClickCountToStart`

Methods inherited from class javax.swing.AbstractCellEditor
`addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener, shouldSelectCell, stopCellEditing`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface javax.swing.CellEditor
`addCellEditorListener, cancelCellEditing, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing`

Field Detail

### textArea

    protected JTextArea textArea

### fixTabKeys

    protected boolean fixTabKeys

Constructor Detail

### MultiLineCellTextEditor

    public MultiLineCellTextEditor()

  calls this(null), dialog option is disabled

### MultiLineCellTextEditor

    public MultiLineCellTextEditor(boolean fixTabKeys)

### MultiLineCellTextEditor

    public MultiLineCellTextEditor(String dialogTitle)

Parameters:
  `dialogTitle` - if non-null, this is used as a title for a dialog that appears on double-clicking the cell

### MultiLineCellTextEditor

    public MultiLineCellTextEditor(String dialogTitle,
                                   boolean fixTabKeys)

Parameters:
  `dialogTitle` - if non-null, this is used as a title for a dialog that appears on double-clicking the cell
  `fixTabKeys` - if true, the JTextArea will loose focus on tab (switching to the next field) instead of placing a tab into the text

### MultiLineCellTextEditor

    public MultiLineCellTextEditor(String dialogTitle,
                                   int dialogRows,
                                   int dialogColumns)

### MultiLineCellTextEditor

    @Todo
    public MultiLineCellTextEditor(String dialogTitle,
                                        int dialogRows,
                                        int dialogColumns,
                                        boolean fixTabKeys)

Method Detail

### showDialog

    public String showDialog(String title,
                             Component parent,
                             String initialText,
                             int rows,
                             int columns)

  called when the doubleClickForDialog option takes effect

### customizeForDialog

    protected void customizeForDialog(JTextArea ta)

  allows to customize the JTextArea that is shown in the dialog (called when it already has the text set); this implementation 'fixes' the tab keys if selected with the constructor

  See Also:
    `FormHelper.fixTabKeys(Component...)`

### getCellEditorValue

    public Object getCellEditorValue()

  Specified by:
    `getCellEditorValue` in interface `CellEditor`

### getJTextArea

    public JTextArea getJTextArea()

  provides direct access to the JTextArea that is used to display the value for further customization; if the appropriate option is set with the constructor, the tab keys are already 'fixed'

  See Also:
    `FormHelper.fixTabKeys(Component...)`

### getTableCellEditorComponent

    public Component getTableCellEditorComponent(JTable table,
                                                 Object value,
                                                 boolean isSelected,
                                                 int row,
                                                 int column)

  Specified by:
    `getTableCellEditorComponent` in interface `TableCellEditor`

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads