UndoManager for single changes. For multiple changes, see
MultiChangeUndoManagerImpl.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final Consumer | |
| private final BooleanBinding | |
| private boolean | |
| private C | |
| private final EventSource | |
| private final Function | |
| private final Predicate | |
| private ChangeQueue. | |
| private final BiFunction | |
| private final Val | |
| private final Val | |
| private final SuspendableNo | |
| private final ChangeQueue | |
| private final Subscription |
| Access | Constructor and Description |
|---|---|
| public | UndoManagerImpl(ChangeQueue<C> queue, Function<? super C, ? extends C> invert, Consumer<C> apply, BiFunction<C, C, Optional<C>> merge, Predicate<C> isIdentity, EventStream<C> changeSource)
|
| public | UndoManagerImpl(ChangeQueue<C> queue, Function<? super C, ? extends C> invert, Consumer<C> apply, BiFunction<C, C, Optional<C>> merge, Predicate<C> isIdentity, EventStream<C> changeSource, Duration preventMergeDelay)
|
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private boolean | applyChange(boolean
same as `isUndoAvailable()` [Undo] or `isRedoAvailable()` [Redo] isChangeAvailable, Supplier<C> same as `invert.apply(queue.prev())` [Undo] or `queue.next()` [Redo] changeToApply)Helper method for reducing code duplication |
| public ObservableBooleanValue | atMarkedPositionProperty()
Implements org. Indicates whether this UndoManager's current position within its history is the same as the last marked position. |
| private void | |
| public void | |
| public void | forgetHistory()
Implements org. Forgets all changes prior to the current position in the history. |
| public UndoManager. | getCurrentPosition()
Implements org. Returns the current position within this UndoManager's history. |
| private void | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public Val | nextRedoProperty()
Implements org. Gives a peek at the change that will be redone by |
| public Val | nextUndoProperty()
Implements org. Gives a peek at the change that will be undone by |
| public ObservableBooleanValue | performingActionProperty()
Implements org. Indicates whether this undo manager is currently performing undo or redo action. |
| public void | preventMerge()
Implements org. Prevents the next change from being merged with the latest one. |
| public boolean | redo()
Implements org. Redo previously undone change, if there is any change to redo. |
| public Val | redoAvailableProperty()
Implements org. Indicates whether there is a change that can be redone. |
| public boolean | undo()
Implements org. Undo the most recent change, if there is any change to undo. |
| public Val | undoAvailableProperty()
Implements org. Indicates whether there is a change that can be undone. |
| apply | back to summary |
|---|---|
| private final Consumer<C> apply | |
| atMarkedPosition | back to summary |
|---|---|
| private final BooleanBinding atMarkedPosition | |
| canMerge | back to summary |
|---|---|
| private boolean canMerge | |
| expectedChange | back to summary |
|---|---|
| private C expectedChange | |
| invalidationRequests | back to summary |
|---|---|
| private final EventSource<Void> invalidationRequests | |
| invert | back to summary |
|---|---|
| private final Function<? super C, ? extends C> invert | |
| isIdentity | back to summary |
|---|---|
| private final Predicate<C> isIdentity | |
| mark | back to summary |
|---|---|
| private ChangeQueue. | |
| merge | back to summary |
|---|---|
| private final BiFunction<C, C, Optional<C>> merge | |
| nextRedo | back to summary |
|---|---|
| private final Val<C> nextRedo | |
| nextUndo | back to summary |
|---|---|
| private final Val<C> nextUndo | |
| performingAction | back to summary |
|---|---|
| private final SuspendableNo performingAction | |
| queue | back to summary |
|---|---|
| private final ChangeQueue<C> queue | |
| subscription | back to summary |
|---|---|
| private final Subscription subscription | |
| UndoManagerImpl | back to summary |
|---|---|
| public UndoManagerImpl(ChangeQueue<C> queue, Function<? super C, ? extends C> invert, Consumer<C> apply, BiFunction<C, C, Optional<C>> merge, Predicate<C> isIdentity, EventStream<C> changeSource) | |
| UndoManagerImpl | back to summary |
|---|---|
| public UndoManagerImpl(ChangeQueue<C> queue, Function<? super C, ? extends C> invert, Consumer<C> apply, BiFunction<C, C, Optional<C>> merge, Predicate<C> isIdentity, EventStream<C> changeSource, Duration preventMergeDelay) | |
| addChange | back to summary |
|---|---|
private void addChange(C change)
| |
| applyChange | back to summary |
|---|---|
| private boolean applyChange(boolean isChangeAvailable, Supplier<C> changeToApply) Helper method for reducing code duplication
| |
| atMarkedPositionProperty | back to summary |
|---|---|
| public ObservableBooleanValue atMarkedPositionProperty() Implements org. Doc from org. Indicates whether this UndoManager's current position within its history is the same as the last marked position.
| |
| changeObserved | back to summary |
|---|---|
| private void changeObserved(C change) | |
| close | back to summary |
|---|---|
| public void close() Implements org. Doc from org. Stops observing change events.
| |
| forgetHistory | back to summary |
|---|---|
| public void forgetHistory() Implements org. Doc from org. Forgets all changes prior to the current position in the history.
| |
| getCurrentPosition | back to summary |
|---|---|
| public UndoManager. Implements org. Doc from org. Returns the current position within this UndoManager's history.
| |
| invalidateProperties | back to summary |
|---|---|
| private void invalidateProperties() | |
| isAtMarkedPosition | back to summary |
|---|---|
| public boolean isAtMarkedPosition() Implements org.
| |
| isPerformingAction | back to summary |
|---|---|
| public boolean isPerformingAction() Implements org.
| |
| isRedoAvailable | back to summary |
|---|---|
| public boolean isRedoAvailable() Implements org.
| |
| isUndoAvailable | back to summary |
|---|---|
| public boolean isUndoAvailable() Implements org.
| |
| nextRedoProperty | back to summary |
|---|---|
| public Val Implements org. Doc from org. Gives a peek at the change that will be redone by
| |
| nextUndoProperty | back to summary |
|---|---|
| public Val Implements org. Doc from org. Gives a peek at the change that will be undone by
| |
| performingActionProperty | back to summary |
|---|---|
| public ObservableBooleanValue performingActionProperty() Implements org. Doc from org. Indicates whether this undo manager is currently performing undo or redo action.
| |
| preventMerge | back to summary |
|---|---|
| public void preventMerge() Implements org. Doc from org. Prevents the next change from being merged with the latest one.
| |
| redo | back to summary |
|---|---|
| public boolean redo() Implements org. Doc from org. Redo previously undone change, if there is any change to redo.
| |
| redoAvailableProperty | back to summary |
|---|---|
| public Val Implements org. Doc from org. Indicates whether there is a change that can be redone.
| |
| undo | back to summary |
|---|---|
| public boolean undo() Implements org. Doc from org. Undo the most recent change, if there is any change to undo.
| |
| undoAvailableProperty | back to summary |
|---|---|
| public Val Implements org. Doc from org. Indicates whether there is a change that can be undone.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final ChangeQueue. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isValid()
Implements org. Checks whether this history position is still valid. |
| public void | mark()
Implements org. Sets the mark of the underlying UndoManager at this position. |
| queuePos | back to summary |
|---|---|
| private final ChangeQueue. | |
| UndoPositionImpl | back to summary |
|---|---|
| pack-priv UndoPositionImpl(ChangeQueue. | |
| isValid | back to summary |
|---|---|
| public boolean isValid() Implements org. Doc from org. Checks whether this history position is still valid. A position becomes invalid when
| |
| mark | back to summary |
|---|---|
| public void mark() Implements org. Doc from org. Sets the mark of the underlying UndoManager at this position. The mark is set whether or not this position is valid. It is OK for an UndoManager to be marked at an invalid position.
| |