Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8370909

RichTextArea: remove allowUndo parameter

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • jfx26
    • javafx
    • None
    • source, binary, behavioral
    • medium
    • This is not a backward compatible change, permitted due to the feature being incubated.
    • Java API
    • JDK

      Summary

      Removes allowUndo parameter from RichTextArea::replaceText. Adds a boolean undoRedoEnabled attribute to the StyledTextModel.

      Note that this is NOT a backward-compatible change, as a part of the incubator iteration.

      Problem

      Early user feedback asked for addition of allowUndo parameter to applyStyle() and setStyle() methods in the StyledTextModel, to mirror the parameter in replaceText().

      However, selectively enabling or disabling the undo functionality corrupts the internal state. Instead, to address use cases that require disabled undo, such as programmatically building the document content, a single boolean flag is added to the model. Disabling undo also clears the undo/redo stack.

      Solution

      The solution is to remove the offending parameter and add a flag.

      Additionally, similar methods are added to the RichTextArea class that forward the calls to the model (or do nothing if the model is null).

      Specification

      See the attached diffs.

            angorya Andy Goryachev
            angorya Andy Goryachev
            Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: