All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fxmisc.richtext.UndoActions Maven / Gradle / Ivy

There is a newer version: 0.11.3
Show newest version
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(); }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy