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

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

The newest version!
package org.fxmisc.richtext.model;

import org.fxmisc.undo.UndoManager;
import org.fxmisc.undo.UndoManagerFactory;
import org.reactfx.value.Val;

/**
 * Undo/redo actions for {@link TextEditingArea}.
 */
public interface UndoActions {

    /**
     * Undo manager of this text area.
     */
    UndoManager getUndoManager();
    void setUndoManager(UndoManagerFactory undoManagerFactory);

    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