Class TextField
- All Implemented Interfaces:
Animation, Editable, ActionSource, StyleListener, TextHolder
- Direct Known Subclasses:
AutoCompleteTextField
A specialized version of com.codename1.ui.TextArea with some minor deviations from the original
specifically:
-
Blinking cursor is rendered on
TextFieldonly -
com.codename1.ui.events.DataChangeListeneris only available inTextField. This is crucial for character by character input event tracking -
com.codename1.ui.TextField#setDoneListener(com.codename1.ui.events.ActionListener)is only available inTextField -
Different UIID's ("
TextField" vs. "TextArea")
The demo code below shows simple input using text fields:
TableLayout tl;
int spanButton = 2;
if(Display.getInstance().isTablet()) {
tl = new TableLayout(7, 2);
} else {
tl = new TableLayout(14, 1);
spanButton = 1;
}
tl.setGrowHorizontally(true);
hi.setLayout(tl);
TextField firstName = new TextField("", "First Name", 20, TextArea.ANY);
TextField surname = new TextField("", "Surname", 20, TextArea.ANY);
TextField email = new TextField("", "E-Mail", 20, TextArea.EMAILADDR);
TextField url = new TextField("", "URL", 20, TextArea.URL);
TextField phone = new TextField("", "Phone", 20, TextArea.PHONENUMBER);
TextField num1 = new TextField("", "1234", 4, TextArea.NUMERIC);
TextField num2 = new TextField("", "1234", 4, TextArea.NUMERIC);
TextField num3 = new TextField("", "1234", 4, TextArea.NUMERIC);
TextField num4 = new TextField("", "1234", 4, TextArea.NUMERIC);
Button submit = new Button("Submit");
TableLayout.Constraint cn = tl.createConstraint();
cn.setHorizontalSpan(spanButton);
cn.setHorizontalAlign(Component.RIGHT);
hi.add("First Name").add(firstName).
add("Surname").add(surname).
add("E-Mail").add(email).
add("URL").add(url).
add("Phone").add(phone).
add("Credit Card").
add(GridLayout.encloseIn(4, num1, num2, num3, num4)).
add(cn, submit);
The following code demonstrates a more advanced search widget where the data is narrowed as we type
directly into the title area search. Notice that the TextField and its hint are styled to look like the title.
Toolbar.setGlobalToolbar(true);
Form hi = new Form("Toolbar", BoxLayout.y());
Style s = UIManager.getInstance().getComponentStyle("Title");
TextField searchField = new TextField("", "Toolbar Search");
searchField.getHintLabel().setUIID("Title");
searchField.setUIID("Title");
searchField.getAllStyles().setAlignment(Component.LEFT);
hi.getToolbar().setTitleComponent(searchField);
FontImage searchIcon = FontImage.createMaterial(FontImage.MATERIAL_SEARCH, s);
hi.getToolbar().addCommandToRightBar("", searchIcon, e -> searchField.startEditingAsync());
hi.addAll(
new Label("A Game of Thrones"),
new Label("A Clash Of Kings"),
new Label("A Storm Of Swords"),
new Label("A Feast For Crows"),
new Label("A Dance With Dragons"));
searchField.addDataChangedListener((type, index) -> {
String text = searchField.getText().toLowerCase();
for (Component cmp : hi.getContentPane()) {
String value = ((Label) cmp).getText().toLowerCase();
boolean show = text.length() == 0 || value.indexOf(text) > -1;
cmp.setHidden(!show);
cmp.setVisible(show);
}
hi.getContentPane().animateLayout(250);
});
-
Field Summary
Fields inherited from class TextArea
ANY, DECIMAL, EMAILADDR, INITIAL_CAPS_SENTENCE, INITIAL_CAPS_WORD, NON_PREDICTIVE, NUMERIC, PASSWORD, PHONENUMBER, SENSITIVE, UNEDITABLE, UPPERCASE, URL, USERNAMEModifier and TypeFieldDescriptionstatic final intAllows any type of input into a text field, if a constraint is not supported by an underlying implementation this will be the default.static final intThe user is allowed to enter numeric values with optional decimal fractions, for example "-123", "0.123", or ".5".static final intThe user is allowed to enter an e-mail address.static final intThis flag is a hint to the implementation that during text editing, the initial letter of each sentence should be capitalized.static final intThis flag is a hint to the implementation that during text editing, the initial letter of each word should be capitalized.static final intIndicates that the text entered does not consist of words that are likely to be found in dictionaries typically used by predictive input schemes.static final intThe user is allowed to enter only an integer value.static final intIndicates that the text entered is confidential data that should be obscured whenever possible.static final intThe user is allowed to enter a phone number.static final intIndicates that the text entered is sensitive data that the implementation must never store into a dictionary or table for use in predictive, auto-completing, or other accelerated input schemes.static final intIndicates that editing is currently disallowed.static final intThis flag is a hint to the implementation that the text in this field should be upper casestatic final intThe user is allowed to enter a URL.static final intThis flag is a hint to the implementation that this field contains a username.Fields inherited from class Component
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSORModifier and TypeFieldDescriptionstatic final intAlignment to the baseline constraintstatic final intBox-orientation constant used to specify the bottom of a box.static final intBaseline resize behavior constant used to properly align components.static final intBaseline resize behavior constant used to properly align components.static final intBaseline resize behavior constant used to properly align components.static final intBaseline resize behavior constant used to properly align components.static final intIndicates a Component center alignmentstatic final intThe crosshair cursor type.static final intThe default cursorstatic final intUsed by getDragRegionStatus to indicate immediate dragabilitystatic final intUsed by getDragRegionStatus to indicate immediate dragabilitystatic final intUsed by getDragRegionStatus to indicate immediate dragabilitystatic final intUsed by getDragRegionStatus to indicate likely dragabilitystatic final intUsed by getDragRegionStatus to indicate likely dragabilitystatic final intUsed by getDragRegionStatus to indicate likely dragabilitystatic final intUsed by getDragRegionStatus to indicate no dragabilitystatic final intUsed by getDragRegionStatus to indicate limited dragabilitystatic final intUsed by getDragRegionStatus to indicate limited dragabilitystatic final intUsed by getDragRegionStatus to indicate limited dragabilitystatic final intThe east-resize cursor type.static final intThe hand cursor type.static final intBox-orientation constant used to specify the left side of a box.static final intThe move cursor type.static final intThe north-resize cursor type.static final intThe north-east-resize cursor type.static final intThe north-west-resize cursor type.static final intBox-orientation constant used to specify the right side of a box.static final intThe south-resize cursor type.static final intThe south-east-resize cursor type.static final intThe south-west-resize cursor type.static final intThe text cursor type.static final intBox-orientation constant used to specify the top of a box.static final intThe west-resize cursor type.static final intThe wait cursor type. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorTextField(int columns) Construct a text field with space reserved for columnsConstruct text fieldConstruct text fieldConstruct text field with a hintConstruct text field with a hint, columns and constraint values -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddInputMode(String name, Hashtable values, boolean firstUpcase) Adds a new inputmode hashtable with the given name and set of valuesbooleananimate()Allows the animation to reduce "repaint" calls when it returns false.protected DimensionCalculates the preferred size based on component content.protected TextSelection.SpansCalculates the spans for the the given text selection.voidclear()Clears the text from the TextFieldprotected voidCommit the changes made to the text field as a complete edit operation.static TextAreacreate()Default factory methodstatic TextAreacreate(int columns) Construct text field/area depending on whether native in place editing is supportedstatic TextAreaConstruct text field/area depending on whether native in place editing is supportedstatic TextAreaConstruct text field/area depending on whether native in place editing is supportedprotected ContainerCreates a symbol table container used by the showSymbolDialog method.protected voidInvoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy.voidPerforms a backspace operationprotected voidWhen working in 3 softbutton mode "fire" key (center softbutton) is sent to this method in order to allow 3 button devices to work properly.protected chargetCharPerKeyCode(int pressCount, int keyCode, boolean longClick) Returns the character matching the given key code after the given amount of user pressesintThe amount of time in milliseconds it will take for a change to get committed into the field.intThe amount of time in milliseconds in which the cursor is invisibleintThe amount of time in milliseconds in which the cursor is visibleintReturns the position of the cursor char positionintReturns the position of the cursor char position in the current line.intReturns the position of the cursor line positionstatic intKey to change the input mode on the devicestatic String[]Returns the order in which input modes are toggled by defaultstatic intThe default key for poping open the symbol dialogReturns the currently selected input modeString[]Returns the order in which input modes are toggledprotected intThe amount of time considered as a "long click" causing the long click method to be invoked.protected StringReturns the input mode for the ong click modestatic char[]Returns the symbol table for the devicevoidThis method is responsible for adding a character into the field and is the focal point for all input.protected CommandinstallCommands(Command clear, Command t9) Installs the clear and t9 commands onto the parent form, this method can be overriden to provide device specific placement for these commandsprotected booleanisChangeInputMode(int keyCode) Indicates whether the key changes the current input modeprotected booleanisClearKey(int keyCode) Returns true if this is the clear key on the device, many devices don't contain a clear key and even in those that contain it this might be an issueprotected booleanReturns true if the cursor should cycle to the beginning of the text when the user navigates beyond the edge of the text and visa versa.protected booleanisEditingEndTrigger(int keyCode) Indicates whether the given key code should be ignored or should trigger cause editing to end.protected booleanisEditingTrigger(int keyCode) Indicates whether the given key code should be ignored or should trigger editing, by default fire or any numeric key should trigger editing implicitly.booleanIndicates whether text field input should scroll to the right side when no more room for the input is present.protected booleanisImmediateInputMode(String mode) Returns true if the given input mode should commit immediately or wait for the commit timeoutbooleanIndicates whether the left/right keys will trigger editing, this is true by default.booleanIndicates that this is the overwrite modebooleanReturns true if the text field is waiting for a commit on editingstatic booleanIndicates whether the text field should try to auto detect qwerty and switch the qwerty device flag implicitlystatic booleanThe default value for the qwerty flag so it doesn't need setting for every text field individually.booleanTrue is this is a qwerty device or a device that is currently in qwerty mode.booleanIndicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text fieldstatic booleanIndicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text fieldprotected booleanThis method allows a component to indicate that it is interested in an "implicit" select command to appear in the "fire" button when 3 softbuttons are defined in a device.protected booleanisSymbolDialogKey(int keyCode) Returns true if this keycode is the one mapping to the symbol dialog popupstatic booleanIndicates that native text input should be used in text field when in place editing is supported by the platformbooleanWhen set to true softkeys are used to enable delete functionalityvoidkeyPressed(int keyCode) If this Component is focused, the key pressed event will call this methodvoidkeyReleased(int keyCode) If this Component is focused, the key released event will call this methodvoidkeyRepeated(int keyCode) If this Component is focused, the key repeat event will call this method.protected voidlongKeyPress(int keyCode) If this Component is focused this method is invoked when the user presses and holds the keyvoidThis method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.voidpointerReleased(int x, int y) If this Component is focused, the pointer released event will call this methodprotected voidremoveCommands(Command clear, Command t9, Command originalClear) Removes the clear and t9 commands from the parent form, this method can be overriden to provide device specific placement for these commandsvoidsetAlignment(int align) Sets the Alignment of the TextArea to one of: CENTER, LEFT, RIGHTstatic voidsetClearText(String text) Set the text that should appear on the clear softkeyvoidsetCommitTimeout(int commitTimeout) The amount of time in milliseconds it will take for a change to get committed into the field.voidsetCursorBlinkTimeOff(int time) The amount of time in milliseconds in which the cursor is invisiblevoidsetCursorBlinkTimeOn(int time) The amount of time in milliseconds in which the cursor is visiblevoidsetCursorPosition(int pos) Sets the position of the cursor char positionstatic voidsetDefaultChangeInputModeKey(int k) Key to change the input mode on the devicestatic voidsetDefaultInputModeOrder(String[] order) Sets the order in which input modes are toggled by default and allows disabling/hiding an input modestatic voidsetDefaultSymbolDialogKey(int d) The default key for poping open the symbol dialogvoidsetEditable(boolean b) Sets this text area to be editable or readonlyvoidsetEnableInputScroll(boolean enableInputScroll) Indicates whether text field input should scroll to the right side when no more room for the input is present.voidsetInputMode(String inputMode) Sets the current selected input mode matching one of the existing input modesvoidsetInputModeOrder(String[] order) Sets the order in which input modes are toggled and allows disabling/hiding an input modevoidsetLeftAndRightEditingTrigger(boolean leftAndRightEditingTrigger) Indicates whether the left/right keys will trigger editing, this is true by default.voidsetOverwriteMode(boolean overwriteMode) Indicates that this is the overwrite modestatic voidsetQwertyAutoDetect(boolean v) Indicates whether the text field should try to auto detect qwerty and switch the qwerty device flag implicitlystatic voidsetQwertyDevice(boolean v) The default value for the qwerty flag so it doesn't need setting for every text field individually.voidsetQwertyInput(boolean qwerty) True is this is a qwerty device or a device that is currently in qwerty mode.voidsetReplaceMenu(boolean replaceMenu) Indicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text fieldstatic voidsetReplaceMenuDefault(boolean replaceMenu) Indicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text fieldstatic voidsetSymbolTable(char[] table) Sets the symbol table to show when the user clicks the symbol table keystatic voidSet the text that should appear on the T9 softkeyvoidSets the text within this text areastatic voidsetUseNativeTextInput(boolean aUseNativeTextInput) Indicates that native text input should be used in text field when in place editing is supported by the platformvoidsetUseSoftkeys(boolean useSoftkeys) When set to true softkeys are used to enable delete functionalityprotected voidInvoked to show the symbol dialog, this method can be overriden by subclasses to manipulate the symbol tablebooleanChecks if the candidate input is valid for this TextFieldMethods inherited from class TextArea
addActionListener, addCloseListener, addDataChangedListener, addDataChangeListener, autoDetectWidestChar, bindProperty, calcScrollSize, fireDataChanged, fireDoneEvent, fireDoneEvent, getAbsoluteAlignment, getActualRows, getAlignment, getAsDouble, getAsInt, getAsLong, getBindablePropertyNames, getBindablePropertyTypes, getBoundPropertyValue, getColumns, getConstraint, getDefaultValign, getDoneListener, getGrowLimit, getHint, getHintIcon, getHintLabel, getLines, getLinesToScroll, getMaxSize, getPreferredTabIndex, getRows, getRowsGap, getStyle, getText, getTextAt, getTextSelectionSupport, getUnsupportedChars, getVerticalAlignment, getWidestChar, initComponent, initLaf, isActAsLabel, isAutoDegradeMaxSize, isEditable, isEditing, isEndsWith3Points, isEnterKey, isGrowByContent, isScrollableY, isSingleLineTextArea, isTextSelectionEnabled, isUseStringWidth, pointerHover, pointerHoverReleased, preprocess, registerAsInputDevice, removeActionListener, removeCloseListener, removeDataChangedListener, removeDataChangeListener, setActAsLabel, setAutoDegradeMaxSize, setBoundPropertyValue, setColumns, setConstraint, setDefaultMaxSize, setDefaultValign, setDoneListener, setEndsWith3Points, setGrowByContent, setGrowLimit, setHint, setHint, setHintIcon, setLinesToScroll, setMaxSize, setRows, setRowsGap, setSingleLineTextArea, setTextSelectionEnabled, setUnsupportedChars, setUseStringWidth, setVerticalAlignment, setWidestChar, setWidth, shouldRenderComponentSelection, startEditing, startEditingAsync, stopEditing, stopEditing, unbindPropertyModifier and TypeMethodDescriptionvoidAdd an action listener which is invoked when the text area was modified not during modification.voidAdds a listener to be called with this TextArea is "closed".voidAdds a listener for data change events it will be invoked for every change made to the text field, notice most platforms will invoke only the DataChangedListener.CHANGED eventvoidAdds a listener for data change events it will be invoked for every change made to the text field, notice most platforms will invoke only the DataChangedListener.CHANGED eventstatic voidSearches the given string for the widest character using char width, this operation should only be performed once and it solves cases where a devices language might have a char bigger than 'W' that isn't consistently bigger.voidbindProperty(String prop, BindTarget target) Binds the given property name to the given bind targetprotected DimensionMethod that can be overriden to represent the actual size of the component when it differs from the desireable size for the viewportvoidfireDataChanged(int type, int index) Alert the TextField listeners the text has been changed on the TextFieldvoidFire the done event to done listenervoidfireDoneEvent(int keyEvent) intReturns the absolute alignment of the TextArea In RTL LEFT alignment is actually RIGHT, but this method returns the actual alignmentintReturns the number of actual rows in the text area taking into consideration growsByContentintReturns the alignment of the TextAreadoublegetAsDouble(double invalid) Convenience method for numeric text fields, returns the value as a number or invalid if the value in the text field isn't a numberintgetAsInt(int invalid) Convenience method for numeric text fields, returns the value as a number or invalid if the value in the text field isn't a numberlonggetAsLong(long invalid) Convenience method for numeric text fields, returns the value as a number or invalid if the value in the text field isn't a numberString[]Returns the names of the properties within this component that can be bound for persistence, the order of these names mean that the first one will be the first boundClass[]Returns the types of the properties that are bindable within this componentgetBoundPropertyValue(String prop) Allows the binding code to extract the value of the propertyintReturns the number of columns in the text areaintReturns the editing constraint valuestatic intIndicates the default vertical alignment for a text field.Gets the done listener of this TextField.intIndicates the maximum number of rows in a text area after it has grown, -1 indicates no limitgetHint()Returns the hint textReturns the hint iconReturns the hint label component that can be customized directlyintgetLines()Returns the number of text lines in the TextAreaintIndicates the number of lines to scroll with every scroll operationintReturns the maximum size for the text areaintGets the preferred tab index of this component.intgetRows()Returns the number of rows in the text areaintGets the num of pixels gap between the rowsgetStyle()Returns the current Component Style allowing code to draw the current component, you should normally use getUnselected/Pressed/DisabledStyle() and not this method since it will return different values based on component state.getText()Returns the text in the text areagetTextAt(int line) Returns the text in the given row of the text boxReturns text selection support object for this component.Unsupported characters is a string that contains characters that cause issues when rendering on some problematic fonts.intReturns the vertical alignment of the text field.static charIndicates the widest character in the alphabet, this is useful for detecting linebreaks internally.protected voidAllows subclasses to bind functionality that relies on fully initialized and "ready for action" component stateprotected voidThis method initializes the Component defaults constantsbooleanThis flag indicates that the text area should try to act as a label and try to fix more accurately within it's bounds this might make it slower as a resultstatic booleanIndicates whether a high value for default maxSize will be reduced to a lower value if the underlying platform throws an exception.booleanReturns true if this area is editablebooleanIndicates whether we are currently editing this text areabooleanIf the TextArea text is too long to fit the text to the widget this will add "..." at the last displayable row.protected booleanisEnterKey(int keyCode) Indicates the enter key to be used for editing the text area and by the text fieldbooleanIndicates that the text area should "grow" in height based on the content beyond the limits indicate by the rows variablebooleanIndicates whether the component should/could scroll on the Y axisbooleanIndicates whether this is a single line text area, in which case "growing" won't work as expected.booleanReturns true if text selection is enabled on this label.static booleanBy default text area uses charWidth since its much faster on some devices than string width.voidpointerHover(int[] x, int[] y) Invoked for devices where the pointer can hover without actually clicking the display.voidpointerHoverReleased(int[] x, int[] y) Invoked for devices where the pointer can hover without actually clicking the display.protected char[]preprocess(String text) Override this to modify the text for rendering in cases of invalid characters for display, this method allows the developer to replace such characters e.g.: replace "\t" with 4 spacesvoidRegisters this TextArea as the current input device for the current form.voidRemoves an action listenervoidRemoves close listener.voidRemoves the listener for data change eventsvoidRemoves the listener for data change eventsvoidsetActAsLabel(boolean actAsLabel) This flag indicates that the text area should try to act as a label and try to fix more accurately within it's bounds this might make it slower as a resultstatic voidsetAutoDegradeMaxSize(boolean value) Indicates whether a high value for default maxSize will be reduced to a lower value if the underlying platform throws an exception.voidsetBoundPropertyValue(String prop, Object value) Sets the value of a bound property within this component, notice that this method MUST NOT fire the property change event when invoked to prevent recursion!voidsetColumns(int columns) Sets the number of columns in the text areavoidsetConstraint(int constraint) Sets the constraint which provides a hint to the virtual keyboard input, notice this doesn't limit input type in any way!static voidsetDefaultMaxSize(int value) Sets the default limit for the native text box sizestatic voidsetDefaultValign(int aDefaultValign) Indicates the default vertical alignment for a text field.voidSets a Done listener on the TextField - notice this listener will be called only on supported platforms that supports done action on the keyboardvoidsetEndsWith3Points(boolean endsWith3Points) If the TextArea text is too long to fit the text to the widget this will add "..." at the last displayable row.voidsetGrowByContent(boolean growByContent) Indicates that the text area should "grow" in height based on the content beyond the limits indicate by the rows variablevoidsetGrowLimit(int growLimit) Indicates the maximum number of rows in a text area after it has grown, -1 indicates no limitvoidSets the TextArea hint text, the hint text is displayed on the TextArea When there is no text in the TextAreavoidSets the TextArea hint text and Icon, the hint text and icon are displayed on the TextArea when there is no text in the TextAreavoidsetHintIcon(Image icon) Sets the TextArea hint icon, the hint is displayed on the TextArea When there is no text in the TextAreavoidsetLinesToScroll(int linesToScroll) Indicates the number of lines to scroll with every scroll operationvoidsetMaxSize(int maxSize) Sets the maximum size of the text areavoidsetRows(int rows) Sets the number of rows in the text areavoidsetRowsGap(int rowsGap) The gap in pixels between rowsvoidsetSingleLineTextArea(boolean singleLineTextArea) Indicates whether this is a single line text area, in which case "growing" won't work as expected.voidsetTextSelectionEnabled(boolean enabled) Enables text selection on this TextArea.voidsetUnsupportedChars(String unsupportedChars) Unsupported characters is a string that contains characters that cause issues when rendering on some problematic fonts.static voidsetUseStringWidth(boolean aUseStringWidth) By default text area uses charWidth since its much faster on some devices than string width.voidsetVerticalAlignment(int valign) Sets the vertical alignment of the text field to one of: CENTER, TOP, BOTTOMstatic voidsetWidestChar(char widestC) Indicates the widest character in the alphabet, this is useful for detecting linebreaks internally.voidsetWidth(int width) Sets the Component width, this method is exposed for the purpose of external layout managers and should not be invoked directly.protected booleanSpecial case for text components, if they are editing they should always render the selected state A component can indicate whether it is interested in rendering it's selection explicitly, this defaults to true in non-touch UI's and false in touch UI's except for the case where a user clicks the screen.voidLaunches the text field editing, notice that calling this in a callSerially is generally considered good practicevoidLaunches the text field editing in a callserially callvoidStops text editing of this field if it is being editedvoidstopEditing(Runnable onFinish) Stops text editing of this field if it is being editedvoidunbindProperty(String prop, BindTarget target) Removes a bind target from the given property nameMethods inherited from class Component
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, announceForAccessibility, blocksSideSwipe, cancelRepaints, clearClientProperties, contains, containsOrOwns, createStyleAnimation, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, dragInitiated, drawDraggedImage, drop, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAccessibilityText, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBorder, getBottomGap, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getDragTransparency, getEditingDelegate, getGridPosX, getGridPosY, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredW, getPressedStyle, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getSideGap, getTabIndex, getTensileLength, getTooltip, getUIID, getUIManager, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initCustomStyle, initDisabledStyle, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEnabled, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollableX, isScrollVisible, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, laidOut, longPointerPress, onScrollX, onScrollY, onSetFocusable, paintBackground, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, paramString, parsePreferredSize, pinch, pinch, pinchReleased, pointerDragged, pointerDragged, pointerHoverPressed, pointerPressed, pointerPressed, pointerReleased, putClientProperty, refreshTheme, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setAccessibilityText, setAlwaysTensile, setBlockLead, setCellRenderer, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setEnabled, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setPropertyValue, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUIIDFinal, setUnselectedStyle, setVisible, setX, setY, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, showNativeOverlay, stripMarginAndPadding, styleChanged, toImage, toString, updateNativeOverlay, visibleBoundsContainsModifier and TypeMethodDescriptionvoidAdds a listener to the dragFinished eventvoidBroadcasts an event when dragging over a componentvoidBinds an action listener to drop events which are invoked when this component is dropped on a targetvoidRegisters interest in receiving callbacks for focus gained events, a focus event is invoked when the component accepts the focus.voidAdds a listener to the pointer eventvoidAdds a listener to the pointer eventvoidAdds a listener to the pointer eventvoidAdds a listener to the pointer eventvoidaddPullToRefresh(Runnable task) This method adds a refresh task to the Component, the task will be executed if the user has pulled the scroll beyond a certain height.voidRegisters interest in receiving callbacks for scroll gained events, a scroll event is invoked when the component is scrolled.voidAdds a listener to be notified when the state of this component is changed to and from initialized.voidManually announces text to native accessibility services, associating the announcement with this component when possible.final booleanA component that might need side swipe such as the slider could block it from being used for some other purpose when on top of said component.protected voidremove this component from the painting queuevoidClears all client properties from this Componentbooleancontains(int x, int y) Returns true if the given absolute coordinate is contained in the ComponentbooleancontainsOrOwns(int x, int y) Checks to see if this component either contains the given point, or if it owns the component that contains the given point.createStyleAnimation(String destUIID, int duration) Creates an animation that will transform the current component to the styling of the destination UIID when completed.protected voidAllows components to create a style of their own, this method cleans up state for the given styleprotected voidThis callback method indicates that a component drag has just entered this componentprotected voidThis callback method provides an indication for a drop target that a drag operation is exiting the bounds of this component and it should clear all relevant state if such state exists.protected voiddragFinished(int x, int y) Callback indicating that the drag has finished either via drop or by releasing the componentprotected booleandraggingOver(Component dragged, int x, int y) This method allows a component to indicate if it is a drop target for the given component at the given x/y location (in component coordiate space).protected voidInvoked on the focus component to let it know that drag has started on the parent container for the case of a component that doesn't support scrollingprotected voiddrawDraggedImage(Graphics g, Image img, int x, int y) Draws the given image at x/y, this method can be overriden to draw additional information such as positive or negative drop indicationvoidPerforms a drop operation of the component at the given X/Y location in coordinate space, this method should be overriden by subclasses to perform all of the logic related to moving a component, by default this method does nothing and so dragging a component and dropping it has no effectprotected voidCallback allowing a developer to track when the component gains focusprotected voidCallback allowing a developer to track wheh the component loses focusintReturns the absolute X location based on the component hierarchy, this method calculates a location on the screen for the component rather than a relative location as returned by getX()intReturns the absolute Y location based on the component hierarchy, this method calculates a location on the screen for the component rather than a relative location as returned by getX()Returns the text that describes this component to assistive technologies.final StyleReturns a "meta style" that allows setting styles once to all the different Style objects, the getters for this style will be meaningless and will return 0 values.Returns the animation manager of the parent form or null if this component isn't currently associated with a formintgetBaseline(int width, int height) The baseline for the component text according to which it should be aligned with other components for best visual look.intReturns a constant indicating how the baseline varies with the size of the component.protected BorderNormally returns getStyle().getBorder() but some subclasses might use this to programmatically replace the border in runtime e.g.intReturns the gap to be left for the bottom scrollbar on the X axis.protected RectangleReturns the component bounds which is sometimes more convenient than invoking getX/Y/Width/Height.Returns the bounds of this component in the provided Rectangle.getClientProperty(String key) Client properties allow the association of meta-data with a component, this is useful for some applications that construct GUI's on the fly and need to track the connection between the UI and the data.Indicates the property within this component that should be bound to the cloud objectThe destination property of the CloudObjectReturns the Component Form or null if this Component is not added yet to a formSome components may optionally generate a state which can then be restored using setCompnentState().intGets the custom cursor for this component.static byteReturns the default translucency used in the#getDragImage()method.final Rectanglegets the Component dirty region, this method is for internal use only and SHOULD NOT be invoked by user code.Returns the Component Style for the disabled state allowing us to manipulate the look of the component when its disabledintGets the current dragged x values when the Component is being draggedintGets the current dragged y values when the Component is being draggedprotected ImageThis method returns an image representing the dragged component, it can be overriden by subclasses to customize the look of the image, the image will be overlaid on top of the form during a drag and drop operationprotected intgetDragRegionStatus(int x, int y) Indicates if the section within the X/Y area is a "drag region" where we expect people to drag or press in which case we can instantly start dragging making perceived performance faster.protected floatgetDragSpeed(boolean vertical) This method returns the dragging speed based on the latest dragged eventsbyteReturns the translucency used in the#getDragImage()method.Gets the delegate that handles the editing of this component.protected intThis method should be implemented correctly by subclasses to make snap to grid functionality work as expected.protected intThis method should be implemented correctly by subclasses to make snap to grid functionality work as expected.intReturns the component heightGets inline styles that are to be applied to all states of this component.Gets inline styles that are to be applied to the disabled state of this component.Gets inline styles that are to be applied to the pressed state of this component.Gets inline styles that are to be applied to the selected state of this component.Gets the theme that is used by inline styles to reference images.Gets inline styles that are to be applied to the unselected state of this component.intGets the inner height of this component.intGets the preferred height removing vertical padding.intGets the preferred width removing horizontal padding.intGets the inner width of this component.intGets x-coordinate of the inner bounds of this component.intGets the inner y-coordinate of the inner bounds of this component.Allows us to indicate the label associated with this component thus providing visual feedback related for this component e.g.getName()A component name allows us to easily identify the component within a dynamic UI.Gets the native overlay for this component.Allows us to determine which component will receive focus next when traversing with the down keyAllows us to determine which component will receive focus next when traversing with the left key.Allows us to determine which component will receive focus next when traversing with the right keyAllows us to determine which component will receive focus next when traversing with the up key.intGets the outer height of this component.intGets the preferred height including the vertical margins.intGets the preferred width including horizontal margins.intGets the outer width of this component.intGets the x-coordinate of the outer bounds of this component.intGets the Y-coordinate of the outer bounds of this component.getOwner()Gets the "owner" of this component as set by#setOwner(com.codename1.ui.Component).Returns the container in which this component is containedintHelper method to retrieve the preferred height of the component.Returns the Component Preferred Size, there is no guarantee the Component will be sized at its Preferred Size.Returns the preferred size string that can be used to specify the preferred size of the component using pixels or millimetres.intHelper method to retrieve the preferred width of the component.Returns the Component Style for the pressed state allowing us to manipulate the look of the component when it is pressedString[]A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder codeString[]This method is here to workaround an XMLVM array type bug where property types aren't identified properly, it returns the names of the types using the following type names: String,int,double,long,byte,short,char,String[],String[][],byte[],Image,Image[],Object[],ListModel,ListCellRendererClass[]Matches the property names method (see that method for further details).getPropertyValue(String name) Returns the current value of the property name, this method is used by the GUI builderReturns the array of components that have an equal heightReturns the array of components that have an equal widthReturns the scrollable parent of this componentintScroll animation speed in milliseconds allowing a developer to slow down or accelerate the smooth animation modeReturns the Components dimension in scrolling, this is very similar to the preferred size aspect only it represents actual scrolling limits.intThis method is used internally by the look and feel to implement the fading scrollbar behavior.intIndicates the decrement units for the scroll opacityintIndicates the X position of the scrolling, this number is relative to the component position and so a position of 0 would indicate the x position of the component.intIndicates the Y position of the scrolling, this number is relative to the component position and so a position of 0 would indicate the y position of the component.Allows determining the text for the select command used in the 3rd softbutton mode.Returns the component bounds with absolute screen coordinates, for components that include an internal selection behavior and are not containers (currently only List) this method allows returning the position of the selection itself which is useful for things such as the popup dialog and similar UI's that need to reference the position of the selection externallyReturns the Component Style for the selected state allowing us to manipulate the look of the component when it owns focusintReturns the gap to be left for the side scrollbar on the Y axis.intGets the tab index of the component.intRecommended length for the tensile, -1 for defaultReturns
final StringgetUIID()Unique identifier for a component.This method should be used by the Component to retrieve the correct UIManager to work withfinal StyleReturns the Component Style for the unselected mode allowing us to manipulate the look of the componentprotected RectangleReturns the component bounds for scrolling which might differ from the getBounds for large components e.g.getVisibleBounds(Rectangle rect) Returns the component bounds for scrolling which might differ from the getBounds for large components into the provided rectangle.intgetWidth()Returns the component widthintgetX()Returns the current component x location relatively to its parent containerintgetY()Returns the component y location relatively to its parent containervoidgrowShrink(int duration) Grows or shrinks this component to its new preferred size, this method essentially takes a component whose preferred size has changed and creates a "growing" effect that lasts for the duration.booleanPrevents key events from being grabbed for focus traversal.booleanChecks if this component has a fixed preferred size either via an explicit call to#setPreferredH(int)and#setPreferredW(int), or via a preferred size style string.booleanhasFocus()Returns true if the component has focusprotected voidHides the native overlay for this component.protected voidAllows components to create a style of their own, this method binds the listener to the style and installs a bg painterprotected voidinitDisabledStyle(Style disabledStyle) Can be overridden by subclasses to perform initialization when the disabled style is set to a new value.protected voidinitPressedStyle(Style pressedStyle) Can be overridden by subclasses to perform initialization when the pressed style is set to a new value.protected voidinitSelectedStyle(Style selectedStyle) Can be overridden by subclasses to perform initialization when the selected style is set to a new value.protected voidinitUnselectedStyle(Style unselectedStyle) Can be overridden by subclasses to perform initialization when the unselected style is set to a new value.protected voidAllows subclasses to create their own custom style types and install the background painter into thembooleanEnable the tensile drag to work even when a component doesn't have a scroll showable (scrollable flag still needs to be set to true)booleanPrevent a lead component hierarchy from this specific component, this allows a component within that hierarchy to still act as a standalone componentbooleanUsed as an optimization to mark that this component is currently being used as a cell rendererbooleanSearches the hierarchy of the component recursively to see if the given Container is one of the parents of this componentprotected booleanIndicates whether we are in the middle of a drag operation, this method allows developers overriding the pointer released events to know when this is a drag operation.protected booleanisDragAndDropOperation(int x, int y) This method allows a developer to define only a specific portion of a component as draggable by default it returns true if the component is defined as "draggable"booleanIndicates whether this component can be dragged in a drag and drop operation rather than scroll the parentprotected booleanisDragRegion(int x, int y) Indicates if the section within the X/Y area is a "drag region" where we expect people to drag and never actually "press" in which case we can instantly start dragging making perceived performance faster.booleanIndicates whether this component can receive dropped components into it, notice that when dropping on a component or container the parents will be checked recursively to find a valid drop targetbooleanIndicates whether component is enabled or disabled thus allowing us to prevent a component from receiving input events and indicate so visuallybooleanMakes the component effectively opaque by blending the backgrounds into an image in memory so the layer of underlying components is only drawn once when this component is repainted.booleanReturns true if this component can receive focus and is enabledbooleanThis property is useful for blocking in z-order touch events, sometimes we might want to grab touch events in a specific component without making it focusable.booleanisHidden()Returns true if the component was explicitly hidden by the user.booleanisHidden(boolean checkParent) Checks if the component is hidden.booleanIndicates that this component and all its children should be hidden when the device is switched to landscape modebooleanIndicates that this component and all its children should be hidden when the device is switched to portrait modebooleanReturns
protected booleanprotected booleanIndicates if the component is in the initialized state, a component is initialized when its initComponent() method was invoked.booleanisOpaque()Checks whether the component's background should be painted.booleanChecks to see if this component is owned by the given other component.booleanreturns true if pinch will block drag and dropbooleanIndicates whether the component displays the material design ripple effectfinal booleanisRTL()Is the component a bidi RTL componentprotected booleanIndicates whether the component should/could scroll by default a component is not scrollable.booleanIndicates whether the component should/could scroll on the X axisbooleanIndicate whether this component scroll is visiblestatic booleanChecks to see if this platform supports cursors.booleanIndicates that scrolling through the component should work as an animationbooleanIndicates whether scrolling this component should jump to a specific location in a gridprotected booleanReturns true if the component is interested in receiving drag/pointer release events even after the gesture exceeded its boundaries.booleanIndicates whether the component should "trigger" tactile touch when pressed by the user in a touch screen UI.protected booleanisTactileTouch(int x, int y) Elaborate components might not provide tactile feedback for all their areas (e.g. Lists) this method defaults to returning the value of isTactileTouchbooleanIndicates whether tensile drag (dragging beyond the boundry of the component and snapping back) is enabled for this component.final booleanChecks if this component should be traversable using the keyboard using tab, next, previous keys.booleanReturns whether the component is visible or notprotected voidlaidOut()This is a callback method to inform the Component when it's been laidout on the parent ContainervoidlongPointerPress(int x, int y) If this Component is focused this method is invoked when the user presses and holds the pointer on the Componentprotected voidonScrollX(int scrollX) This method can be overriden to receive scroll events, unlike overriding setScrollX it will receive all calls for scrolling.protected voidonScrollY(int scrollY) This method can be overriden to receive scroll events, unlike overriding setScrollY it will receive all calls for scrolling.protected voidonSetFocusable(boolean focusable) Since setFocusable is final this callback is invoked when focusable changes.protected voidThis method paints the Component background, it should be overriden by subclasses to perform custom background drawing.voidThis method paints all the parents Components Background.protected voidDraws the component border if such a border exists.protected voidDraws the component border background if such a border exists.final voidPaints this component as a root by going to all the parent components and setting the absolute translation based on coordinates and scroll status.final voidpaintComponent(Graphics g, boolean background) Paints this component as a root by going to all the parent components and setting the absolute translation based on coordinates and scroll status.voidPaints intersecting components that appear above this component.paintLock(boolean hardLock) This method locks the component so it will always paint the given image instead of running through its paint logic.voidReleases the paint lock image to allow paint to work as usual, see paintLock(boolean) for detailsvoidpaintRippleOverlay(Graphics g, int x, int y, int position) Invoked to draw the ripple effect overlay in Android where the finger of the user causes a growing circular overlay over time.protected voidPaints the UI for the scrollbars on the component, this will be invoked only for scrollable components.protected voidPaints the UI for the scrollbar on the X axis, this method allows component subclasses to customize the look of a scrollbarprotected voidPaints the UI for the scrollbar on the Y axis, this method allows component subclasses to customize the look of a scrollbarvoidpaintShadows(Graphics g, int relativeX, int relativeY) Paints the drop-shadow projections for this component based on its elevation value.protected StringReturns a string representing the state of this component.static DimensionparsePreferredSize(String preferredSize, Dimension baseSize) Parses the preferred size given as a stringprotected booleanpinch(float scale) Invoked by subclasses interested in handling pinch to zoom events, if true is returned other drag events will not be broadcastprotected booleanpinch(int[] x, int[] y) Invoked by subclasses interested in handling pinch to do their own actions based on the position of the two fingers, if true is returned other drag events will not be broadcastprotected voidpinchReleased(int x, int y) To be implemented by subclasses interested in being notified when a pinch zoom has ended (i.e the user has removed one of their fingers, but is still dragging).voidpointerDragged(int[] x, int[] y) If this Component is focused, the pointer dragged event will call this methodvoidpointerDragged(int x, int y) If this Component is focused, the pointer dragged event will call this methodvoidpointerHoverPressed(int[] x, int[] y) Invoked for devices where the pointer can hover without actually clicking the display.voidpointerPressed(int[] x, int[] y) If this Component is focused, the pointer pressed event will call this methodvoidpointerPressed(int x, int y) If this Component is focused, the pointer pressed event will call this methodvoidpointerReleased(int[] x, int[] y) If this Component is focused, the pointer released event will call this methodvoidputClientProperty(String key, Object value) Client properties allow the association of meta-data with a component, this is useful for some applications that construct GUI's on the fly and need to track the connection between the UI and the data.voidMakes sure the component is up to date with the current theme, ONLY INVOKE THIS METHOD IF YOU CHANGED THE THEME!voidrefreshTheme(boolean merge) Makes sure the component is up to date with the current theme, ONLY INVOKE THIS METHOD IF YOU CHANGED THE THEME!protected voidrefreshTheme(String id, boolean merge) Makes sure the component is up to date with the given UIIDvoidremove()This method will remove the Component from its parent.voidRemoves the listener from the drag finished eventvoidRemoves an action listener to drag over eventsvoidRemoves an action listener to drop events which are invoked when this component is dropped on a targetvoidDeregisters interest in receiving callbacks for focus gained eventsvoidRemoves the listener from the pointer eventvoidRemoves the listener from the pointer eventvoidRemoves the listener from the pointer eventvoidRemoves the listener from the pointer eventvoidDeregisters interest in receiving callbacks for scroll gained eventsvoidRemoves a listener from being notified when the state of this component is changed to and from initialized.voidrepaint()Repaint this Component, the repaint call causes a callback of the paint method on the event dispatch thread.voidrepaint(int x, int y, int w, int h) Repaints a specific region within the componentvoidChanges the current component to the focused component, will work only for a component that belongs to a parent form.protected voidRestores the state of the focusable flag to its default statebooleanChecks if the component responds to pointer events.voidscrollRectToVisible(int x, int y, int width, int height, Component coordinateSpace) Makes sure the component is visible in the scroll if this container is scrollableprotected voidscrollRectToVisible(Rectangle rect, Component coordinateSpace) Makes sure the component is visible in the scroll if this container is scrollablevoidsetAccessibilityText(String text) Sets the text that describes this component to assistive technologies.voidsetAlwaysTensile(boolean alwaysTensile) Enable the tensile drag to work even when a component doesn't have a scroll showable (scrollable flag still needs to be set to true)voidsetBlockLead(boolean blockLead) Prevent a lead component hierarchy from this specific component, this allows a component within that hierarchy to still act as a standalone componentvoidsetCellRenderer(boolean cellRenderer) Used as an optimization to mark that this component is currently being used as a cell renderervoidsetCloudBoundProperty(String cloudBoundProperty) Indicates the property within this component that should be bound to the cloud objectvoidsetCloudDestinationProperty(String cloudDestinationProperty) The destination property of the CloudObjectvoidsetComponentState(Object state) If getComponentState returned a value the setter can update the value and restore the prior state.voidsetCursor(int cursor) Sets a custom mouse cursor for this component if the platform supports mouse cursors, notice that this isn't applicable for touch devices.static voidsetDefaultDragTransparency(byte defaultDragTransparency) Sets the default translucency of the#getDragImage()method.final voidsetDirtyRegion(Rectangle dirty) sets the Component dirty region, this method is for internal use only and SHOULD NOT be invoked by user code.voidsetDisabledStyle(Style style) Changes the Component disalbed Style by replacing the Component Style with the given StylevoidsetDraggable(boolean draggable) Indicates whether this component can be dragged in a drag and drop operation rather than scroll the parentvoidsetDragTransparency(byte dragTransparency) Sets the translucency of the#getDragImage()method.voidsetDropTarget(boolean dropTarget) Indicates whether this component can receive dropped components into it, notice that when dropping on a component or container the parents will be checked recursively to find a valid drop targetvoidsetEditingDelegate(Editable editable) Sets the editing delegate for this component.voidsetEnabled(boolean enabled) Indicates whether component is enabled or disabled thus allowing us to prevent a component from receiving input events and indicate so visuallyvoidsetFlatten(boolean flatten) Makes the component effectively opaque by blending the backgrounds into an image in memory so the layer of underlying components is only drawn once when this component is repainted.voidsetFocus(boolean focused) This flag doesn't really give focus, its a state that determines what colors from the Style should be used when painting the component.final voidsetFocusable(boolean focusable) A simple setter to determine if this Component can get focusedvoidsetGrabsPointerEvents(boolean grabsPointerEvents) This property is useful for blocking in z-order touch events, sometimes we might want to grab touch events in a specific component without making it focusable.voidsetHandlesInput(boolean handlesInput) Prevents key events from being grabbed for focus traversal.voidsetHeight(int height) Sets the Component height, this method is exposed for the purpose of external layout managers and should not be invoked directly.voidsetHidden(boolean b) Makes the components preferred size equal 0 when hidden and restores it to the default size when not.voidsetHidden(boolean b, boolean changeMargin) Makes the components preferred size equal 0 when hidden and restores it to the default size when not.voidsetHideInLandscape(boolean hideInLandscape) Indicates that this component and all its children should be hidden when the device is switched to landscape modevoidsetHideInPortrait(boolean hideInPortrait) Indicates that this component and all its children should be hidden when the device is switched to portrait modevoidsetIgnorePointerEvents(boolean ignorePointerEvents) Parameters
protected voidsetInitialized(boolean initialized) Indicates if the component is in the initialized state, a component is initialized when its initComponent() method was invoked.voidsetInlineAllStyles(String styles) Registers inline styles that should be applied to all states of the component.voidsetInlineDisabledStyles(String styles) Registers inline styles that should be applied to the disabled state of the component.voidsetInlinePressedStyles(String styles) Registers inline styles that should be applied to the pressed state of the component.voidsetInlineSelectedStyles(String styles) Registers inline styles that should be applied to the selected state of the component.voidsetInlineStylesTheme(Resources inlineStylesTheme) Sets the theme that is used by inline styles to reference images.voidsetInlineUnselectedStyles(String styles) Registers inline styles that should be applied to the unselected state of the component.voidsetIsScrollVisible(boolean isScrollVisible) Set whether this component scroll is visiblevoidsetLabelForComponent(Label componentLabel) Allows us to indicate the label associated with this component thus providing visual feedback related for this component e.g.voidA component name allows us to easily identify the component within a dynamic UI.voidsetNextFocusDown(Component nextFocusDown) Allows us to determine which component will receive focus next when traversing with the down keyvoidsetNextFocusLeft(Component nextFocusLeft) Allows us to determine which component will receive focus next when traversing with the left key, this method doesn't affect the general focus behavior.voidsetNextFocusRight(Component nextFocusRight) Allows us to determine which component will receive focus next when traversing with the right keyvoidsetNextFocusUp(Component nextFocusUp) Allows us to determine which component will receive focus next when traversing with the up key, this method doesn't affect the general focus behavior.final voidsetOpaque(boolean opaque) Sets whether or not to paint the component background.voidSets the owner of this component to the specified component.voidsetPinchBlocksDragAndDrop(boolean block) If a component supports pinch as well as drag and drop the two may conflict (if one finger is placed a bit before the other, the drag timer will be initiated and may trigger drag even if the second finger has been placed before).voidsetPreferredH(int preferredH) Helper method to set the preferred height of the component.voidSets the Component Preferred Size, there is no guarantee the Component will be sized at its Preferred Size.voidsetPreferredSizeStr(String value) Parameters
voidsetPreferredTabIndex(int index) Sets the preferred tab index of the component.voidsetPreferredW(int preferredW) Helper method to set the preferred width of the component.voidsetPressedStyle(Style style) Sets the Component Style for the pressed state allowing us to manipulate the look of the component when it is pressedsetPropertyValue(String name, Object value) Sets a new value to the given property, returns an error message if failed and null if successful.voidsetRippleEffect(boolean rippleEffect) Indicates whether the component displays the material design ripple effectvoidsetRTL(boolean rtl) Is the component a bidi RTL componentstatic voidsetSameHeight(Component... c) Places all of these components in the same height group, to remove a component from the group invoke this method with that component only.static voidsetSameSize(Component... c) This is identical to invoking#sameWidthfollowed by#sameHeightstatic voidsetSameWidth(Component... c) Places all of these components in the same width group, to remove a component from the group invoke this method with that component only.voidsetScrollAnimationSpeed(int animationSpeed) Scroll animation speed in milliseconds allowing a developer to slow down or accelerate the smooth animation modevoidsetScrollOpacityChangeSpeed(int scrollOpacityChangeSpeed) Indicates the decrement units for the scroll opacityvoidSet the size for the scroll areavoidsetScrollVisible(boolean isScrollVisible) Set whether this component scroll is visibleprotected voidsetScrollX(int scrollX) Indicates the X position of the scrolling, this number is relative to the component position and so a position of 0 would indicate the x position of the component.protected voidsetScrollY(int scrollY) Indicates the Y position of the scrolling, this number is relative to the component position and so a position of 0 would indicate the y position of the component.voidsetSelectCommandText(String selectText) Allows determining the text for the select command used in the 3rd softbutton mode.voidsetSelectedStyle(Style style) Changes the Component selected Style by replacing the Component Style with the given StylevoidsetShouldCalcPreferredSize(boolean shouldCalcPreferredSize) Indicates the values within the component have changed and preferred size should be recalculatedvoidSets the Component size, this method is exposed for the purpose of external layout managers and should not be invoked directly.voidsetSmoothScrolling(boolean smoothScrolling) Indicates that scrolling through the component should work as an animationvoidsetSnapToGrid(boolean snapToGrid) Indicates whether scrolling this component should jump to a specific location in a gridvoidsetTabIndex(int index) Sets the tab index of the component.voidsetTactileTouch(boolean tactileTouch) Indicates whether the component should "trigger" tactile touch when pressed by the user in a touch screen UI.voidsetTensileDragEnabled(boolean tensileDragEnabled) Indicates whether tensile drag (dragging beyond the boundry of the component and snapping back) is enabled for this component.voidsetTensileLength(int tensileLength) Recommended length for the tensile, -1 for defaultvoidsetTooltip(String tooltip) Parameters
final voidsetTraversable(boolean traversable) Sets whether this component is traversable using the keyboard using tab, next, previous keys.voidThis method sets the Component the Unique identifier.voidThis method sets the Component the Unique identifier.protected final voidsetUIIDFinal(String id) This method is the implementation of setUIID and is defined as final to allow invocation from constructors.voidsetUnselectedStyle(Style style) Changes the Component Style by replacing the Component Style with the given StylevoidsetVisible(boolean visible) Toggles visibility of the componentvoidsetX(int x) Sets the Component x location relative to the parent container, this method is exposed for the purpose of external layout managers and should not be invoked directly.voidsetY(int y) Sets the Component y location relative to the parent container, this method is exposed for the purpose of external layout managers and should not be invoked directly.protected booleanA component that might need side swipe such as the slider could block it from being used for some other purpose when on top of said component.protected booleanA component that might need side swipe such as the tabs could block it from being used for some other purpose when on top of said component.protected booleanA component that might need side swipe such as the tabs could block it from being used for some other purpose when on top of said component.protected voidCreates the native overlay for this component.Convenience method that strips margin and padding from the component, and returns itself for chaining.voidstyleChanged(String propertyName, Style source) Invoked to indicate a change in a propertyName of a StyletoImage()Returns the component as an image.toString()Overriden to return a useful value for debugging purposesprotected voidUpdates the native overlay for this component.booleanvisibleBoundsContains(int x, int y) Returns true if the given absolute coordinate is contained inside the visible bounds of the component.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Constructor Details
-
TextField
public TextField()Default constructor -
TextField
public TextField(int columns) Construct a text field with space reserved for columns
Parameters
columns: - the number of columns
-
TextField
Construct text field
Parameters
text: the text of the field
-
TextField
-
TextField
-
TextField
Construct text field
Parameters
-
text: the text of the field -
columns: - the number of columns
-
-
-
Method Details
-
isUseNativeTextInput
public static boolean isUseNativeTextInput()Indicates that native text input should be used in text field when in place editing is supported by the platform
Returns
the useNativeTextInput
Deprecated
this API is no longer useful and should be avoided
-
setUseNativeTextInput
public static void setUseNativeTextInput(boolean aUseNativeTextInput) Indicates that native text input should be used in text field when in place editing is supported by the platform
Parameters
aUseNativeTextInput: the useNativeTextInput to set
Deprecated
this API is no longer useful and should be avoided
-
setClearText
Set the text that should appear on the clear softkey
Parameters
text: localized text for the clear softbutton
-
setT9Text
Set the text that should appear on the T9 softkey
Parameters
text: text for the T9 softbutton
-
create
-
create
Default factory method
Returns
a text field if native in place editing is unsupported and a text area if it is
-
create
Construct text field/area depending on whether native in place editing is supported
Parameters
columns: - the number of columns
Returns
a text field if native in place editing is unsupported and a text area if it is
-
create
-
addInputMode
Adds a new inputmode hashtable with the given name and set of values
Parameters
-
name: a unique display name for the input mode e.g. ABC, 123 etc... -
values: @param values The key for the hashtable is an Integer keyCode and the value is a String containing the characters to toggle between for the given keycode -
firstUpcase: @param firstUpcase indicates if this input mode in an input mode used for the special case where the first letter is an upper case letter
Deprecated
this is a method for use only on old J2ME devices and is ignored everywhere else
-
-
getDefaultInputModeOrder
Returns the order in which input modes are toggled by default
Returns
the default order of the input mode
Deprecated
this is a method for use only on old J2ME devices and is ignored everywhere else
-
setDefaultInputModeOrder
Sets the order in which input modes are toggled by default and allows disabling/hiding an input mode
Parameters
order: the order for the input modes in all future created fields
Deprecated
this is a method for use only on old J2ME devices and is ignored everywhere else
-
getSymbolTable
public static char[] getSymbolTable()Returns the symbol table for the device
Returns
the symbol table of the device for the symbol table input
-
setSymbolTable
public static void setSymbolTable(char[] table) Sets the symbol table to show when the user clicks the symbol table key
Parameters
table: the symbol table of the device for the symbol table input
-
isReplaceMenuDefault
public static boolean isReplaceMenuDefault()Indicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text field
Returns
true if the menu should be replaced
-
setReplaceMenuDefault
public static void setReplaceMenuDefault(boolean replaceMenu) Indicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text field
Parameters
replaceMenu: true if the menu should be replaced
-
isQwertyAutoDetect
public static boolean isQwertyAutoDetect()Indicates whether the text field should try to auto detect qwerty and switch the qwerty device flag implicitly
Returns
true for qwerty auto detection
-
setQwertyAutoDetect
public static void setQwertyAutoDetect(boolean v) Indicates whether the text field should try to auto detect qwerty and switch the qwerty device flag implicitly
Parameters
v: true for qwerty auto detection
-
isQwertyDevice
public static boolean isQwertyDevice()The default value for the qwerty flag so it doesn't need setting for every text field individually.
Returns
true for qwerty devices
-
setQwertyDevice
public static void setQwertyDevice(boolean v) The default value for the qwerty flag so it doesn't need setting for every text field individually.
Parameters
v: true for qwerty device
-
getDefaultChangeInputModeKey
public static int getDefaultChangeInputModeKey()Key to change the input mode on the device
Returns
key to change the input mode
Deprecated
this is a method for use only on old J2ME devices and is ignored everywhere else
-
setDefaultChangeInputModeKey
public static void setDefaultChangeInputModeKey(int k) Key to change the input mode on the device
Parameters
k: key to change the input mode
Deprecated
this is a method for use only on old J2ME devices and is ignored everywhere else
-
getDefaultSymbolDialogKey
public static int getDefaultSymbolDialogKey()The default key for poping open the symbol dialog
Returns
the default key
-
setDefaultSymbolDialogKey
public static void setDefaultSymbolDialogKey(int d) The default key for poping open the symbol dialog
Parameters
d: new key value
-
isEnableInputScroll
public boolean isEnableInputScroll()Indicates whether text field input should scroll to the right side when no more room for the input is present.
Returns
true if scrolling is enabled
- Overrides:
isEnableInputScrollin classTextArea
-
setEnableInputScroll
public void setEnableInputScroll(boolean enableInputScroll) Indicates whether text field input should scroll to the right side when no more room for the input is present.
Parameters
enableInputScroll: true to enable scrolling to the side
-
deleteChar
public void deleteChar()Performs a backspace operation -
commitChange
protected void commitChange()Commit the changes made to the text field as a complete edit operation. This is used in a numeric keypad to allow the user to repeatedly press a number to change values. -
isPendingCommit
public boolean isPendingCommit()Returns true if the text field is waiting for a commit on editing
Returns
true if a commit is pending
- Overrides:
isPendingCommitin classTextArea
-
getCommitTimeout
public int getCommitTimeout()The amount of time in milliseconds it will take for a change to get committed into the field.
Returns
the time for a commit timeout
-
setCommitTimeout
public void setCommitTimeout(int commitTimeout) The amount of time in milliseconds it will take for a change to get committed into the field.
Parameters
commitTimeout: @param commitTimeout indicates the amount of time that should elapse for a commit to automatically occur
-
getInputMode
Returns the currently selected input mode
Returns
Deprecated
this is a method for use only on old J2ME devices and is ignored everywhere else
- Overrides:
getInputModein classTextArea- Returns:
- the display name of the input mode by default the following modes are supported: Abc, ABC, abc, 123
-
setInputMode
Sets the current selected input mode matching one of the existing input modes
Parameters
inputMode: @param inputMode the display name of the input mode by default the following modes are supported: Abc, ABC, abc, 123
Deprecated
this is a method for use only on old J2ME devices and is ignored everywhere else
-
isChangeInputMode
protected boolean isChangeInputMode(int keyCode) Indicates whether the key changes the current input mode
Parameters
keyCode: the code
Returns
true for the hash (#) key code
Deprecated
this is a method for use only on old J2ME devices and is ignored everywhere else
-
getInputModeOrder
Returns the order in which input modes are toggled
Returns
the order of the input modes
- Overrides:
getInputModeOrderin classTextArea
-
setInputModeOrder
Sets the order in which input modes are toggled and allows disabling/hiding an input mode
Parameters
order: the order for the input modes in this field
Deprecated
this is a method for use only on old J2ME devices and is ignored everywhere else
-
getLongClickInputMode
Returns the input mode for the ong click mode
Returns
returns 123 by default
-
getCharPerKeyCode
protected char getCharPerKeyCode(int pressCount, int keyCode, boolean longClick) Returns the character matching the given key code after the given amount of user presses
Parameters
-
pressCount: number of times this keycode was pressed -
keyCode: the actual keycode input by the user -
longClick: does this click constitute a long click
Returns
- Returns:
- the char mapping to this key or 0 if no appropriate char was found (navigation, input mode change etc...).
-
-
getCursorPosition
public int getCursorPosition()Returns the position of the cursor char position
Returns
the cursor position
- Overrides:
getCursorPositionin classTextArea
-
setCursorPosition
public void setCursorPosition(int pos) Sets the position of the cursor char position
Parameters
pos: the cursor position
-
getCursorY
public int getCursorY()Returns the position of the cursor line position
Returns
the cursor line position
- Overrides:
getCursorYin classTextArea
-
getCursorX
public int getCursorX()Returns the position of the cursor char position in the current line.
Returns
the cursor char position in the current line
- Overrides:
getCursorXin classTextArea
-
setText
Sets the text within this text area
Parameters
t: new value for the text area
- Specified by:
setTextin interfaceTextHolder- Overrides:
setTextin classTextArea
-
clear
public void clear()Clears the text from the TextField -
isClearKey
protected boolean isClearKey(int keyCode) Returns true if this is the clear key on the device, many devices don't contain a clear key and even in those that contain it this might be an issue
Parameters
keyCode: the key code that might be the clear key
Returns
true if this is the clear key.
-
longKeyPress
protected void longKeyPress(int keyCode) If this Component is focused this method is invoked when the user presses and holds the key
Parameters
keyCode: the key code value to indicate a physical key.
- Overrides:
longKeyPressin classComponent
-
isQwertyInput
public boolean isQwertyInput()True is this is a qwerty device or a device that is currently in qwerty mode.
Returns
currently defaults to false
- Overrides:
isQwertyInputin classTextArea
-
setQwertyInput
public void setQwertyInput(boolean qwerty) True is this is a qwerty device or a device that is currently in qwerty mode.
Parameters
qwerty: the value of qwerty mode
-
isImmediateInputMode
Returns true if the given input mode should commit immediately or wait for the commit timeout
Parameters
mode: the input mode
Returns
returns true for input mode 123 by default
Deprecated
this is a method for use only on old J2ME devices and is ignored everywhere else
-
insertChars
This method is responsible for adding a character into the field and is the focal point for all input. It can be overriden to prevent a particular char from insertion or provide a different behavior for char insertion. It is the responsibility of this method to shift the cursor and invoke setText...
This method accepts a string for the more elaborate cases such as multi-char input and paste.
Parameters
c: character for insertion
Deprecated
this is a method for use only on old J2ME devices and is ignored everywhere else
-
validChar
Checks if the candidate input is valid for this TextField
Parameters
c: the String to insert
Returns
true if the String is valid
-
showSymbolDialog
protected void showSymbolDialog()Invoked to show the symbol dialog, this method can be overriden by subclasses to manipulate the symbol table -
createSymbolTable
Creates a symbol table container used by the showSymbolDialog method. This method is designed for subclases to override and customize.
Returns
container for the symbol table.
-
keyReleased
public void keyReleased(int keyCode) If this Component is focused, the key released event will call this method
Parameters
keyCode: the key code value to indicate a physical key.
- Overrides:
keyReleasedin classTextArea
-
getLongClickDuration
protected int getLongClickDuration()The amount of time considered as a "long click" causing the long click method to be invoked.
Returns
currently defaults to 800
-
isCursorPositionCycle
protected boolean isCursorPositionCycle()Returns true if the cursor should cycle to the beginning of the text when the user navigates beyond the edge of the text and visa versa.
Returns
true by default
-
isSymbolDialogKey
protected boolean isSymbolDialogKey(int keyCode) Returns true if this keycode is the one mapping to the symbol dialog popup
Parameters
keyCode: the keycode to check
Returns
true if this is the star symbol *
-
deinitialize
protected void deinitialize()Invoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy. This allows the component to deregister animators and cleanup after itself. This method is the opposite of the initComponent() method.- Overrides:
deinitializein classTextArea
-
setEditable
public void setEditable(boolean b) Sets this text area to be editable or readonly
Parameters
b: true is text are is editable; otherwise false
- Overrides:
setEditablein classTextArea
-
keyRepeated
public void keyRepeated(int keyCode) If this Component is focused, the key repeat event will call this method.
Parameters
keyCode: the key code value to indicate a physical key.
- Overrides:
keyRepeatedin classComponent
-
keyPressed
public void keyPressed(int keyCode) If this Component is focused, the key pressed event will call this method
Parameters
keyCode: the key code value to indicate a physical key.
- Overrides:
keyPressedin classTextArea
-
installCommands
Installs the clear and t9 commands onto the parent form, this method can be overriden to provide device specific placement for these commands
Parameters
-
clear: the clear command -
t9: the t9 command
Returns
- Returns:
- clear command already installed in the form if applicable, none if no clear command was installed before or not applicable.
-
-
isSelectableInteraction
protected boolean isSelectableInteraction()This method allows a component to indicate that it is interested in an "implicit" select command to appear in the "fire" button when 3 softbuttons are defined in a device.
Returns
true if this is a selectable interaction
- Overrides:
isSelectableInteractionin classTextArea
-
fireClicked
protected void fireClicked()When working in 3 softbutton mode "fire" key (center softbutton) is sent to this method in order to allow 3 button devices to work properly. When overriding this method you should also override isSelectableInteraction to indicate that a command is placed appropriately on top of the fire key for 3 soft button phones.- Overrides:
fireClickedin classTextArea
-
removeCommands
Removes the clear and t9 commands from the parent form, this method can be overriden to provide device specific placement for these commands
Parameters
-
clear: the clear command -
t9: the t9 command -
originalClear: the command originally assigned as the clear command (or null if no command was assigned before)
-
-
isEditingTrigger
protected boolean isEditingTrigger(int keyCode) Indicates whether the given key code should be ignored or should trigger editing, by default fire or any numeric key should trigger editing implicitly. This method is only called when handles input is false.
Parameters
keyCode: the keycode passed to the keyPressed method
Returns
true if this key code should cause a switch to editing mode.
-
isEditingEndTrigger
protected boolean isEditingEndTrigger(int keyCode) Indicates whether the given key code should be ignored or should trigger cause editing to end. By default the fire key, up or down will trigger the end of editing.
Parameters
keyCode: the keycode passed to the keyPressed method
Returns
true if this key code should cause a switch to editing mode.
-
paint
This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.
Parameters
g: the component graphics
-
calcPreferredSize
Calculates the preferred size based on component content. This method is invoked lazily by getPreferred size.
Returns
the calculated preferred size based on component content
- Overrides:
calcPreferredSizein classTextArea
-
getCursorBlinkTimeOn
public int getCursorBlinkTimeOn()The amount of time in milliseconds in which the cursor is visible
Returns
time for the cursor to stay "on"
-
setCursorBlinkTimeOn
public void setCursorBlinkTimeOn(int time) The amount of time in milliseconds in which the cursor is visible
Parameters
time: for the cursor to stay "on"
-
getCursorBlinkTimeOff
public int getCursorBlinkTimeOff()The amount of time in milliseconds in which the cursor is invisible
Returns
time for the cursor to stay "off"
-
setCursorBlinkTimeOff
public void setCursorBlinkTimeOff(int time) The amount of time in milliseconds in which the cursor is invisible
Parameters
time: for the cursor to stay "off"
-
animate
public boolean animate()Allows the animation to reduce "repaint" calls when it returns false. It is called once for every frame. Frames are defined by the
com.codename1.ui.Displayclass.Returns
true if a repaint is desired or false if no repaint is necessary
-
pointerReleased
public void pointerReleased(int x, int y) If this Component is focused, the pointer released event will call this method
Parameters
-
x: the pointer x coordinate -
y: the pointer y coordinate
- Overrides:
pointerReleasedin classTextArea
-
-
isUseSoftkeys
public boolean isUseSoftkeys()When set to true softkeys are used to enable delete functionality
Returns
true if softkeys should be used
-
setUseSoftkeys
public void setUseSoftkeys(boolean useSoftkeys) When set to true softkeys are used to enable delete functionality
Parameters
useSoftkeys: true if softkeys should be used
-
isReplaceMenu
public boolean isReplaceMenu()Indicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text field
Returns
true if the menu should be replaced
-
setReplaceMenu
public void setReplaceMenu(boolean replaceMenu) Indicates whether the menu of the form should be replaced with the T9/Clear commands for the duration of interactivity with the text field
Parameters
replaceMenu: true if the menu should be replaced
-
isOverwriteMode
public boolean isOverwriteMode()Indicates that this is the overwrite mode
Returns
true if input with overwrite characters
-
setOverwriteMode
public void setOverwriteMode(boolean overwriteMode) Indicates that this is the overwrite mode
Parameters
overwriteMode: set to true if input with overwrite characters
-
isLeftAndRightEditingTrigger
public boolean isLeftAndRightEditingTrigger()Indicates whether the left/right keys will trigger editing, this is true by default. Left and right key edit trigger might be disabled for cases such as text field positioned horizontally one next to the other.
Returns
leftAndRightEditingTrigger Indicates whether the left/right keys will trigger editing
-
setLeftAndRightEditingTrigger
public void setLeftAndRightEditingTrigger(boolean leftAndRightEditingTrigger) Indicates whether the left/right keys will trigger editing, this is true by default. Left and right key edit trigger might be disabled for cases such as text field positioned horizontally one next to the other.
Parameters
leftAndRightEditingTrigger: Indicates whether the left/right keys will trigger editing
-
setAlignment
public void setAlignment(int align) Sets the Alignment of the TextArea to one of: CENTER, LEFT, RIGHT
Parameters
align: alignment value
Deprecated
use Style.setAlignment instead
See also
-
#CENTER
-
#LEFT
-
#RIGHT
- Overrides:
setAlignmentin classTextArea
-
calculateTextSelectionSpan
Calculates the spans for the the given text selection. This should generally just delegate to the appropriate method in the look and feel for performing the layout calculation.
Parameters
sel: The TextSelection
Since
7.0
- Overrides:
calculateTextSelectionSpanin classTextArea
-