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

Provide a way to specify text caret based on the text component state

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 1.3.0, 8, 11, 17, 19, 20
    • client-libs
    • None

      Problem:

      Right now the text component when changing its state updates the text caret (or removes it outright) based on its own logic and it is hard or even impossible for the end user to override that behaviour. This is bad from two points of view: the lack of customization where end user can control the look and feel of the text component consistently and accessibility where text component state such as editable/non-editable is not visually indicated in a meaningful way.

      Solution:

      Add possibility to create text caret that is status aware - either by extending the javax.swing.text.Caret interface to include ways of notifying Caret about the state changes or by extending the javax.swing.text.JTextComponent with a method setCaret(Caret caret, int state) where state can be treated as a bitmask of all the possible states of the text component. The details of implementation needs to be further discussed.

            kizune Alexander Zuev
            kizune Alexander Zuev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: