org.fxmisc.richtext.UndoActions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of richtextfx Show documentation
Show all versions of richtextfx Show documentation
Rich-text area for JavaFX
package org.fxmisc.richtext;
import org.fxmisc.undo.UndoManager;
import org.reactfx.value.Val;
/**
* Undo/redo actions for {@link TextEditingArea}.
*/
public interface UndoActions {
/**
* Undo manager of this text area.
*/
UndoManager getUndoManager();
/**
* Closes the current area's undo manager before setting it to the given one. Note: to create your
* own {@link UndoManager}, see the convenient factory methods in {@link org.fxmisc.richtext.util.UndoUtils}.
*/
void setUndoManager(UndoManager undoManager);
default void undo() { getUndoManager().undo(); }
default void redo() { getUndoManager().redo(); }
default boolean isUndoAvailable() { return getUndoManager().isUndoAvailable(); }
default Val undoAvailableProperty() { return getUndoManager().undoAvailableProperty(); }
default boolean isRedoAvailable() { return getUndoManager().isRedoAvailable(); }
default Val redoAvailableProperty() { return getUndoManager().redoAvailableProperty(); }
}