Module javafx.controls
Package javafx.scene.control

# Class TableColumn.CellEditEvent<S,T>

java.lang.Object
java.util.EventObject
javafx.event.Event
javafx.scene.control.TableColumn.CellEditEvent<S,T>

Type Parameters:
  `S` - The type of the TableView generic type
  `T` - The type of the content in all cells in this TableColumn

All Implemented Interfaces:
  `Serializable`, `Cloneable`

Enclosing class:
  `TableColumn<S,T>`

public static class TableColumn.CellEditEvent<S,T> extends Event
An event that is fired when a user performs an edit on a table cell.

Since:
  JavaFX 2.0
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final EventType<?>`
`ANY`
Common supertype for all cell edit event types.

### Fields inherited from class javafx.event.Event

`consumed, eventType, NULL_SOURCE_TARGET, target`

### Fields inherited from class java.util.EventObject

`source`

## Constructor Summary

Constructors
Constructor
Description
`CellEditEvent(TableView<S> table, TablePosition<S,T> pos, EventType<TableColumn.CellEditEvent<S,T>> eventType, T newValue)`
Creates a new event that can be subsequently fired to the relevant listeners.

## Method Summary

Modifier and Type
Method
Description
`T`
`getNewValue()`
Returns the new value input by the end user.
`T`
`getOldValue()`
Attempts to return the old value at the position referred to in the TablePosition returned by `getTablePosition()`.
`S`
`getRowValue()`
Convenience method that returns the value for the row (that is, from the TableView `items` list), for the row contained within the `TablePosition` returned in `getTablePosition()`.
`TableColumn<S,T>`
`getTableColumn()`
Returns the TableColumn upon which this event occurred.
`TablePosition<S,T>`
`getTablePosition()`
Returns the position upon which this event occurred.
`TableView<S>`
`getTableView()`
Returns the TableView upon which this event occurred.

### Methods inherited from class javafx.event.Event

`clone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumed`

### Methods inherited from class java.util.EventObject

`getSource, toString`

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

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

## Field Details

### ANY

public static final EventType<?> ANY
Common supertype for all cell edit event types.

Since:
  JavaFX 8.0

## Constructor Details

### CellEditEvent

public CellEditEvent(TableView<S> table, TablePosition<S,T> pos, EventType<TableColumn.CellEditEvent<S,T>> eventType, T newValue)
Creates a new event that can be subsequently fired to the relevant listeners.

Parameters:
  `table` - The TableView on which this event occurred.
  `pos` - The position upon which this event occurred.
  `eventType` - The type of event that occurred.
  `newValue` - The value input by the end user.

## Method Details

### getTableView

public TableView<S> getTableView()
Returns the TableView upon which this event occurred.

Returns:
  The TableView control upon which this event occurred.

### getTableColumn

public TableColumn<S,T> getTableColumn()
Returns the TableColumn upon which this event occurred.

Returns:
  The TableColumn that the edit occurred in.

### getTablePosition

public TablePosition<S,T> getTablePosition()
Returns the position upon which this event occurred.

Returns:
  The position upon which this event occurred.

### getNewValue

public T getNewValue()
Returns the new value input by the end user. This is not the value to go back into the TableView.items list - this new value represents just the input for a single cell, so it is likely that it needs to go back into a property within an item in the TableView.items list.

Returns:
  An Object representing the new value input by the user.

### getOldValue

public T getOldValue()
Attempts to return the old value at the position referred to in the TablePosition returned by `getTablePosition()`. This may return null for a number of reasons.

Returns:
  Returns the value stored in the position being edited, or null if it can not be retrieved.

### getRowValue

public S getRowValue()
Convenience method that returns the value for the row (that is, from the TableView `items` list), for the row contained within the `TablePosition` returned in `getTablePosition()`.

Returns:
  the value for the row