Example usage for java.awt.font TextAttribute INPUT_METHOD_HIGHLIGHT

List of usage examples for java.awt.font TextAttribute INPUT_METHOD_HIGHLIGHT

Introduction

In this page you can find the example usage for java.awt.font TextAttribute INPUT_METHOD_HIGHLIGHT.

Prototype

TextAttribute INPUT_METHOD_HIGHLIGHT

To view the source code for java.awt.font TextAttribute INPUT_METHOD_HIGHLIGHT.

Click Source Link

Document

Attribute key for input method highlight styles.

Usage

From source file:CodePointInputMethod.java

/**
 * Send the composed text to the client.
 *///from   w  w  w .  ja  va2s .  c om
private void sendComposedText() {
    AttributedString as = new AttributedString(buffer.toString());
    as.addAttribute(TextAttribute.INPUT_METHOD_HIGHLIGHT, InputMethodHighlight.SELECTED_RAW_TEXT_HIGHLIGHT);
    context.dispatchInputMethodEvent(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED, as.getIterator(), 0,
            TextHitInfo.leading(insertionPoint), null);
}