Java Doc for InputMethodRequests.java in  » 6.0-JDK-Modules » j2me » java » awt » im » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » java.awt.im 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.awt.im.InputMethodRequests

InputMethodRequests
public interface InputMethodRequests (Code)
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:

  • on-the-spot input, where the composed text is displayed as part of the text component's text body.
  • below-the-spot input, where the composed text is displayed in a separate composition window just below the insertion point where the text will be inserted when it is committed. Note that, if text is selected within the component's text body, this text will be replaced by the committed text upon commitment; therefore it is not considered part of the context that the text is input into.

See Also:   java.awt.Component.getInputMethodRequests
See Also:   java.awt.event.InputMethodListener
version:
   1.20, 06/14/04
author:
   JavaSoft Asia/Pacific
since:
   1.2




Method Summary
 AttributedCharacterIteratorcancelLatestCommittedText(Attribute[] attributes)
     Gets the latest committed text from the text editing component and removes it from the component's text body. This is used for the "Undo Commit" feature in some input methods, where the committed text reverts to its previous composed state.
 AttributedCharacterIteratorgetCommittedText(int beginIndex, int endIndex, Attribute[] attributes)
     Gets an iterator providing access to the entire text and attributes contained in the text editing component except for uncommitted text.
 intgetCommittedTextLength()
     Gets the length of the entire text contained in the text editing component except for uncommitted (composed) text.
 intgetInsertPositionOffset()
     Gets the offset of the insert position in the committed text contained in the text editing component.
 TextHitInfogetLocationOffset(int x, int y)
     Gets the offset within the composed text for the specified absolute x and y coordinates on the screen.
 AttributedCharacterIteratorgetSelectedText(Attribute[] attributes)
     Gets the currently selected text from the text editing component. This may be used for a variety of purposes. One of them is the "Reconvert" feature in some input methods. In this case, the input method will typically send an input method event to replace the selected text with composed text.
 RectanglegetTextLocation(TextHitInfo offset)
     Gets the location of a specified offset in the current composed text, or of the selection in committed text. This information is, for example, used to position the candidate window near the composed text, or a composition window near the location where committed text will be inserted.

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.




Method Detail
cancelLatestCommittedText
AttributedCharacterIterator cancelLatestCommittedText(Attribute[] attributes)(Code)
Gets the latest committed text from the text editing component and removes it from the component's text body. This is used for the "Undo Commit" feature in some input methods, where the committed text reverts to its previous composed state. The composed text will be sent to the component using an InputMethodEvent.

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.
Parameters:
  attributes - a list of attributes that the input method isinterested in the latest committed text, or null when the "Undo Commit"feature is not supported




getCommittedText
AttributedCharacterIterator getCommittedText(int beginIndex, int endIndex, Attribute[] attributes)(Code)
Gets an iterator providing access to the entire text and attributes contained in the text editing component except for uncommitted text. Uncommitted (composed) text should be ignored for index calculations and should not be made accessible through the iterator.

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.
Parameters:
  beginIndex - the index of the first character
Parameters:
  endIndex - the index of the character following the last character
Parameters:
  attributes - a list of attributes that the input method isinterested in an iterator providing access to the text and its attributes




getCommittedTextLength
int getCommittedTextLength()(Code)
Gets the length of the entire text contained in the text editing component except for uncommitted (composed) text. the length of the text except for uncommitted text



getInsertPositionOffset
int getInsertPositionOffset()(Code)
Gets the offset of the insert position in the committed text contained in the text editing component. This is the offset at which characters entered through an input method are inserted. This information is used by an input method, for example, to examine the text surrounding the insert position. the offset of the insert position



getLocationOffset
TextHitInfo getLocationOffset(int x, int y)(Code)
Gets the offset within the composed text for the specified absolute x and y coordinates on the screen. This information is used, for example to handle mouse clicks and the mouse cursor. The offset is relative to the composed text, so offset 0 indicates the beginning of the composed text.

Return null if the location is outside the area occupied by the composed text.
Parameters:
  x - the absolute x coordinate on screen
Parameters:
  y - the absolute y coordinate on screen a text hit info describing the offset in the composed text.




getSelectedText
AttributedCharacterIterator getSelectedText(Attribute[] attributes)(Code)
Gets the currently selected text from the text editing component. This may be used for a variety of purposes. One of them is the "Reconvert" feature in some input methods. In this case, the input method will typically send an input method event to replace the selected text with composed text. Depending on the input method's capabilities, this may be the original composed text for the selected text, the latest composed text entered anywhere in the text, or a version of the text that's converted back from the selected text.

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.
Parameters:
  attributes - a list of attributes that the input method isinterested in the currently selected text




getTextLocation
Rectangle getTextLocation(TextHitInfo offset)(Code)
Gets the location of a specified offset in the current composed text, or of the selection in committed text. This information is, for example, used to position the candidate window near the composed text, or a composition window near the location where committed text will be inserted.

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.
Parameters:
  offset - the offset within the composed text, if there is composedtext; null otherwise a rectangle representing the screen location of the offset




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.