public static class TreeItem.TreeModificationEvent<T> extends Event
Event
that contains relevant information for all forms of
TreeItem modifications.Modifier and Type | Field and Description |
---|---|
static EventType<?> |
ANY
Common supertype for all tree modification event types.
|
consumed, eventType, NULL_SOURCE_TARGET, target
source
Constructor and 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 its
TreeItem.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 its
TreeItem.valueProperty() changed. |
Modifier and Type | Method and 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.
|
int |
getAddedSize()
Returns the number of children items that were added in this event,
or zero if no children were added.
|
T |
getNewValue()
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.
|
int |
getRemovedSize()
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.
|
boolean |
wasAdded()
Returns true if this event represents a TreeItem event where children
TreeItems were added.
|
boolean |
wasCollapsed()
Returns true if this event represents a TreeItem collapse event,
and false if the TreeItem was not collapsed.
|
boolean |
wasExpanded()
Returns true if this event represents a TreeItem expansion event,
and false if the TreeItem was not expanded.
|
boolean |
wasPermutated()
Returns true if the order of the TreeItem children list has changed,
but that there have been no additions or removals.
|
boolean |
wasRemoved()
Returns true if this event represents a TreeItem event where children
TreeItems were removed.
|
clone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumed
toString
public static final EventType<?> ANY
public TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem)
eventType
- The type of the event that has occurred.treeItem
- The TreeItem on which this event occurred.public TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem, T newValue)
TreeItem.valueProperty()
changed.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()
.public TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem, boolean expanded)
TreeItem.expandedProperty()
changed.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.public TreeModificationEvent(EventType<? extends Event> eventType, TreeItem<T> treeItem, List<? extends TreeItem<T>> added, List<? extends TreeItem<T>> removed)
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.public TreeItem<T> getSource()
getSource
in class EventObject
public TreeItem<T> getTreeItem()
public T getNewValue()
public List<? extends TreeItem<T>> getAddedChildren()
public List<? extends TreeItem<T>> getRemovedChildren()
public int getRemovedSize()
public int getAddedSize()
public boolean wasExpanded()
public boolean wasCollapsed()
public boolean wasAdded()
public boolean wasRemoved()
public boolean wasPermutated()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.