Class TextInputConfig
Immutable configuration handed to the platform when a TextInputClient binds to the low level text
input source (see com.codename1.impl.CodenameOneImplementation#startTextInput). It tells the
platform which soft keyboard flavor to present and how aggressive autocorrect / autocapitalization
should be. A source editor typically disables autocorrect and autocapitalization so it does not
mangle code, whereas a prose editor leaves them on.
The constraint constants mirror the TextArea constraint bits so the same keyboard mapping the
framework already uses for native fields applies here.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe action label shown on the keyboard's return key: a plain newline / carriage return.static final intThe action label shown on the keyboard's return key: a "done" affordance that finishes editing.static final intThe action label shown on the keyboard's return key: a "next" affordance moving to the next field.static final intThe action label shown on the keyboard's return key: a "search" affordance.static final intThe action label shown on the keyboard's return key: a "send" affordance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the return key action type, one of theACTION_*constants.intReturns theTextAreastyle constraint bits describing the keyboard type.booleanTrue when the platform should auto capitalize.booleanTrue when the platform should apply autocorrect / predictive text.booleanTrue when the editor accepts multiple lines (the return key inserts a newline).setActionType(int actionType) Sets the return key action type, one of theACTION_*constants.setAutoCapitalize(boolean autoCapitalize) Enables or disables platform auto capitalization.setAutoCorrect(boolean autoCorrect) Enables or disables platform autocorrect / predictive text.setConstraint(int constraint) Sets theTextAreastyle constraint bits describing the keyboard type.setMultiline(boolean multiline) Sets whether the editor accepts multiple lines.
-
Field Details
-
ACTION_DEFAULT
public static final int ACTION_DEFAULTThe action label shown on the keyboard's return key: a plain newline / carriage return.- See Also:
-
ACTION_DONE
public static final int ACTION_DONEThe action label shown on the keyboard's return key: a "done" affordance that finishes editing.- See Also:
-
ACTION_NEXT
public static final int ACTION_NEXTThe action label shown on the keyboard's return key: a "next" affordance moving to the next field.- See Also:
-
ACTION_SEARCH
public static final int ACTION_SEARCHThe action label shown on the keyboard's return key: a "search" affordance.- See Also:
-
ACTION_SEND
public static final int ACTION_SENDThe action label shown on the keyboard's return key: a "send" affordance.- See Also:
-
-
Constructor Details
-
TextInputConfig
public TextInputConfig()
-
-
Method Details
-
getConstraint
public int getConstraint()Returns theTextAreastyle constraint bits describing the keyboard type. -
setConstraint
Sets the
TextAreastyle constraint bits describing the keyboard type.Parameters
constraint: one of theTextAreaconstraint constants
Returns this instance for chaining.
-
isAutoCorrect
public boolean isAutoCorrect()True when the platform should apply autocorrect / predictive text. -
setAutoCorrect
Enables or disables platform autocorrect / predictive text. Disable this for source code.
Returns this instance for chaining.
-
isAutoCapitalize
public boolean isAutoCapitalize()True when the platform should auto capitalize. -
setAutoCapitalize
Enables or disables platform auto capitalization. Disable this for source code.
Returns this instance for chaining.
-
isMultiline
public boolean isMultiline()True when the editor accepts multiple lines (the return key inserts a newline). -
setMultiline
Sets whether the editor accepts multiple lines.
Returns this instance for chaining.
-
getActionType
public int getActionType()Returns the return key action type, one of theACTION_*constants. -
setActionType
Sets the return key action type, one of the
ACTION_*constants.Returns this instance for chaining.
-