public class AutoCompleteTextComponent
- Object
- Component
- Container
- InputComponent
- TextComponent
- AutoCompleteTextComponent
ImplementsAnimation, Editable, Iterable<Component>, StyleListener
A TextComponent version of com.codename1.ui.AutoCompleteTextField
This component was contributed here https://github.com/codenameone/CodenameOne/issues/2705
Nested types
interface AutoCompleteTextComponent.AutoCompleteFilter | Allows filtering the entries in the auto complete |
Constructors
public AutoCompleteTextComponent(ListModel<String> listModel, AutoCompleteTextComponent.AutoCompleteFilter customFilter) | This constructor allows us to create an AutoCompleteTextComponent with the given listModel and customFilter |
Methods
public TextField getField() | Allows us to invoke setters/getters and bind listeners to the text field |
public final Component getEditor() | Returns the editor component e.g. text field picker etc. |
public boolean isFocusAnimation() | The focus animation mode forces the hint and text to be identical and animates the hint to the label when focus is in the text field as is common on Android. |
public AutoCompleteTextComponent focusAnimation(boolean focusAnimation) | The focus animation mode forces the hint and text to be identical and animates the hint to the label when focus is in the text field as is common on Android. |
public AutoCompleteTextComponent text(String text) | Sets the text of the field |
public AutoCompleteTextComponent onTopMode(boolean onTopMode) | Overridden for covariant return type Overridden for covariant return type Sets the on top mode which places the label above the text when true. |
public AutoCompleteTextComponent descriptionMessage(String descriptionMessage) | Overridden for covariant return type Overridden for covariant return type Sets the text of the description label which currently only applies in the onTop mode. |
public AutoCompleteTextComponent errorMessage(String errorMessage) | Overridden for covariant return type Overridden for covariant return type Sets the text of the error label |
public AutoCompleteTextComponent label(String text) | Overridden for covariant return type * Overridden for covariant return type Sets the text of the label } |
public AutoCompleteTextComponent labelAndHint(String text) | Convenience method for setting the label and hint together |
public AutoCompleteTextComponent hint(String hint) | Sets the hint of the field |
public AutoCompleteTextComponent hint(Image hint) | Sets the hint of the field |
public AutoCompleteTextComponent multiline(boolean multiline) | Sets the text field to multiline or single line |
public AutoCompleteTextComponent columns(int columns) | Sets the columns in the text field |
public AutoCompleteTextComponent rows(int rows) | Sets the rows in the text field |
public AutoCompleteTextComponent constraint(int constraint) | Sets the constraint for text input matching the constraints from the text area class |
public AutoCompleteTextField getAutoCompleteField() | Allows us to invoke setters/getters and bind listeners to the text field |
public String[] getPropertyNames() | A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder code |
public Class[] getPropertyTypes() | Matches the property names method (see that method for further details). |
public String[] getPropertyTypeNames() | 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[],I… |
public Object getPropertyValue(String name) | Returns the current value of the property name, this method is used by the GUI builder |
public String setPropertyValue(String name, Object value) | Sets a new value to the given property, returns an error message if failed and null if successful. |
public String getText() | Returns the text in the field com.codename1.ui.TextArea#getText() |
Inherited fields
From Component
DEFAULT_CURSOR, CROSSHAIR_CURSOR, TEXT_CURSOR, WAIT_CURSOR, SW_RESIZE_CURSOR, SE_RESIZE_CURSOR, NW_RESIZE_CURSOR, NE_RESIZE_CURSOR, N_RESIZE_CURSOR, S_RESIZE_CURSOR, W_RESIZE_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, MOVE_CURSOR, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_Y, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_IMMEDIATELY_DRAG_XY, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_CENTER_OFFSET, BRB_OTHER, CENTER, TOP, LEFT, BOTTOM, RIGHT, BASELINE
Inherited methods
From InputComponent
group, isMultiLineErrorMessage, setMultiLineErrorMessage, initInput, createErrorLabel, calcPreferredSize, isOnTopMode, getActionUIID, isActionAsButton, getActionText, getAction
From Container
encloseIn, encloseIn, initLaf, getUIManager, setUIManager, isSurface, add, addAll, add, add, add, add, add, getLeadComponent, setLeadComponent, getLeadParent, keyPressed, keyReleased, getLayout, setLayout, invalidate, setShouldLayout, setShouldCalcPreferredSize, getLayoutWidth, getLayoutHeight, applyRTL, constrainWidthWhenScrollable, constrainHeightWhenScrollable, addComponent, addComponent, addComponent, addComponent, replaceAndWait, replaceAndWait, replace, replaceAndWait, replace, createReplaceTransition, isEnabled, setEnabled, removeComponent, cancelRepaints, flushReplace, removeAll, revalidateWithAnimationSafety, revalidate, revalidateLater, forceRevalidate, clearClientProperties, paint, paintGlass, layoutContainer, isSafeArea, setSafeArea, isSafeAreaRoot, getSafeAreaRoot, setSafeAreaRoot, getComponentCount, getComponentAt, getComponentIndex, contains, scrollComponentToVisible, getClosestComponentTo, getResponderAt, getComponentAt, findDropTargetAt, pointerPressed, paramString, refreshTheme, isScrollableX, setScrollableX, isScrollableY, setScrollableY, getSideGap, getBottomGap, setScrollable, setCellRenderer, getScrollIncrement, setScrollIncrement, findFirstFocusable, dragInitiated, fireClicked, isSelectableInteraction, getGridPosY, paintComponentBackground, getGridPosX, animateHierarchyAndWait, createAnimateHierarchy, animateHierarchy, animateHierarchyFadeAndWait, createAnimateHierarchyFade, animateHierarchyFade, animateLayoutFadeAndWait, createAnimateLayoutFadeAndWait, animateLayoutFade, createAnimateLayoutFade, animateLayoutAndWait, animateLayout, updateTabIndices, createAnimateLayout, drop, createAnimateMotion, morph, morphAndWait, animateUnlayout, animateUnlayoutAndWait, createAnimateUnlayout, getChildrenAsList, iterator, iterator
From Component
setSameSize, isSetCursorSupported, parsePreferredSize, getDefaultDragTransparency, setDefaultDragTransparency, getEditingDelegate, setEditingDelegate, getCursor, setCursor, showNativeOverlay, hideNativeOverlay, updateNativeOverlay, getNativeOverlay, getAllStyles, getSameWidth, setSameWidth, getSameHeight, setSameHeight, getX, setX, getOuterX, getInnerX, getY, setY, getOuterY, getInnerY, isVisible, setVisible, getClientProperty, stripMarginAndPadding, putClientProperty, getDirtyRegion, setDirtyRegion, isOpaque, setOpaque, getWidth, setWidth, getOuterWidth, getInnerWidth, getHeight, setHeight, getOuterHeight, getInnerHeight, isDragRegion, getDragRegionStatus, getBaseline, getBaselineResizeBehavior, getPreferredSizeStr, setPreferredSizeStr, getPreferredSize, setPreferredSize, getScrollDimension, calcScrollSize, setScrollSize, getPreferredW, setPreferredW, getPreferredH, setPreferredH, getOuterPreferredH, getInnerPreferredH, getOuterPreferredW, getInnerPreferredW, setSize, getUIID, setUIID, setUIIDFinal, setUIID, getInlineAllStyles, setInlineAllStyles, getInlineSelectedStyles, setInlineSelectedStyles, getInlineUnselectedStyles, setInlineUnselectedStyles, getInlineDisabledStyles, setInlineDisabledStyles, getInlinePressedStyles, setInlinePressedStyles, remove, getParent, getOwner, setOwner, isOwnedBy, containsOrOwns, addFocusListener, removeFocusListener, addScrollListener, removeScrollListener, getSelectCommandText, setSelectCommandText, getLabelForComponent, setLabelForComponent, focusGained, focusLost, paintBackgrounds, paintShadows, getAbsoluteX, getAbsoluteY, isInClippingRegion, paintIntersectingComponentsAbove, paintScrollbars, paintScrollbarX, getScrollOpacity, getSelectedRect, paintScrollbarY, paintComponent, paintComponent, getBorder, getScrollable, paintBackground, isScrollable, getScrollX, setScrollX, getScrollY, setScrollY, onScrollX, onScrollY, getDraggedx, getDraggedy, contains, visibleBoundsContains, hasFixedPreferredSize, getBounds, getBounds, getVisibleBounds, getVisibleBounds, isFocusable, setFocusable, onSetFocusable, resetFocusable, getTabIndex, setTabIndex, getPreferredTabIndex, setPreferredTabIndex, isTraversable, setTraversable, handlesInput, setHandlesInput, consumesRawTextInput, hasFocus, setFocus, getComponentForm, getTopLevelContainer, repaint, repaint, longKeyPress, keyRepeated, registerForAnimation, deregisterFromAnimation, getAnimationManager, getScrollAnimationSpeed, setScrollAnimationSpeed, isBlockLead, setBlockLead, isIgnorePointerEvents, setIgnorePointerEvents, isRippleEffect, setRippleEffect, getInlineStylesTheme, setInlineStylesTheme, shouldRenderComponentSelection, isHideInLandscape, setHideInLandscape, createStyleAnimation, isSmoothScrolling, setSmoothScrolling, pointerHover, stopScrollMomentum, pointerHoverReleased, pointerHoverPressed, pinch, pinchReleased, pinch, rotation, isPinchBlocksDragAndDrop, setPinchBlocksDragAndDrop, pointerDragged, getDragImage, getDragTransparency, setDragTransparency, toImage, drawDraggedImage, draggingOver, dragEnter, dragExit, addPullToRefresh, setPullToRefresh, respondsToPointerEvents, pointerDragged, isStickyDrag, pointerPressed, isDragAndDropOperation, pointerReleased, longPointerPress, pointerReleased, setVerticalScrollBounds, setHorizontalScrollBounds, isVScrollThumbGrabbed, isHScrollThumbGrabbed, isVScrollThumbHover, isHScrollThumbHover, isTensileDragEnabled, setTensileDragEnabled, getTextSelectionSupport, addDropListener, removeDropListener, addDragOverListener, removeDragOverListener, isNativeDragSource, setNativeDragSource, getNativeDragOperation, setNativeDragOperation, createNativeDragOperation, isNativeDropTarget, setNativeDropTarget, getAcceptedDropMimeTypes, setAcceptedDropMimeTypes, getAcceptedDropActions, setAcceptedDropActions, canAcceptNativeDrop, nativeDragEnter, nativeDragOver, nativeDragExit, nativeDrop, addNativeDropListener, removeNativeDropListener, addNativeDragOverListener, removeNativeDragOverListener, dragFinished, addDragFinishedListener, addStateChangeListener, removeStateChangeListener, addPointerPressedListener, addLongPressListener, addContextMenuListener, removeContextMenuListener, addMouseWheelListener, removeMouseWheelListener, addStylusListener, removeStylusListener, mouseWheel, paintRippleOverlay, removePointerPressedListener, removeLongPressListener, removeDragFinishedListener, addPointerReleasedListener, removePointerReleasedListener, addPointerDraggedListener, removePointerDraggedListener, getDragSpeed, getStyle, getPressedStyle, setPressedStyle, initUnselectedStyle, initPressedStyle, initDisabledStyle, initSelectedStyle, getUnselectedStyle, setUnselectedStyle, getSelectedStyle, setSelectedStyle, getDisabledStyle, setDisabledStyle, installDefaultPainter, requestFocus, toString, refreshTheme, refreshTheme, isDragActivated, animate, scrollRectToVisible, scrollRectToVisible, paintBorder, paintBorderBackground, isCellRenderer, isScrollVisible, setScrollVisible, setIsScrollVisible, startEditingAsync, stopEditing, isEditing, isEditable, laidOut, initComponent, isInitialized, setInitialized, styleChanged, getNextFocusDown, setNextFocusDown, getNextFocusUp, setNextFocusUp, getNextFocusLeft, setNextFocusLeft, getNextFocusRight, setNextFocusRight, getName, setName, initCustomStyle, deinitializeCustomStyle, isRTL, setRTL, isTactileTouch, isTactileTouch, setTactileTouch, paintLockRelease, paintLock, isSnapToGrid, setSnapToGrid, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, blocksSideSwipe, isFlatten, setFlatten, getTensileLength, setTensileLength, isGrabsPointerEvents, setGrabsPointerEvents, getScrollOpacityChangeSpeed, setScrollOpacityChangeSpeed, growShrink, isAlwaysTensile, setAlwaysTensile, isDraggable, setDraggable, isDropTarget, setDropTarget, isChildOf, isHideInPortrait, setHideInPortrait, getBindablePropertyNames, getBindablePropertyTypes, bindProperty, unbindProperty, getBoundPropertyValue, setBoundPropertyValue, getCloudBoundProperty, setCloudBoundProperty, getCloudDestinationProperty, setCloudDestinationProperty, getComponentState, setComponentState, setHidden, isHidden, setHidden, isHidden, announceForAccessibility, getAccessibilityText, setAccessibilityText, getSemantics, getAccessibilityNode, accessibilityChanged, accessibilityChanged, getTooltip, setTooltip
Constructor details
AutoCompleteTextComponent
public AutoCompleteTextComponent(ListModel<String> listModel, AutoCompleteTextComponent.AutoCompleteFilter customFilter)Method details
getField
public TextField getField()Returns
getEditor
public final Component getEditor()Returns
isFocusAnimation
public boolean isFocusAnimation()textComponentAnimBool which is true by default on Android. Notice
that this is designed for the onTopMode and might not work if
that is set to false…Returns
focusAnimation
public AutoCompleteTextComponent focusAnimation(boolean focusAnimation)textComponentAnimBool which is true by default on Android. Notice
that this is designed for the onTopMode and might not work if
that is set to false…Parameters
focusAnimationboolean- true for the label to animate into place on focus, false otherwise
Returns
AutoCompleteTextComponent tc = new AutoCompleteTextComponent().text("Text").label("Label");text
public AutoCompleteTextComponent text(String text)Parameters
textString- the text
Returns
AutoCompleteTextComponent tc = new AutoCompleteTextComponent().text("Text").label("Label");onTopMode
public AutoCompleteTextComponent onTopMode(boolean onTopMode)textComponentOnTopBool
theme constant which defaults to falseParameters
onTopModeboolean- true for the label to be above the text
Returns
TextComponent tc = new TextComponent().text("Text").label("Label");descriptionMessage
public AutoCompleteTextComponent descriptionMessage(String descriptionMessage)Parameters
descriptionMessageString- the text
Returns
TextComponent tc = new TextComponent().text("Text").label("Label");errorMessage
public AutoCompleteTextComponent errorMessage(String errorMessage)Parameters
errorMessageString- the text
Returns
TextComponent tc = new TextComponent().text("Text").label("Label");label
public AutoCompleteTextComponent label(String text)Parameters
textString- the text
Returns
TextComponent tc = new TextComponent().text("Text").label("Label");labelAndHint
public AutoCompleteTextComponent labelAndHint(String text)Parameters
textString- the text and hint
Returns
AutoCompleteTextComponent tc = new AutoCompleteTextComponent().text("Text").label("Label");hint
public AutoCompleteTextComponent hint(String hint)Parameters
hintString- the text of the hint
Returns
AutoCompleteTextComponent tc = new AutoCompleteTextComponent().text("Text").label("Label");hint
public AutoCompleteTextComponent hint(Image hint)Parameters
hintImage- the icon for the hint
Returns
AutoCompleteTextComponent tc = new AutoCompleteTextComponent().text("Text").label("Label");multiline
public AutoCompleteTextComponent multiline(boolean multiline)Parameters
multilineboolean- true for multiline, false otherwise
Returns
AutoCompleteTextComponent tc = new AutoCompleteTextComponent().text("Text").label("Label");columns
public AutoCompleteTextComponent columns(int columns)Parameters
columnsint- the number of columns which is used for preferred size calculations
Returns
AutoCompleteTextComponent tc = new AutoCompleteTextComponent().text("Text").label("Label");rows
public AutoCompleteTextComponent rows(int rows)Parameters
rowsint- the number of rows which is used for preferred size calculations
Returns
AutoCompleteTextComponent tc = new AutoCompleteTextComponent().text("Text").label("Label");constraint
public AutoCompleteTextComponent constraint(int constraint)Parameters
constraintint- one of the constants from the
com.codename1.ui.TextAreaclass seecom.codename1.ui.TextArea#setConstraint(int)
Returns
AutoCompleteTextComponent tc = new AutoCompleteTextComponent().text("Text").label("Label");getAutoCompleteField
public AutoCompleteTextField getAutoCompleteField()Returns
getPropertyNames
public String[] getPropertyNames()Returns
getPropertyTypes
public Class[] getPropertyTypes()Returns
getPropertyTypeNames
public String[] getPropertyTypeNames()Returns
getPropertyValue
public Object getPropertyValue(String name)Parameters
nameString- the name of the property
Returns
setPropertyValue
public String setPropertyValue(String name, Object value)Parameters
nameString- the name of the property
valueObject- new value for the property
Returns
getText
public String getText()com.codename1.ui.TextArea#getText()