public final class UndoUtils
extends java.lang.Object
UndoManager
for a GenericStyledArea
.Modifier and Type | Field | Description |
---|---|---|
static java.time.Duration |
DEFAULT_PREVENT_MERGE_DELAY |
Modifier and Type | Method | Description |
---|---|---|
static <PS,SEG,S> java.util.function.Consumer<java.util.List<PlainTextChange>> |
applyMultiPlainTextChange(GenericStyledArea<PS,SEG,S> area) |
Applies a list of
PlainTextChange s to the given area when the UndoManager 's change stream emits
an event by area.replaceAbsolutely(change.getPosition(), change.getRemovalEnd(), change.getInserted() . |
static <PS,SEG,S> java.util.function.Consumer<java.util.List<RichTextChange<PS,SEG,S>>> |
applyMultiRichTextChange(GenericStyledArea<PS,SEG,S> area) |
Applies a list of
RichTextChange to the given area when the UndoManager 's change stream emits
an event by area.replaceAbsolutely(change.getPosition(), change.getRemovalEnd(), change.getInserted() . |
static <PS,SEG,S> java.util.function.Consumer<PlainTextChange> |
applyPlainTextChange(GenericStyledArea<PS,SEG,S> area) |
Applies a
PlainTextChange to the given area when the UndoManager 's change stream emits an event
by area.replaceText(change.getPosition(), change.getRemovalEnd(), change.getInserted() . |
static <PS,SEG,S> java.util.function.Consumer<RichTextChange<PS,SEG,S>> |
applyRichTextChange(GenericStyledArea<PS,SEG,S> area) |
Applies a
RichTextChange to the given area when the UndoManager 's change stream emits an event
by area.replace(change.getPosition(), change.getRemovalEnd(), change.getInserted() . |
static <PS,SEG,S> org.fxmisc.undo.UndoManager |
defaultUndoManager(GenericStyledArea<PS,SEG,S> area) |
Constructs an UndoManager with an unlimited history:
if
the area's preserveStyle flag is true , the returned UndoManager
can undo/redo multiple RichTextChange s; otherwise, it can undo/redo multiple PlainTextChange s. |
static org.fxmisc.undo.UndoManager |
noOpUndoManager() |
Constructs an UndoManager with no history
|
static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<PlainTextChange>> |
plainTextUndoManager(GenericStyledArea<PS,SEG,S> area) |
Returns an UndoManager with an unlimited history that can undo/redo
PlainTextChange s. |
static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<PlainTextChange>> |
plainTextUndoManager(GenericStyledArea<PS,SEG,S> area,
java.time.Duration preventMergeDelay) |
Returns an UndoManager that can undo/redo
PlainTextChange s. |
static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<PlainTextChange>> |
plainTextUndoManager(GenericStyledArea<PS,SEG,S> area,
org.fxmisc.undo.UndoManagerFactory factory) |
Returns an UndoManager that can undo/redo
PlainTextChange s. |
static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<PlainTextChange>> |
plainTextUndoManager(GenericStyledArea<PS,SEG,S> area,
org.fxmisc.undo.UndoManagerFactory factory,
java.time.Duration preventMergeDelay) |
Returns an UndoManager that can undo/redo
PlainTextChange s. |
static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> |
richTextSuspendableUndoManager(GenericStyledArea<PS,SEG,S> area,
java.time.Duration preventMergeDelay,
org.reactfx.SuspendableYes suspendUndo) |
Returns an UndoManager with an unlimited history that can undo/redo
RichTextChange s. |
static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> |
richTextSuspendableUndoManager(GenericStyledArea<PS,SEG,S> area,
org.reactfx.SuspendableYes suspendUndo) |
Returns an UndoManager with an unlimited history that can undo/redo
RichTextChange s. |
static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> |
richTextUndoManager(GenericStyledArea<PS,SEG,S> area) |
Returns an UndoManager with an unlimited history that can undo/redo
RichTextChange s. |
static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> |
richTextUndoManager(GenericStyledArea<PS,SEG,S> area,
java.time.Duration preventMergeDelay) |
Returns an UndoManager that can undo/redo
RichTextChange s. |
static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> |
richTextUndoManager(GenericStyledArea<PS,SEG,S> area,
org.fxmisc.undo.UndoManagerFactory factory) |
Returns an UndoManager that can undo/redo
RichTextChange s. |
static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> |
richTextUndoManager(GenericStyledArea<PS,SEG,S> area,
org.fxmisc.undo.UndoManagerFactory factory,
java.time.Duration preventMergeDelay) |
Returns an UndoManager that can undo/redo
RichTextChange s. |
public static final java.time.Duration DEFAULT_PREVENT_MERGE_DELAY
public static <PS,SEG,S> org.fxmisc.undo.UndoManager defaultUndoManager(GenericStyledArea<PS,SEG,S> area)
the area's preserveStyle flag is true
, the returned UndoManager
can undo/redo multiple RichTextChange
s; otherwise, it can undo/redo multiple PlainTextChange
s.public static org.fxmisc.undo.UndoManager noOpUndoManager()
public static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> richTextUndoManager(GenericStyledArea<PS,SEG,S> area)
RichTextChange
s. New changes
emitted from the stream will not be merged with the previous change
after DEFAULT_PREVENT_MERGE_DELAY
public static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> richTextUndoManager(GenericStyledArea<PS,SEG,S> area, java.time.Duration preventMergeDelay)
RichTextChange
s. New changes
emitted from the stream will not be merged with the previous change
after preventMergeDelay
public static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> richTextUndoManager(GenericStyledArea<PS,SEG,S> area, org.fxmisc.undo.UndoManagerFactory factory)
RichTextChange
s. New changes
emitted from the stream will not be merged with the previous change
after DEFAULT_PREVENT_MERGE_DELAY
public static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> richTextUndoManager(GenericStyledArea<PS,SEG,S> area, org.fxmisc.undo.UndoManagerFactory factory, java.time.Duration preventMergeDelay)
RichTextChange
s. New changes
emitted from the stream will not be merged with the previous change
after preventMergeDelay
public static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> richTextSuspendableUndoManager(GenericStyledArea<PS,SEG,S> area, org.reactfx.SuspendableYes suspendUndo)
RichTextChange
s. New changes
emitted from the stream will not be merged with the previous change after DEFAULT_PREVENT_MERGE_DELAY
Note: that only styling changes may occur during suspension of the undo manager.
public static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> richTextSuspendableUndoManager(GenericStyledArea<PS,SEG,S> area, java.time.Duration preventMergeDelay, org.reactfx.SuspendableYes suspendUndo)
RichTextChange
s. New changes
emitted from the stream will not be merged with the previous change after preventMergeDelay
.
Note: that only styling changes may occur during suspension of the undo manager.
public static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<PlainTextChange>> plainTextUndoManager(GenericStyledArea<PS,SEG,S> area)
PlainTextChange
s. New changes
emitted from the stream will not be merged with the previous change
after DEFAULT_PREVENT_MERGE_DELAY
public static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<PlainTextChange>> plainTextUndoManager(GenericStyledArea<PS,SEG,S> area, java.time.Duration preventMergeDelay)
PlainTextChange
s. New changes
emitted from the stream will not be merged with the previous change
after preventMergeDelay
public static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<PlainTextChange>> plainTextUndoManager(GenericStyledArea<PS,SEG,S> area, org.fxmisc.undo.UndoManagerFactory factory)
PlainTextChange
s. New changes
emitted from the stream will not be merged with the previous change
after DEFAULT_PREVENT_MERGE_DELAY
public static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<PlainTextChange>> plainTextUndoManager(GenericStyledArea<PS,SEG,S> area, org.fxmisc.undo.UndoManagerFactory factory, java.time.Duration preventMergeDelay)
PlainTextChange
s. New changes
emitted from the stream will not be merged with the previous change
after preventMergeDelay
public static <PS,SEG,S> java.util.function.Consumer<PlainTextChange> applyPlainTextChange(GenericStyledArea<PS,SEG,S> area)
PlainTextChange
to the given area when the UndoManager
's change stream emits an event
by area.replaceText(change.getPosition(), change.getRemovalEnd(), change.getInserted()
.public static <PS,SEG,S> java.util.function.Consumer<RichTextChange<PS,SEG,S>> applyRichTextChange(GenericStyledArea<PS,SEG,S> area)
RichTextChange
to the given area when the UndoManager
's change stream emits an event
by area.replace(change.getPosition(), change.getRemovalEnd(), change.getInserted()
.public static <PS,SEG,S> java.util.function.Consumer<java.util.List<PlainTextChange>> applyMultiPlainTextChange(GenericStyledArea<PS,SEG,S> area)
PlainTextChange
s to the given area when the UndoManager
's change stream emits
an event by area.replaceAbsolutely(change.getPosition(), change.getRemovalEnd(), change.getInserted()
.public static <PS,SEG,S> java.util.function.Consumer<java.util.List<RichTextChange<PS,SEG,S>>> applyMultiRichTextChange(GenericStyledArea<PS,SEG,S> area)
RichTextChange
to the given area when the UndoManager
's change stream emits
an event by area.replaceAbsolutely(change.getPosition(), change.getRemovalEnd(), change.getInserted()
.