Example usage for java.awt.im InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT

List of usage examples for java.awt.im InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT

Introduction

In this page you can find the example usage for java.awt.im InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT.

Prototype

InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT

To view the source code for java.awt.im InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT.

Click Source Link

Document

Constant for the default highlight for selected raw text.

Usage

From source file:CodePointInputMethod.java

/**
 * Send the composed text to the client.
 *///  w  ww.j  a v  a  2 s . c  o m
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);
}