RichTextArea: line endings

XMLWordPrintable

    • Type: CSR
    • Resolution: Approved
    • Priority: P4
    • jfx26
    • Component/s: javafx
    • None
    • source
    • minimal
    • New methods are added to some classes being incubated.
    • Java API
    • JDK

      Summary

      Adds LineEnding enum to represent 3 possible cases:

      • CR — Legacy Mac OS line ending, ASCII CR (0x0d)
      • CRLF — Windows line ending, sequence of CR/LF (0x0d 0x0a)
      • LF — macOS/Unix line ending, ASCII LF (0x0a)

      The LineEnding.system() method returns the platform line ending based on the value of system line separator string System.lineSeparator().

      Adds the lineEnding attribute to StyledTextModel via two methods:

      • setLineEnding(LineEnding)
      • getLineEnding()

      Adds the same convenience methods to the RichTextArea control, which delegate to the model.

      Problem

      The line endings are important in the following operations:

      • copy plain text to clipboard
      • save plain text (or get plain text)
      • IME

      Solution

      The solution is to provide an attribute to the base model class (StyledTextArea), as well as the convenience methods to the RichTextArea control.

      Specification

      See the attached diff file.

            Assignee:
            Andy Goryachev
            Reporter:
            Andy Goryachev
            Jayathirth D V, Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: