public interface InputMethodRequests
InputMethodRequests defines the requests that a text editing component has to handle in order to work with input methods. The component can implement this interface itself or use a separate object that implements it. The object implementing this interface must be returned from the component's getInputMethodRequests method.
The text editing component also has to provide an input method event listener.
The interface is designed to support one of two input user interfaces:
Component.getInputMethodRequests(),
InputMethodListener| Method Summary | |
|---|---|
AttributedCharacterIterator |
cancelLatestCommittedText(AttributedCharacterIterator.Attribute[] attributes)
Gets the latest committed text from the text editing component and removes it from the component's text body. |
AttributedCharacterIterator |
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. |
int |
getCommittedTextLength()
Gets the length of the entire text contained in the text editing component except for uncommitted (composed) text. |
int |
getInsertPositionOffset()
Gets the offset of the insert position in the committed text contained in the text editing component. |
TextHitInfo |
getLocationOffset(int x,
int y)
Gets the offset within the composed text for the specified absolute x and y coordinates on the screen. |
AttributedCharacterIterator |
getSelectedText(AttributedCharacterIterator.Attribute[] attributes)
Gets the currently selected text from the text editing component. |
Rectangle |
getTextLocation(TextHitInfo offset)
Gets the location of a specified offset in the current composed text, or of the selection in committed text. |
| Method Detail |
|---|
Rectangle getTextLocation(TextHitInfo offset)
If the component has composed text (because the most recent InputMethodEvent sent to it contained composed text), then the offset is relative to the composed text - offset 0 indicates the first character in the composed text. The location returned should be for this character.
If the component doesn't have composed text, the offset should be ignored, and the location returned should reflect the beginning (in line direction) of the highlight in the last line containing selected text. For example, for horizontal left-to-right text (such as English), the location to the left of the left-most character on the last line containing selected text is returned. For vertical top-to-bottom text, with lines proceding from right to left, the location to the top of the left-most line containing selected text is returned.
The location is represented as a 0-thickness caret, that is, it has 0 width if the text is drawn horizontally, and 0 height if the text is drawn vertically. Other text orientations need to be mapped to horizontal or vertical orientation. The rectangle uses absolute screen coordinates.
offset - the offset within the composed text, if there is composed
text; null otherwise
TextHitInfo getLocationOffset(int x, int y)
Return null if the location is outside the area occupied by the composed text.
x - the absolute x coordinate on screeny - the absolute y coordinate on screen
int getInsertPositionOffset()
AttributedCharacterIterator getCommittedText(int beginIndex, int endIndex, AttributedCharacterIterator.Attribute[] attributes)
The input method may provide a list of attributes that it is interested in. In that case, information about other attributes that the implementor may have need not be made accessible through the iterator. If the list is null, all available attribute information should be made accessible.
beginIndex - the index of the first characterendIndex - the index of the character following the last characterattributes - a list of attributes that the input method is
interested in
int getCommittedTextLength()
AttributedCharacterIterator cancelLatestCommittedText(AttributedCharacterIterator.Attribute[] attributes)
Generally, this feature should only be supported immediately after the text was committed, not after the user performed other operations on the text. When the feature is not supported, return null.
The input method may provide a list of attributes that it is interested in. In that case, information about other attributes that the implementor may have need not be made accessible through the iterator. If the list is null, all available attribute information should be made accessible.
attributes - a list of attributes that the input method is
interested in
AttributedCharacterIterator getSelectedText(AttributedCharacterIterator.Attribute[] attributes)
The input method may provide a list of attributes that it is interested in. In that case, information about other attributes that the implementor may have need not be made accessible through the iterator. If the list is null, all available attribute information should be made accessible.
attributes - a list of attributes that the input method is
interested in
Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
7 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)