Package org.eclipse.jface.viewers

# Class ColumnViewerEditor

java.lang.Object
org.eclipse.jface.viewers.ColumnViewerEditor

Direct Known Subclasses:
  `TableViewerEditor`, `TreeViewerEditor`

public abstract class ColumnViewerEditor extends Object
This is the base for all editor implementations of Viewers. ColumnViewer implementors have to subclass this class and implement the missing methods

Since:
  3.3
See Also:
  - `TableViewerEditor`
  - `TreeViewerEditor`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`DEFAULT`
Tabbing from cell to cell is turned off
`static final int`
`KEEP_EDITOR_ON_DOUBLE_CLICK`
Style mask used to turn off the feature that an editor activation is canceled on double click.
`static final int`
`KEYBOARD_ACTIVATION`
Style mask used to enable keyboard activation
`static final int`
`TABBING_CYCLE_IN_ROW`
Should if the end of the row is reach started from the beginning in the same row
`static final int`
`TABBING_CYCLE_IN_VIEWER`
Should if the end of the viewer is reached, start from the first element in the viewer (conversely, hitting shift-tab in the first element of the viewer results in jumping to the last element of the viewer)
`static final int`
`TABBING_HORIZONTAL`
Should tabbing from column to column with in one row be supported
`static final int`
`TABBING_MOVE_TO_ROW_NEIGHBOR`
Should if the end of the row is reach started from the start/end of the row below/above
`static final int`
`TABBING_VERTICAL`
Support tabbing to Cell above/below the current cell

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`ColumnViewerEditor(ColumnViewer viewer, ColumnViewerEditorActivationStrategy editorActivationStrategy, int feature)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addEditorActivationListener(ColumnViewerEditorActivationListener listener)`
Adds the given listener, it is to be notified when the cell editor is activated or deactivated.
`ViewerCell`
`getFocusCell()`
`protected ColumnViewer`
`getViewer()`
`protected void`
`processTraverseEvent(int columnIndex, ViewerRow row, TraverseEvent event)`
Process the traverse event and opens the next available editor depending of the implemented strategy.
`void`
`removeEditorActivationListener(ColumnViewerEditorActivationListener listener)`
Removes the given listener.
`protected abstract void`
`setEditor(Control w, Item item, int fColumnNumber)`
Position the editor inside the control
`protected abstract void`
`setLayoutData(CellEditor.LayoutData layoutData)`
set the layout data for the editor
`protected abstract void`
`updateFocusCell(ViewerCell focusCell, ColumnViewerEditorActivationEvent event)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### DEFAULT

public static final int DEFAULT
Tabbing from cell to cell is turned off

See Also:
  - Constant Field Values

### TABBING_MOVE_TO_ROW_NEIGHBOR

public static final int TABBING_MOVE_TO_ROW_NEIGHBOR
Should if the end of the row is reach started from the start/end of the row below/above

See Also:
  - Constant Field Values

### TABBING_CYCLE_IN_ROW

public static final int TABBING_CYCLE_IN_ROW
Should if the end of the row is reach started from the beginning in the same row

See Also:
  - Constant Field Values

### TABBING_VERTICAL

public static final int TABBING_VERTICAL
Support tabbing to Cell above/below the current cell

See Also:
  - Constant Field Values

### TABBING_HORIZONTAL

public static final int TABBING_HORIZONTAL
Should tabbing from column to column with in one row be supported

See Also:
  - Constant Field Values

### KEYBOARD_ACTIVATION

public static final int KEYBOARD_ACTIVATION
Style mask used to enable keyboard activation

See Also:
  - Constant Field Values

### KEEP_EDITOR_ON_DOUBLE_CLICK

public static final int KEEP_EDITOR_ON_DOUBLE_CLICK
Style mask used to turn off the feature that an editor activation is canceled on double click. It is also possible to turn off this feature per cell-editor using `CellEditor.getDoubleClickTimeout()`

Since:
  3.4
See Also:
  - Constant Field Values

### TABBING_CYCLE_IN_VIEWER

public static final int TABBING_CYCLE_IN_VIEWER
Should if the end of the viewer is reached, start from the first element in the viewer (conversely, hitting shift-tab in the first element of the viewer results in jumping to the last element of the viewer)

Since:
  3.17
See Also:
  - Constant Field Values

## Constructor Details

### ColumnViewerEditor

protected ColumnViewerEditor(ColumnViewer viewer, ColumnViewerEditorActivationStrategy editorActivationStrategy, int feature)

Parameters:
  `viewer` - the viewer this editor is attached to
  `editorActivationStrategy` - the strategy used to decide about editor activation
  `feature` - bit mask controlling the editor
  - `DEFAULT`
  - `TABBING_CYCLE_IN_ROW`
  - `TABBING_HORIZONTAL`
  - `TABBING_MOVE_TO_ROW_NEIGHBOR`
  - `TABBING_VERTICAL`
  - `TABBING_CYCLE_IN_VIEWER`

## Method Details

### addEditorActivationListener

public void addEditorActivationListener(ColumnViewerEditorActivationListener listener)
Adds the given listener, it is to be notified when the cell editor is activated or deactivated.

Parameters:
  `listener` - the listener to add

### removeEditorActivationListener

public void removeEditorActivationListener(ColumnViewerEditorActivationListener listener)
Removes the given listener.

Parameters:
  `listener` - the listener to remove

### processTraverseEvent

protected void processTraverseEvent(int columnIndex, ViewerRow row, TraverseEvent event)
Process the traverse event and opens the next available editor depending of the implemented strategy. The default implementation uses the style constants

- `TABBING_MOVE_TO_ROW_NEIGHBOR`
- `TABBING_CYCLE_IN_ROW`
- `TABBING_VERTICAL`
- `TABBING_HORIZONTAL`

Subclasses may overwrite to implement their custom logic to edit the next cell

Parameters:
  `columnIndex` - the index of the current column
  `row` - the current row - may only be used for the duration of this method call
  `event` - the traverse event

### setEditor

protected abstract void setEditor(Control w, Item item, int fColumnNumber)
Position the editor inside the control

Parameters:
  `w` - the editor control
  `item` - the item (row) in which the editor is drawn in
  `fColumnNumber` - the column number in which the editor is shown

### setLayoutData

protected abstract void setLayoutData(CellEditor.LayoutData layoutData)
set the layout data for the editor

Parameters:
  `layoutData` - the layout data used when editor is displayed

### updateFocusCell

protected abstract void updateFocusCell(ViewerCell focusCell, ColumnViewerEditorActivationEvent event)

Parameters:
  `focusCell` - updates the cell with the current input focus
  `event` - the event requesting to update the focusCell

### getFocusCell

public ViewerCell getFocusCell()

Returns:
  the cell currently holding the focus if no cell has the focus or the viewer implementation doesn't support `null` is returned

### getViewer

protected ColumnViewer getViewer()

Returns:
  the viewer working for