- java.lang.Object
- 
- java.util.EventObject
- 
- javafx.event.Event
- 
- javafx.scene.control.TreeItem.TreeModificationEvent<T>
 
 
 
- 
- Type Parameters:
- T- The TreeModificationEvent
 - All Implemented Interfaces:
- Serializable,- Cloneable
 
 
 public static class TreeItem.TreeModificationEvent<T> extends Event AnEventthat contains relevant information for all forms of TreeItem modifications.- Since:
- JavaFX 2.0
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static EventType<?>ANYCommon supertype for all tree modification event types.- 
Fields inherited from class javafx.event.Eventconsumed, eventType, NULL_SOURCE_TARGET, target
 - 
Fields inherited from class java.util.EventObjectsource
 
- 
 - 
Constructor SummaryConstructors Constructor Description TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem)Constructs a basic TreeModificationEvent - this is useful in situations where the tree item has not received a new value, has not changed between expanded/collapsed states, and whose children has not changed.TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem, boolean expanded)Constructs a TreeModificationEvent for when the TreeItem has had itsTreeItem.expandedProperty()changed.TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem, List<? extends TreeItem<T>> added, List<? extends TreeItem<T>> removed)Constructs a TreeModificationEvent for when the TreeItem has had its children list changed.TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem, T newValue)Constructs a TreeModificationEvent for when the TreeItem has had itsTreeItem.valueProperty()changed.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description List<? extends TreeItem<T>>getAddedChildren()Returns the children added to the TreeItem in this event, or an empty list if no children were added.intgetAddedSize()Returns the number of children items that were added in this event, or zero if no children were added.TgetNewValue()If the value of the TreeItem changed, this method will return the new value.List<? extends TreeItem<T>>getRemovedChildren()Returns the children removed from the TreeItem in this event, or an empty list if no children were added.intgetRemovedSize()Returns the number of children items that were removed in this event, or zero if no children were removed.TreeItem<T>getSource()Returns the TreeItem upon which this event occurred.TreeItem<T>getTreeItem()Returns the TreeItem that this event occurred upon.booleanwasAdded()Returns true if this event represents a TreeItem event where children TreeItems were added.booleanwasCollapsed()Returns true if this event represents a TreeItem collapse event, and false if the TreeItem was not collapsed.booleanwasExpanded()Returns true if this event represents a TreeItem expansion event, and false if the TreeItem was not expanded.booleanwasPermutated()Returns true if the order of the TreeItem children list has changed, but that there have been no additions or removals.booleanwasRemoved()Returns true if this event represents a TreeItem event where children TreeItems were removed.- 
Methods inherited from class javafx.event.Eventclone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumed
 - 
Methods inherited from class java.util.EventObjecttoString
 
- 
 
- 
- 
- 
Field Detail- 
ANYpublic static final EventType<?> ANY Common supertype for all tree modification event types.- Since:
- JavaFX 8.0
 
 
- 
 - 
Constructor Detail- 
TreeModificationEventpublic TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem) Constructs a basic TreeModificationEvent - this is useful in situations where the tree item has not received a new value, has not changed between expanded/collapsed states, and whose children has not changed. An example of when this constructor is used is when the TreeItem graphic property changes.- Parameters:
- eventType- The type of the event that has occurred.
- treeItem- The TreeItem on which this event occurred.
 
 - 
TreeModificationEventpublic TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem, T newValue) Constructs a TreeModificationEvent for when the TreeItem has had itsTreeItem.valueProperty()changed.- Parameters:
- eventType- The type of the event that has occurred.
- treeItem- The TreeItem on which this event occurred.
- newValue- The new value that has been put into the- TreeItem.valueProperty().
 
 - 
TreeModificationEventpublic TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem, boolean expanded) Constructs a TreeModificationEvent for when the TreeItem has had itsTreeItem.expandedProperty()changed.- Parameters:
- eventType- The type of the event that has occurred.
- treeItem- The TreeItem on which this event occurred.
- expanded- A boolean to represent the current expanded state of the TreeItem.
 
 - 
TreeModificationEventpublic TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem, List<? extends TreeItem<T>> added, List<? extends TreeItem<T>> removed) Constructs a TreeModificationEvent for when the TreeItem has had its children list changed.- Parameters:
- eventType- The type of the event that has occurred.
- treeItem- The TreeItem on which this event occurred.
- added- A list of the items added to the children list of the given TreeItem.
- removed- A list of the items removed from the children list of the given TreeItem.
 
 
- 
 - 
Method Detail- 
getSourcepublic TreeItem<T> getSource() Returns the TreeItem upon which this event occurred.- Overrides:
- getSourcein class- EventObject
- Returns:
- The object on which the Event initially occurred.
- Since:
- JavaFX 2.1
 
 - 
getTreeItempublic TreeItem<T> getTreeItem() Returns the TreeItem that this event occurred upon.- Returns:
- The TreeItem that this event occurred upon.
 
 - 
getNewValuepublic T getNewValue() If the value of the TreeItem changed, this method will return the new value. If it did not change, this method will return null.- Returns:
- The new value of the TreeItem if it changed, null otherwise.
 
 - 
getAddedChildrenpublic List<? extends TreeItem<T>> getAddedChildren() Returns the children added to the TreeItem in this event, or an empty list if no children were added.- Returns:
- The newly added children, or an empty list if no children were added.
 
 - 
getRemovedChildrenpublic List<? extends TreeItem<T>> getRemovedChildren() Returns the children removed from the TreeItem in this event, or an empty list if no children were added.- Returns:
- The removed children, or an empty list if no children were removed.
 
 - 
getRemovedSizepublic int getRemovedSize() Returns the number of children items that were removed in this event, or zero if no children were removed.- Returns:
- The number of removed children items, or zero if no children were removed.
 
 - 
getAddedSizepublic int getAddedSize() Returns the number of children items that were added in this event, or zero if no children were added.- Returns:
- The number of added children items, or zero if no children were added.
 
 - 
wasExpandedpublic boolean wasExpanded() Returns true if this event represents a TreeItem expansion event, and false if the TreeItem was not expanded.- Returns:
- true if this event represents a TreeItem expansion event, and false if the TreeItem was not expanded
 
 - 
wasCollapsedpublic boolean wasCollapsed() Returns true if this event represents a TreeItem collapse event, and false if the TreeItem was not collapsed.- Returns:
- true if this event represents a TreeItem collapse event, and false if the TreeItem was not collapsed
 
 - 
wasAddedpublic boolean wasAdded() Returns true if this event represents a TreeItem event where children TreeItems were added.- Returns:
- true if this event represents a TreeItem event where children TreeItems were added
 
 - 
wasRemovedpublic boolean wasRemoved() Returns true if this event represents a TreeItem event where children TreeItems were removed.- Returns:
- true if this event represents a TreeItem event where children TreeItems were removed
 
 - 
wasPermutatedpublic boolean wasPermutated() Returns true if the order of the TreeItem children list has changed, but that there have been no additions or removals.- Returns:
- true if the order of the TreeItem children list has changed, but that there have been no additions or removals
 
 
- 
 
-