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
An 
Event that contains relevant information for all forms of
 TreeItem modifications.- Since:
- JavaFX 2.0
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final EventType<?>Common supertype for all tree modification event types.Fields declared in class javafx.event.Eventconsumed, eventType, NULL_SOURCE_TARGET, targetFields declared in class java.util.EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionTreeModificationEvent(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.Constructs a TreeModificationEvent for when the TreeItem has had itsTreeItem.valueProperty()changed.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the children added to the TreeItem in this event, or an empty list if no children were added.intReturns the number of children items that were added in this event, or zero if no children were added.If the value of the TreeItem changed, this method will return the new value.Returns the children removed from the TreeItem in this event, or an empty list if no children were added.intReturns the number of children items that were removed in this event, or zero if no children were removed.Returns the TreeItem upon which this event occurred.Returns the TreeItem that this event occurred upon.booleanwasAdded()Returns true if this event represents a TreeItem event where children TreeItems were added.booleanReturns true if this event represents a TreeItem collapse event, and false if the TreeItem was not collapsed.booleanReturns true if this event represents a TreeItem expansion event, and false if the TreeItem was not expanded.booleanReturns true if the order of the TreeItem children list has changed, but that there have been no additions or removals.booleanReturns true if this event represents a TreeItem event where children TreeItems were removed.Methods declared in class javafx.event.Eventclone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumedMethods declared in class java.util.EventObjecttoString
- 
Field Details- 
ANYCommon supertype for all tree modification event types.- Since:
- JavaFX 8.0
 
 
- 
- 
Constructor Details- 
TreeModificationEventConstructs 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 Details- 
getSourceReturns the TreeItem upon which this event occurred.- Overrides:
- getSourcein class- EventObject
- Since:
- JavaFX 2.1
 
- 
getTreeItemReturns the TreeItem that this event occurred upon.- Returns:
- The TreeItem that this event occurred upon.
 
- 
getNewValueIf 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.
 
- 
getAddedChildrenReturns 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.
 
- 
getRemovedChildrenReturns 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
 
 
-