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
PlainTextChanges 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 RichTextChanges; otherwise, it can undo/redo multiple PlainTextChanges. |
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
PlainTextChanges. |
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
PlainTextChanges. |
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
PlainTextChanges. |
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
PlainTextChanges. |
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
RichTextChanges. |
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
RichTextChanges. |
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
RichTextChanges. |
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
RichTextChanges. |
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 RichTextChanges; otherwise, it can undo/redo multiple PlainTextChanges.public static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<RichTextChange<PS,SEG,S>>> richTextUndoManager(GenericStyledArea<PS,SEG,S> area)
RichTextChanges. New changes
emitted from the stream will not be merged with the previous change
after DEFAULT_PREVENT_MERGE_DELAYpublic 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)
RichTextChanges. New changes
emitted from the stream will not be merged with the previous change
after preventMergeDelaypublic 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)
RichTextChanges. New changes
emitted from the stream will not be merged with the previous change
after DEFAULT_PREVENT_MERGE_DELAYpublic 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)
RichTextChanges. New changes
emitted from the stream will not be merged with the previous change
after preventMergeDelaypublic static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<PlainTextChange>> plainTextUndoManager(GenericStyledArea<PS,SEG,S> area)
PlainTextChanges. New changes
emitted from the stream will not be merged with the previous change
after DEFAULT_PREVENT_MERGE_DELAYpublic static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<PlainTextChange>> plainTextUndoManager(GenericStyledArea<PS,SEG,S> area, java.time.Duration preventMergeDelay)
PlainTextChanges. New changes
emitted from the stream will not be merged with the previous change
after preventMergeDelaypublic static <PS,SEG,S> org.fxmisc.undo.UndoManager<java.util.List<PlainTextChange>> plainTextUndoManager(GenericStyledArea<PS,SEG,S> area, org.fxmisc.undo.UndoManagerFactory factory)
PlainTextChanges. New changes
emitted from the stream will not be merged with the previous change
after DEFAULT_PREVENT_MERGE_DELAYpublic 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)
PlainTextChanges. New changes
emitted from the stream will not be merged with the previous change
after preventMergeDelaypublic 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)
PlainTextChanges 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().