Implements an integrated text input user interface.
This class is an active client of the input method framework, that is,
actively uses its APIs to accomplish integration.
This class directly implements the two client interfaces of the input method
framework, InputMethodListener and InputMethodRequests.
This is not required. Especially in cases where the public
interface matters (such as in a class library), it may be more
appropriate to hide the implementations of these two interfaces
in separate classes.
getCommittedText(int beginIndex,
int endIndex,
AttributedCharacterIterator.Attribute[] attributes)
Gets an iterator providing access to the entire text and attributes
contained in the text editing component except for uncommitted
text.
Returns a text hit info indicating the current caret (insertion point).
This override returns the caret provided by the input method while
there is composed text; otherwise it returns a caret at the end
of the committed text. The caret provided by the input method may be null.
Handles changes to the text entered through an input method.
Committed text contained in the event is appended to the
committed text of the text component. Composed text contained
in the event replaces any existing composed text in the text
component.
The caret defined in the event is saved and will
be returned by getCaret if there is composed text. The
component is redrawn.
In this simple component, we only
keep input method highlight attributes. Smarter components may want to
keep language, reading, input method segment, and other
attributes as well.
Handles changes to the caret within composed text.
The caret defined in the event is saved and will
be returned by getCaret if there is composed text. The
component is redrawn.
Gets the offset of the insert position in the committed text contained
in the text editing component. In this simple component, that's always
at the end of the committed text.
Gets the currently selected text from the text editing component.
Since this simple text component doesn't support selections, this is
always an iterator over empty text.
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, California, 94303, U.S.A. All Rights Reserved.