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

[macosx] Accented Character Input Needs to be Supported in JComponent API

XMLWordPrintable

      Mac OS supports input of accented characters using a native popup which shows
      up when certain character keys are held pressed for some time
      (http://support.apple.com/kb/PH11264). This method is currently supported by
      JDK only in components descending from java.awt.TextComponent or
      javax.swing.text.JTextComponent. In custom components subclassing
      javax.swing.JComponent directly, which implement text input functionality,
      the above mentioned input method works incorrectly.

      Details:
      Sequence of events generated by JDK for scenario when user performs input of
      accented character using above-mentioned method includes KEY_TYPED event for
      raw character input, followed by INPUT_METHOD_EVENT with details about
      accented character. Normally such sequence of events would lead to 2
      characters being inserted into document - first, plain, then accented. To
      make this work as expected, before emitting second event, JDK requests text
      component to select previously entered character, so that accented character
      would overwrite it. This logic (implemented in selectPreviousGlyph method of
      sun.lwawt.macosx.CInputMethod class) works only for java.awt.TextComponent
      and javax.swing.text.JTextComponent descendants - there's an explicit
      'instanceof' check in the code. This makes it impossible for custom text
      input components, subclassing JComponent directly, to support the mentioned
      input method.

            anashaty Anton Nashatyrev (Inactive)
            shadowbug Shadow Bug
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: