Java Doc for InputMode.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » chameleon » input » 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 » com.sun.midp.chameleon.input 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.midp.chameleon.input.InputMode

All known Subclasses:   com.sun.midp.chameleon.input.BasicInputMode,  com.sun.midp.chameleon.input.KeyboardInputMode,  com.sun.midp.chameleon.input.SymbolInputMode,  com.sun.midp.chameleon.input.NativeInputMode,  com.sun.midp.chameleon.input.PredictiveTextInputMode,
InputMode
public interface InputMode (Code)
An interface to a text input mode, such as alphanumeric, numeric, etc. Before sending key input to any InputMode, it should be verified that it supports the input constraints of the target text component. This is done by verifying that the input constraints of the text component (as defined in the MIDP specification for TextField) are supported by this InputMode by calling its supportsConstraints() method. The display name of this InputMode is returned by the getName() method. This value should be a locale appropriate value and suitable for displaying on the screen, such as an option on the device's system menu. The remaining methods represent a simple state machine with the following characteristics: To begin an input session, the first call MUST be beginInput(). This establishes an input session with this InputMode and allows the InputMode to perform any session initialization needed. The parameter to beginInput() is the InputModeMediator for the input session. The InputModeMediator is a callback mechanism for the InputMode to automatically commit pending input as well as end the input session. Subsequent key input is passed to the InputMode via the processKey() method. This method returns a String element. The returned String represents the best possible input value based on the total key input during the input session. For example, for an AlphaNumeric InputMode, the pending input will only ever be a single String, representing the character that corresponds to the last key entered. A 'null' return value from processKey() is an indication that this InputMode did not process the key at all, and it may need to be processed by other elements of the system. For a predictive text InputMode such as T9, there could be several possible matches. The return value from processKey() in this instance will be what the system believes to be the best possible match. The return value of the hasMoreMatches() method will indicate whether the InputMode has more than one possible match to the given input. The matches can then be retrieved using the getNextMatch() method. Key processing should be considered complete after the call to the InputMode's endInput() method. At this point, the InputMode should consider the reference to the TextInputMediator passed to its beginInput() method to be no longer valid. The InputMode may itself at any time commit pending input by calling the InputModeMediator's commitInput() method. The InputMode may also end the input session by calling the inputModeCompleted() method. Calling this method will result in a subsequent call to this InputMode's endInput() method. A typical call exchange with an InputMode could go as follows: InputMode im = ...; im.beginInput(inputModeHandler); int res = im.processKey([key code for 4]); if (pendingInput == null) { // The InputMode could not process the key code } else { // Present the pendingInput value to the user as the // best possible match ... while (im.hasMoreMatches()) { pendingInput = im.getNextMatch(); // Present the pendingInput value to the user as // the best possible match } } im.endInput();


Field Summary
final public static  intCAPS_OFF
     a sub-inputMode which may be supported by an InputMode.
final public static  intCAPS_ON
     a sub-inputMode which may be supported by an InputMode.
final public static  intCAPS_SENTENCE
     a sub-inputMode which may be supported by an InputMode.
final public static  intKEYCODE_INVISIBLE
    
final public static  intKEYCODE_NONE
     The key code is not handled by the input mode.
final public static  intMAX_MATCHES
    


Method Summary
public  voidbeginInput(InputModeMediator mediator, String inputSubset, int constraints)
     This method will be called before any input keys are passed to this InputMode to allow the InputMode to perform any needed initialization.
public  voidendInput()
     Mark the end of this InputMode's processing.
public  StringgetCommandName()
    
public  DisplayablegetDisplayable()
     Gets displayable for particular input method.
public  boolean[][]getIsConstraintsMap()
     Returns the map specifying this input mode is proper one for the particular pair of input subset and constraint.
public  String[]getMatchList()
    
public  StringgetName()
     Returns the display name which will represent this InputMode to the user, such as in a selection list or the softbutton bar.
public  StringgetNextMatch()
     Return the next possible match for the key input processed thus far by this InputMode.
public  chargetPendingChar()
     return the pending char used to bypass the asynchronous commit mechanism e.g.
public  booleanhasDisplayable()
    
public  booleanhasMoreMatches()
     True, if after processing a key, there is more than one possible match to the input.
public  intprocessKey(int keyCode, boolean longPress)
     Process the given key code as input.
public  booleansupportsConstraints(int constraints)
     This method is called to determine if this InputMode supports the given text input constraints.

Field Detail
CAPS_OFF
final public static int CAPS_OFF(Code)
a sub-inputMode which may be supported by an InputMode. all letters are lowercase



CAPS_ON
final public static int CAPS_ON(Code)
a sub-inputMode which may be supported by an InputMode. all letters are uppercase



CAPS_SENTENCE
final public static int CAPS_SENTENCE(Code)
a sub-inputMode which may be supported by an InputMode. the first letter is capitalized, the rest of the letters are lowercase



KEYCODE_INVISIBLE
final public static int KEYCODE_INVISIBLE(Code)
The key code does not mean to be displayed



KEYCODE_NONE
final public static int KEYCODE_NONE(Code)
The key code is not handled by the input mode. Most likely it is handled by the text component



MAX_MATCHES
final public static int MAX_MATCHES(Code)
The limitation for the number of matches





Method Detail
beginInput
public void beginInput(InputModeMediator mediator, String inputSubset, int constraints) throws IllegalStateException(Code)
This method will be called before any input keys are passed to this InputMode to allow the InputMode to perform any needed initialization. A reference to the InputModeMediator which is currently managing the relationship between this InputMode and the input session is passed in. This reference can be used by this InputMode to commit text input as well as end the input session with this InputMode. The reference is only valid until this InputMode's endInput() method is called.
Parameters:
  constraints - text input constraints. The semantics of the constraints value are defined in the TextField API.
Parameters:
  mediator - the InputModeMediator which is negotiating therelationship between this InputMode and the input session
Parameters:
  inputSubset - current input subset



endInput
public void endInput() throws IllegalStateException(Code)
Mark the end of this InputMode's processing. The only possible call to this InputMode after a call to endInput() is a call to beginInput() to begin a new input session.



getCommandName
public String getCommandName()(Code)
Returns the command name which will represent this InputMode in the input menu the locale-appropriate name to represent this InputModeto the user



getDisplayable
public Displayable getDisplayable()(Code)
Gets displayable for particular input method. If the input method has no specific displayable representation returns null. displayable



getIsConstraintsMap
public boolean[][] getIsConstraintsMap()(Code)
Returns the map specifying this input mode is proper one for the particular pair of input subset and constraint. The form of the map is |ANY|EMAILADDR|NUMERIC|PHONENUMBER|URL|DECIMAL| --------------------------------------------------------------------- IS_FULLWIDTH_DIGITS |t|f| t|f | t|f | t|f |t|f| t|f | IS_FULLWIDTH_LATIN |t|f| t|f | t|f | t|f |t|f| t|f | IS_HALFWIDTH_KATAKANA |t|f| t|f | t|f | t|f |t|f| t|f | IS_HANJA |t|f| t|f | t|f | t|f |t|f| t|f | IS_KANJI |t|f| t|f | t|f | t|f |t|f| t|f | IS_LATIN |t|f| t|f | t|f | t|f |t|f| t|f | IS_LATIN_DIGITS |t|f| t|f | t|f | t|f |t|f| t|f | IS_SIMPLIFIED_HANZI |t|f| t|f | t|f | t|f |t|f| t|f | IS_TRADITIONAL_HANZI |t|f| t|f | t|f | t|f |t|f| t|f | MIDP_UPPERCASE_LATIN |t|f| t|f | t|f | t|f |t|f| t|f | MIDP_LOWERCASE_LATIN |t|f| t|f | t|f | t|f |t|f| t|f | NULL |t|f| t|f | t|f | t|f |t|f| t|f | input subset x constraint map



getMatchList
public String[] getMatchList()(Code)
Gets the possible string matches returns the set of options.



getName
public String getName()(Code)
Returns the display name which will represent this InputMode to the user, such as in a selection list or the softbutton bar. the locale-appropriate name to represent this InputModeto the user



getNextMatch
public String getNextMatch()(Code)
Return the next possible match for the key input processed thus far by this InputMode. A call to this method should be preceeded by a check of hasMoreMatches(). If the InputMode has more available matches for the given input, this method will return them one by one. a String representing the next available match to the key input thus far, or 'null' if no pending input is available



getPendingChar
public char getPendingChar()(Code)
return the pending char used to bypass the asynchronous commit mechanism e.g. to immediately commit a char before moving the cursor return the pending char



hasDisplayable
public boolean hasDisplayable()(Code)
Returns true if input mode is using its own displayable, false ifinput mode does not require the speial displayable for its representation true if input mode is using its own displayable, otherwise false



hasMoreMatches
public boolean hasMoreMatches()(Code)
True, if after processing a key, there is more than one possible match to the input. If this method returns true, the getNextMatch() method can be called to return the value. true if after processing a key, there is more than the onepossible match to the given input



processKey
public int processKey(int keyCode, boolean longPress) throws IllegalStateException(Code)
Process the given key code as input. This method will return true if the key was processed successfully, false otherwise.
Parameters:
  keyCode - the keycode of the key which was input
Parameters:
  longPress - return true if it's long key press otherwise false the key code if the key has been committed for the input, orKEYCODE_NONE if the key has not been habdled by the input mode, orKEYCODE_INVISIBLE if the key has been handled by the input mode butthis key has not been displayed



supportsConstraints
public boolean supportsConstraints(int constraints)(Code)
This method is called to determine if this InputMode supports the given text input constraints. The semantics of the constraints value are defined in the javax.microedition.lcdui.TextField API. If this InputMode returns false, this InputMode must not be used to process key input for the selected text component.
Parameters:
  constraints - text input constraints. The semantics of the constraints value are defined in the TextField API. true if this InputMode supports the given text componentconstraints, as defined in the MIDP TextField API



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