Module javafx.controls
Package javafx.scene.control

# Class TreeView.EditEvent<T>

java.lang.Object
java.util.EventObject
javafx.event.Event
javafx.scene.control.TreeView.EditEvent<T>

Type Parameters:
  `T` - The type of the input, which is the same type as the TreeView itself.

All Implemented Interfaces:
  `Serializable`, `Cloneable`

Enclosing class:
  TreeView<T>

    public static class TreeView.EditEvent<T>
    extends Event

An `Event` subclass used specifically in TreeView for representing edit-related events. It provides additional API to easily access the TreeItem that the edit event took place on, as well as the input provided by the end user.

Since:
  JavaFX 2.0
See Also:
  Serialized Form

- ## Field Summary

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

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

  `consumed, eventType, NULL_SOURCE_TARGET, target`

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `EditEvent​(TreeView<T> source, EventType<? extends TreeView.EditEvent> eventType, TreeItem<T> treeItem, T oldValue, T newValue)` | Creates a new EditEvent instance to represent an edit event.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `T` | `getNewValue()` | Returns the new value input into the TreeItem by the end user.
  `T` | `getOldValue()` | Returns the old value that existed in the TreeItem prior to the current edit event.
  `TreeView<T>` | `getSource()` | Returns the TreeView upon which the edit took place.
  `TreeItem<T>` | `getTreeItem()` | Returns the `TreeItem` upon which the edit took place.

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

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

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

  `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 edit event types.
    Since:
      JavaFX 8.0

- ## Constructor Details

  - ### EditEvent

    public EditEvent​(TreeView<T> source, EventType<? extends TreeView.EditEvent> eventType, TreeItem<T> treeItem, T oldValue, T newValue)
    Creates a new EditEvent instance to represent an edit event. This event is used for `TreeView.editStartEvent()`, `TreeView.editCommitEvent()` and `TreeView.editCancelEvent()` types.
    Parameters:
      `source` - the source
      `eventType` - the eventType
      `treeItem` - the treeItem
      `oldValue` - the oldValue
      `newValue` - the newValue

- ## Method Details

  - ### getSource

    public TreeView<T> getSource()
    Returns the TreeView upon which the edit took place.
    Overrides:
      `getSource` in class `EventObject`

  - ### getTreeItem

    public TreeItem<T> getTreeItem()
    Returns the `TreeItem` upon which the edit took place.
    Returns:
      the `TreeItem` upon which the edit took place

  - ### getNewValue

    public T getNewValue()
    Returns the new value input into the TreeItem by the end user.
    Returns:
      the new value input into the TreeItem by the end user

  - ### getOldValue

    public T getOldValue()
    Returns the old value that existed in the TreeItem prior to the current edit event.
    Returns:
      the old value that existed in the TreeItem prior to the current edit event