processing.app.syntax.im

## Class CompositionTextManager

- Object
- - CompositionTextManager

-     public class CompositionTextManager
      extends Object

  This class Manage texts from input method by begin-process-end steps. First, if a user start inputing via input method, beginCompositionText is called from InputMethodSupport. Second, the user continues from input method, processCompositionText is called and reflect user inputs to text area. Finally the user try to commit text, endCompositionText is called.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `COMPOSING_UNDERBAR_HEIGHT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositionTextManager(JEditTextArea textArea)` Create text manager class with a textarea.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `beginCompositionText(AttributedCharacterIterator text, int committed_count)` Called when a user begins input from input method.
    `void` | `endCompositionText(AttributedCharacterIterator text, int committed_count)` Called when a user fixed text from input method or delete all composition text.
    `AttributedCharacterIterator` | `getCommittedText(int beginIndex, int endIndex)`
    `int` | `getInsertPositionOffset()`
    `boolean` | `getIsInputProcess()` Get this text manager is whether in input process or not.
    `Rectangle` | `getTextLocation()`
    `void` | `insertFullWidthSpace()` Insert full width space
    `void` | `processCompositionText(AttributedCharacterIterator text, int committed_count)` Called when a user processing input characters and select candidates from input method.

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### COMPOSING_UNDERBAR_HEIGHT

          public static final int COMPOSING_UNDERBAR_HEIGHT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CompositionTextManager

          public CompositionTextManager(JEditTextArea textArea)

      Create text manager class with a textarea.
      Parameters:
        `textArea` - texarea component for PDE.

  - ### Method Detail

    - #### getIsInputProcess

          public boolean getIsInputProcess()

      Get this text manager is whether in input process or not.

    - #### insertFullWidthSpace

          public void insertFullWidthSpace()

      Insert full width space

    - #### beginCompositionText

          public void beginCompositionText(AttributedCharacterIterator text,
                                           int committed_count)

      Called when a user begins input from input method. This method initializes text manager.
      Parameters:
        `text` - Text from InputMethodEvent.
        `commited_count` - Numbers of committed characters in text.

    - #### processCompositionText

          public void processCompositionText(AttributedCharacterIterator text,
                                             int committed_count)

      Called when a user processing input characters and select candidates from input method.
      Parameters:
        `text` - Text from InputMethodEvent.
        `commited_count` - Numbers of committed characters in text.

    - #### endCompositionText

          public void endCompositionText(AttributedCharacterIterator text,
                                         int committed_count)

      Called when a user fixed text from input method or delete all composition text. This method resets CompositionTextPainter.
      Parameters:
        `text` - Text from InputMethodEvent.
        `commited_count` - Numbers of committed characters in text.

    - #### getTextLocation

          public Rectangle getTextLocation()

    - #### getCommittedText

          public AttributedCharacterIterator getCommittedText(int beginIndex,
                                                              int endIndex)

    - #### getInsertPositionOffset

          public int getInsertPositionOffset()