public interface UndoManagerFactory
Modifier and Type | Method and Description |
---|---|
default <C> UndoManager<java.util.List<C>> |
createMultiChangeUM(EventStream<java.util.List<C>> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<java.util.List<C>> apply)
Creates an
UndoManager that tracks lists of changes emitted from changeStream . |
default <C> UndoManager<java.util.List<C>> |
createMultiChangeUM(EventStream<java.util.List<C>> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<java.util.List<C>> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge)
Creates an
UndoManager that tracks and optionally merges lists of changes
emitted from changeStream . |
default <C> UndoManager<java.util.List<C>> |
createMultiChangeUM(EventStream<java.util.List<C>> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<java.util.List<C>> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
java.util.function.Predicate<C> isIdentity)
Creates an
UndoManager that tracks and optionally merges lists of changes
emitted from changeStream . |
<C> UndoManager<java.util.List<C>> |
createMultiChangeUM(EventStream<java.util.List<C>> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<java.util.List<C>> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
java.util.function.Predicate<C> isIdentity,
java.time.Duration preventMergeDelay)
Creates an
UndoManager that tracks and optionally merges lists of changes
emitted from changeStream . |
default <C> UndoManager<C> |
createSingleChangeUM(EventStream<C> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<C> apply)
Creates an
UndoManager that tracks changes emitted from changeStream . |
default <C> UndoManager<C> |
createSingleChangeUM(EventStream<C> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<C> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge)
Creates an
UndoManager that tracks and optionally merges changes emitted from changeStream . |
default <C> UndoManager<C> |
createSingleChangeUM(EventStream<C> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<C> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
java.util.function.Predicate<C> isIdentity)
Creates an
UndoManager that tracks and optionally merges changes emitted from changeStream . |
<C> UndoManager<C> |
createSingleChangeUM(EventStream<C> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<C> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
java.util.function.Predicate<C> isIdentity,
java.time.Duration preventMergeDelay)
Creates an
UndoManager that tracks and optionally merges changes emitted from changeStream . |
static UndoManagerFactory |
fixedSizeHistoryFactory(int capacity)
Creates a factory for
UndoManager s with bounded history. |
static <C> UndoManager<java.util.List<C>> |
fixedSizeHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<java.util.List<C>> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
int capacity)
Creates an
UndoManager with bounded history. |
static <C> UndoManager<java.util.List<C>> |
fixedSizeHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<java.util.List<C>> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
java.util.function.Predicate<C> isIdentity,
java.time.Duration preventMergeDelay,
int capacity)
Creates an
UndoManager with bounded history. |
static <C> UndoManager<java.util.List<C>> |
fixedSizeHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<java.util.List<C>> apply,
int capacity)
Creates an
UndoManager with bounded history. |
static <C> UndoManager<C> |
fixedSizeHistorySingleChangeUM(EventStream<C> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<C> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
int capacity)
Creates an
UndoManager with bounded history. |
static <C> UndoManager<C> |
fixedSizeHistorySingleChangeUM(EventStream<C> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<C> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
java.util.function.Predicate<C> isIdentity,
java.time.Duration preventMergeDelay,
int capacity)
Creates an
UndoManager with bounded history. |
static <C> UndoManager<C> |
fixedSizeHistorySingleChangeUM(EventStream<C> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<C> apply,
int capacity)
Creates an
UndoManager with bounded history. |
static UndoManagerFactory |
unlimitedHistoryFactory()
Creates a factory for
UndoManager s with unlimited history. |
static <C> UndoManager<java.util.List<C>> |
unlimitedHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<java.util.List<C>> apply)
Creates an
UndoManager with unlimited history. |
static <C> UndoManager<java.util.List<C>> |
unlimitedHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<java.util.List<C>> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge)
Creates an
UndoManager with unlimited history. |
static <C> UndoManager<java.util.List<C>> |
unlimitedHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<java.util.List<C>> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
java.util.function.Predicate<C> isIdentity)
Creates an
UndoManager with unlimited history. |
static <C> UndoManager<java.util.List<C>> |
unlimitedHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<java.util.List<C>> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
java.util.function.Predicate<C> isIdentity,
java.time.Duration preventMergeDelay)
Creates an
UndoManager with unlimited history. |
static <C> UndoManager<C> |
unlimitedHistorySingleChangeUM(EventStream<C> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<C> apply)
Creates an
UndoManager with unlimited history. |
static <C> UndoManager<C> |
unlimitedHistorySingleChangeUM(EventStream<C> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<C> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge)
Creates an
UndoManager with unlimited history. |
static <C> UndoManager<C> |
unlimitedHistorySingleChangeUM(EventStream<C> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<C> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
java.util.function.Predicate<C> isIdentity)
Creates an
UndoManager with unlimited history. |
static <C> UndoManager<C> |
unlimitedHistorySingleChangeUM(EventStream<C> changeStream,
java.util.function.Function<? super C,? extends C> invert,
java.util.function.Consumer<C> apply,
java.util.function.BiFunction<C,C,java.util.Optional<C>> merge,
java.util.function.Predicate<C> isIdentity,
java.time.Duration preventMergeDelay)
Creates an
UndoManager with unlimited history. |
static UndoManagerFactory |
zeroHistoryFactory()
Creates a factory for
UndoManager s with no history. |
static <C> UndoManager<java.util.List<C>> |
zeroHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream)
Creates an
UndoManager with no history: all changes emitted from changeStream will be
immediately forgotten. |
static <C> UndoManager<C> |
zeroHistorySingleChangeUM(EventStream<C> changeStream)
Creates an
UndoManager with no history: all changes emitted from changeStream will be
immediately forgotten. |
default <C> UndoManager<C> createSingleChangeUM(EventStream<C> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<C> apply)
UndoManager
that tracks changes emitted from changeStream
.C
- representation of a changeinvert
- Inverts a change, so that applying the inverted change (apply.accept(invert.apply(c))
)
has the effect of undoing the original change (c
). Inverting a change twice should
result in the original change (invert.apply(invert.apply(c)).equals(c)
).apply
- Used to apply a change. From the point of view of apply
, C
describes an action to be performed. Calling apply.accept(c)
must cause c
to be emitted from changeStream
.default <C> UndoManager<C> createSingleChangeUM(EventStream<C> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<C> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge)
UndoManager
that tracks and optionally merges changes emitted from changeStream
.C
- representation of a changeinvert
- Inverts a change, so that applying the inverted change (apply.accept(invert.apply(c))
)
has the effect of undoing the original change (c
). Inverting a change twice should
result in the original change (invert.apply(invert.apply(c)).equals(c)
).apply
- Used to apply a change. From the point of view of apply
, C
describes an action to be performed. Calling apply.accept(c)
must cause c
to be emitted from changeStream
.merge
- Used to merge two subsequent changes into one.
Returns an empty Optional when the changes cannot or should not be merged.default <C> UndoManager<C> createSingleChangeUM(EventStream<C> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<C> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, java.util.function.Predicate<C> isIdentity)
UndoManager
that tracks and optionally merges changes emitted from changeStream
.C
- representation of a changeinvert
- Inverts a change, so that applying the inverted change (apply.accept(invert.apply(c))
)
has the effect of undoing the original change (c
). Inverting a change twice should
result in the original change (invert.apply(invert.apply(c)).equals(c)
).apply
- Used to apply a change. From the point of view of apply
, C
describes an action to be performed. Calling apply.accept(c)
must cause c
to be emitted from changeStream
.merge
- Used to merge two subsequent changes into one.
Returns an empty Optional when the changes cannot or should not be merged.
If two changes "annihilate" (i.e. merge.apply(c1, c2).isPresen()
and
isIdentity.test(merge.apply(c1, c2).get())
are both true
), it should
be the case that one is inverse of the other (invert.apply(c1).equals(c2)
).isIdentity
- returns true for changes whose application would have no effect, thereby equivalent
to an identity function (Function.identity()
) on the underlying model.<C> UndoManager<C> createSingleChangeUM(EventStream<C> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<C> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, java.util.function.Predicate<C> isIdentity, java.time.Duration preventMergeDelay)
UndoManager
that tracks and optionally merges changes emitted from changeStream
.C
- representation of a changeinvert
- Inverts a change, so that applying the inverted change (apply.accept(invert.apply(c))
)
has the effect of undoing the original change (c
). Inverting a change twice should
result in the original change (invert.apply(invert.apply(c)).equals(c)
).apply
- Used to apply a change. From the point of view of apply
, C
describes an action to be performed. Calling apply.accept(c)
must cause c
to be emitted from changeStream
.merge
- Used to merge two subsequent changes into one.
Returns an empty Optional when the changes cannot or should not be merged.
If two changes "annihilate" (i.e. merge.apply(c1, c2).isPresen()
and
isIdentity.test(merge.apply(c1, c2).get())
are both true
), it should
be the case that one is inverse of the other (invert.apply(c1).equals(c2)
).isIdentity
- returns true for changes whose application would have no effect, thereby equivalent
to an identity function (Function.identity()
) on the underlying model.preventMergeDelay
- the amount by which to wait before calling UndoManager.preventMerge()
.
Helpful when one wants to prevent merges after a period of inactivity (the
changeStream
doesn't emit an event after the given duration). Passing in
a negative or zero duration will never call UndoManager.preventMerge()
.static <C> UndoManager<C> unlimitedHistorySingleChangeUM(EventStream<C> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<C> apply)
UndoManager
with unlimited history.
For description of parameters, see
createSingleChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.static <C> UndoManager<C> unlimitedHistorySingleChangeUM(EventStream<C> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<C> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge)
UndoManager
with unlimited history.
For description of parameters, see
createSingleChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.static <C> UndoManager<C> unlimitedHistorySingleChangeUM(EventStream<C> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<C> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, java.util.function.Predicate<C> isIdentity)
UndoManager
with unlimited history.
For description of parameters, see
createSingleChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.static <C> UndoManager<C> unlimitedHistorySingleChangeUM(EventStream<C> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<C> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, java.util.function.Predicate<C> isIdentity, java.time.Duration preventMergeDelay)
UndoManager
with unlimited history.
For description of parameters, see
createSingleChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.static <C> UndoManager<C> fixedSizeHistorySingleChangeUM(EventStream<C> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<C> apply, int capacity)
UndoManager
with bounded history.
When at full capacity, a new change will cause the oldest change to be forgotten.
For description of the remaining parameters, see
createSingleChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.
capacity
- maximum number of changes the returned UndoManager can storestatic <C> UndoManager<C> fixedSizeHistorySingleChangeUM(EventStream<C> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<C> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, int capacity)
UndoManager
with bounded history.
When at full capacity, a new change will cause the oldest change to be forgotten.
For description of the remaining parameters, see
createSingleChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.
capacity
- maximum number of changes the returned UndoManager can storestatic <C> UndoManager<C> fixedSizeHistorySingleChangeUM(EventStream<C> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<C> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, java.util.function.Predicate<C> isIdentity, java.time.Duration preventMergeDelay, int capacity)
UndoManager
with bounded history.
When at full capacity, a new change will cause the oldest change to be forgotten.
For description of the remaining parameters, see
createSingleChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.
capacity
- maximum number of changes the returned UndoManager can storestatic <C> UndoManager<C> zeroHistorySingleChangeUM(EventStream<C> changeStream)
UndoManager
with no history: all changes emitted from changeStream
will be
immediately forgotten. Therefore, the returned UndoManager will never be able to undo/redo
any change emitted from changeStream
.
However, the (imaginary) current position will keep advancing, so that one can still use
UndoManager.atMarkedPositionProperty()
to determine whether any change has occurred since the last
UndoManager.mark()
(e.g. since the last save).default <C> UndoManager<java.util.List<C>> createMultiChangeUM(EventStream<java.util.List<C>> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<java.util.List<C>> apply)
UndoManager
that tracks lists of changes emitted from changeStream
.C
- representation of a changeinvert
- Inverts a change, so that applying the inverted change (apply.accept(invert.apply(c))
)
has the effect of undoing the original change (c
). Inverting a change twice should
result in the original change (invert.apply(invert.apply(c)).equals(c)
).apply
- Used to apply a list of changes. list
describes a list of actions to be performed.
Calling apply.accept(list)
must cause list
to be emitted from
the changeStream
.default <C> UndoManager<java.util.List<C>> createMultiChangeUM(EventStream<java.util.List<C>> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<java.util.List<C>> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge)
UndoManager
that tracks and optionally merges lists of changes
emitted from changeStream
.C
- representation of a changeinvert
- Inverts a change, so that applying the inverted change (apply.accept(invert.apply(c))
)
has the effect of undoing the original change (c
). Inverting a change twice should
result in the original change (invert.apply(invert.apply(c)).equals(c)
).apply
- Used to apply a list of changes. list
describes a list of actions to be performed.
Calling apply.accept(list)
must cause list
to be emitted from
the changeStream
.merge
- Used to merge two subsequent changes into one.
Returns an empty Optional when the changes cannot or should not be merged.default <C> UndoManager<java.util.List<C>> createMultiChangeUM(EventStream<java.util.List<C>> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<java.util.List<C>> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, java.util.function.Predicate<C> isIdentity)
UndoManager
that tracks and optionally merges lists of changes
emitted from changeStream
.C
- representation of a changeinvert
- Inverts a change, so that applying the inverted change (apply.accept(invert.apply(c))
)
has the effect of undoing the original change (c
). Inverting a change twice should
result in the original change (invert.apply(invert.apply(c)).equals(c)
).apply
- Used to apply a list of changes. list
describes a list of actions to be performed.
Calling apply.accept(list)
must cause list
to be emitted from
the changeStream
.merge
- Used to merge two subsequent changes into one.
Returns an empty Optional when the changes cannot or should not be merged.
If two changes "annihilate" (i.e. merge.apply(c1, c2).isPresen()
and
isIdentity.test(merge.apply(c1, c2).get())
are both true
), it should
be the case that one is inverse of the other (invert.apply(c1).equals(c2)
).isIdentity
- returns true for changes whose application would have no effect, thereby equivalent
to an identity function (Function.identity()
) on the underlying model.<C> UndoManager<java.util.List<C>> createMultiChangeUM(EventStream<java.util.List<C>> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<java.util.List<C>> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, java.util.function.Predicate<C> isIdentity, java.time.Duration preventMergeDelay)
UndoManager
that tracks and optionally merges lists of changes
emitted from changeStream
.C
- representation of a changeinvert
- Inverts a change, so that applying the inverted change (apply.accept(invert.apply(c))
)
has the effect of undoing the original change (c
). Inverting a change twice should
result in the original change (invert.apply(invert.apply(c)).equals(c)
).apply
- Used to apply a list of changes. list
describes a list of actions to be performed.
Calling apply.accept(list)
must cause list
to be emitted from
the changeStream
.merge
- Used to merge two subsequent changes into one.
Returns an empty Optional when the changes cannot or should not be merged.
If two changes "annihilate" (i.e. merge.apply(c1, c2).isPresen()
and
isIdentity.test(merge.apply(c1, c2).get())
are both true
), it should
be the case that one is inverse of the other (invert.apply(c1).equals(c2)
).isIdentity
- returns true for changes whose application would have no effect, thereby equivalent
to an identity function (Function.identity()
) on the underlying model.preventMergeDelay
- the amount by which to wait before calling UndoManager.preventMerge()
.
Helpful when one wants to prevent merges after a period of inactivity (the
changeStream
doesn't emit an event after the given duration). Passing in
a negative or zero duration will never call UndoManager.preventMerge()
.static <C> UndoManager<java.util.List<C>> unlimitedHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<java.util.List<C>> apply)
UndoManager
with unlimited history.
For description of parameters, see
createMultiChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.static <C> UndoManager<java.util.List<C>> unlimitedHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<java.util.List<C>> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge)
UndoManager
with unlimited history.
For description of parameters, see
createMultiChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.static <C> UndoManager<java.util.List<C>> unlimitedHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<java.util.List<C>> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, java.util.function.Predicate<C> isIdentity)
UndoManager
with unlimited history.
For description of parameters, see
createMultiChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.static <C> UndoManager<java.util.List<C>> unlimitedHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<java.util.List<C>> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, java.util.function.Predicate<C> isIdentity, java.time.Duration preventMergeDelay)
UndoManager
with unlimited history.
For description of parameters, see
createMultiChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.static <C> UndoManager<java.util.List<C>> fixedSizeHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<java.util.List<C>> apply, int capacity)
UndoManager
with bounded history.
When at full capacity, a new change will cause the oldest change to be forgotten.
For description of the remaining parameters, see
createMultiChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.
capacity
- maximum number of changes the returned UndoManager can storestatic <C> UndoManager<java.util.List<C>> fixedSizeHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<java.util.List<C>> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, int capacity)
UndoManager
with bounded history.
When at full capacity, a new change will cause the oldest change to be forgotten.
For description of the remaining parameters, see
createMultiChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.
capacity
- maximum number of changes the returned UndoManager can storestatic <C> UndoManager<java.util.List<C>> fixedSizeHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream, java.util.function.Function<? super C,? extends C> invert, java.util.function.Consumer<java.util.List<C>> apply, java.util.function.BiFunction<C,C,java.util.Optional<C>> merge, java.util.function.Predicate<C> isIdentity, java.time.Duration preventMergeDelay, int capacity)
UndoManager
with bounded history.
When at full capacity, a new change will cause the oldest change to be forgotten.
For description of the remaining parameters, see
createMultiChangeUM(EventStream, Function, Consumer, BiFunction, Predicate, Duration)
.
capacity
- maximum number of changes the returned UndoManager can storestatic <C> UndoManager<java.util.List<C>> zeroHistoryMultiChangeUM(EventStream<java.util.List<C>> changeStream)
UndoManager
with no history: all changes emitted from changeStream
will be
immediately forgotten. Therefore, the returned UndoManager will never be able to undo/redo
any change emitted from changeStream
.
However, the (imaginary) current position will keep advancing, so that one can still use
UndoManager.atMarkedPositionProperty()
to determine whether any change has occurred since the last
UndoManager.mark()
(e.g. since the last save).static UndoManagerFactory unlimitedHistoryFactory()
UndoManager
s with unlimited history.static UndoManagerFactory fixedSizeHistoryFactory(int capacity)
UndoManager
s with bounded history.
When at full capacity, a new change will cause the oldest change to be forgotten.static UndoManagerFactory zeroHistoryFactory()
UndoManager
s with no history.