# Class AutoCompleteTextField

java.lang.Object
com.codename1.ui.Component
com.codename1.ui.TextArea
com.codename1.ui.TextField
com.codename1.ui.AutoCompleteTextField

All Implemented Interfaces:
  `Animation, Editable, ActionSource, StyleListener, TextHolder`

public class AutoCompleteTextField extends TextField

An editable `com.codename1.ui.TextField` with completion suggestions that show up in a drop down menu while the user types in text.

This class uses the "`TextField`" UIID by default as well as "`AutoCompletePopup`" & "`AutoCompleteList`" for the popup list details.

The sample below shows the more trivial use case for this widget:

    Form hi = new Form("Auto Complete", new BoxLayout(BoxLayout.Y_AXIS));
    AutoCompleteTextField ac = new AutoCompleteTextField("Short", "Shock", "Sholder", "Shrek");
    ac.setMinimumElementsShownInPopup(5);
    hi.add(ac);

The following sample shows more dynamic usage of the class where the auto-complete model is mutated based on webservice results.

    public void showForm() {
      final DefaultListModel options = new DefaultListModel<>();
      AutoCompleteTextField ac = new AutoCompleteTextField(options) {
    @Override
          protected boolean filter(String text) {
              if(text.length() == 0) {
                  return false;
              }
              String[] l = searchLocations(text);
              if(l == null || l.length == 0) {
                  return false;
              }

              options.removeAll();
              for(String s : l) {
                  options.addItem(s);
              }
              return true;
          }

      };
      ac.setMinimumElementsShownInPopup(5);
      hi.add(ac);
      hi.add(new SpanLabel("This demo requires a valid google API key to be set below "
               + "you can get this key for the webservice (not the native key) by following the instructions here: "
               + "https://developers.google.com/places/web-service/get-api-key"));
      hi.add(apiKey);
      hi.getToolbar().addCommandToRightBar("Get Key", null, e -> Display.getInstance().execute("https://developers.google.com/places/web-service/get-api-key"));
      hi.show();
    }

    TextField apiKey = new TextField();

    String[] searchLocations(String text) {
        try {
            if(text.length() > 0) {
                ConnectionRequest r = new ConnectionRequest();
                r.setPost(false);
                r.setUrl("https://maps.googleapis.com/maps/api/place/autocomplete/json");
                r.addArgument("key", apiKey.getText());
                r.addArgument("input", text);
                NetworkManager.getInstance().addToQueueAndWait(r);
                Map result = new JSONParser().parseJSON(new InputStreamReader(new ByteArrayInputStream(r.getResponseData()), "UTF-8"));
                String[] res = Result.fromContent(result).getAsStringArray("//description");
                return res;
            }
        } catch(Exception err) {
            Log.e(err);
        }
        return null;
    }

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `POPUP_POSITION_AUTO`
  `static final int`
  `POPUP_POSITION_OVER`
  `static final int`
  `POPUP_POSITION_UNDER`

  ### Fields inherited from class TextArea

  `ANY, DECIMAL, EMAILADDR, INITIAL_CAPS_SENTENCE, INITIAL_CAPS_WORD, NON_PREDICTIVE, NUMERIC, PASSWORD, PHONENUMBER, SENSITIVE, UNEDITABLE, UPPERCASE, URL, 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_CURSOR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AutoCompleteTextField()`
  The default constructor is useful for cases of filter subclasses overriding the getSuggestionModel value as well as for the GUI builder
  `AutoCompleteTextField(ListModel<String> listModel)`
  Constructor with completion suggestions, filtering is automatic in this case
  `AutoCompleteTextField(String... completion)`
  Constructor with completion suggestions

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addListListener(ActionListener a)`
  Adds an action listener that fires an event when an entry in the auto-complete list is selected.
  `protected void`
  `deinitialize()`
  Invoked to indicate that the component initialization is being reversed since the component was detached from the container hierarchy.
  `protected boolean`
  `filter(String text)`
  Subclasses can override this method to perform more elaborate filter operations
  `String[]`
  `getCompletion()`
  Returns the completion values
  `int`
  `getMinimumElementsShownInPopup()`
  The number of elements shown for the auto complete popup
  `int`
  `getMinimumLength()`
  Indicates the minimum length of text in the field in order for a popup to show the default is 0 where a popup is shown immediately for all text length if the number is 2 a popup will only appear when there are two characters or more.
  `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
  `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[],Image,Image[],Object[],ListModel,ListCellRenderer
  `Class[]`
  `getPropertyTypes()`
  Matches the property names method (see that method for further details).
  `Object`
  `getPropertyValue(String name)`
  Returns the current value of the property name, this method is used by the GUI builder
  `protected ListModel<String>`
  `getSuggestionModel()`
  Returns the list model to show within the completion list
  `protected void`
  `initComponent()`
  Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state
  `boolean`
  `isStartsWithMode()`
  When enabled this makes the filter check that the string starts with rather than within the index
  `void`
  `keyPressed(int k)`
  If this Component is focused, the key pressed event will call this method
  `void`
  `keyReleased(int k)`
  If this Component is focused, the key released event will call this method
  `void`
  `removeListListener(ActionListener a)`
  Removes an action listener that fires an event when an entry in the auto-complete list is selected.
  `void`
  `setCompletion(String... completion)`
  Sets the completion values
  `void`
  `setCompletionRenderer(ListCellRenderer completionRenderer)`
  Sets a custom renderer to the completion suggestions list.
  `void`
  `setMinimumElementsShownInPopup(int minimumElementsShownInPopup)`
  The number of elements shown for the auto complete popup
  `void`
  `setMinimumLength(int minimumLength)`
  Indicates the minimum length of text in the field in order for a popup to show the default is 0 where a popup is shown immediately for all text length if the number is 2 a popup will only appear when there are two characters or more.
  `void`
  `setPopupPosition(int popupPosition)`
  Set the autocomplete popup position in respect of the text field; POPUP_POSITION_AUTO is the default and it means that the popup is placed according to the available space.
  `String`
  `setPropertyValue(String name, Object value)`
  Sets a new value to the given property, returns an error message if failed and null if successful.
  `void`
  `setStartsWithMode(boolean startsWithMode)`
  When enabled this makes the filter check that the string starts with rather than within the index
  `void`
  `setText(String text)`
  Sets the text within this text area
  `protected boolean`
  `shouldShowPopup()`
  Callback that allows subclasses to block the popup from showing
  `void`
  `showPopup()`
  Causes the popup UI to show
  `protected void`
  `updateFilterList()`
  In a case of an asynchronous filter this method can be invoked to refresh the completion list

  ### Methods inherited from class TextField

  `addInputMode, animate, calcPreferredSize, calculateTextSelectionSpan, clear, commitChange, create, create, create, create, createSymbolTable, deleteChar, fireClicked, getCharPerKeyCode, getCommitTimeout, getCursorBlinkTimeOff, getCursorBlinkTimeOn, getCursorPosition, getCursorX, getCursorY, getDefaultChangeInputModeKey, getDefaultInputModeOrder, getDefaultSymbolDialogKey, getInputMode, getInputModeOrder, getLongClickDuration, getLongClickInputMode, getSymbolTable, insertChars, installCommands, isChangeInputMode, isClearKey, isCursorPositionCycle, isEditingEndTrigger, isEditingTrigger, isEnableInputScroll, isImmediateInputMode, isLeftAndRightEditingTrigger, isOverwriteMode, isPendingCommit, isQwertyAutoDetect, isQwertyDevice, isQwertyInput, isReplaceMenu, isReplaceMenuDefault, isSelectableInteraction, isSymbolDialogKey, isUseNativeTextInput, isUseSoftkeys, keyRepeated, longKeyPress, paint, pointerReleased, removeCommands, setAlignment, setClearText, setCommitTimeout, setCursorBlinkTimeOff, setCursorBlinkTimeOn, setCursorPosition, setDefaultChangeInputModeKey, setDefaultInputModeOrder, setDefaultSymbolDialogKey, setEditable, setEnableInputScroll, setInputMode, setInputModeOrder, setLeftAndRightEditingTrigger, setOverwriteMode, setQwertyAutoDetect, setQwertyDevice, setQwertyInput, setReplaceMenu, setReplaceMenuDefault, setSymbolTable, setT9Text, setUseNativeTextInput, setUseSoftkeys, showSymbolDialog, validChar`

  ### Methods 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, 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, unbindProperty`

  ### Methods 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, 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, 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, visibleBoundsContains`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### POPUP_POSITION_AUTO

    public static final int POPUP_POSITION_AUTO
    See Also:
      - Constant Field Values

  - ### POPUP_POSITION_OVER

    public static final int POPUP_POSITION_OVER
    See Also:
      - Constant Field Values

  - ### POPUP_POSITION_UNDER

    public static final int POPUP_POSITION_UNDER
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### AutoCompleteTextField

    public AutoCompleteTextField(String... completion)

    Constructor with completion suggestions

    ###### Parameters

    - `completion`: a String array of suggestion for completion

  - ### AutoCompleteTextField

    public AutoCompleteTextField(ListModel<String> listModel)

    Constructor with completion suggestions, filtering is automatic in this case

    ###### Parameters

    - `listModel`: a list model containing potential string suggestions

  - ### AutoCompleteTextField

    public AutoCompleteTextField()
    The default constructor is useful for cases of filter subclasses overriding the getSuggestionModel value as well as for the GUI builder

- ## Method Details

  - ### initComponent

    protected void initComponent()
    Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state
    Overrides:
      `initComponent` in class `TextArea`

  - ### 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:
      `deinitialize` in class `TextField`

  - ### showPopup

    public void showPopup()
    Causes the popup UI to show

  - ### setText

    public void setText(String text)

    Sets the text within this text area

    ###### Parameters

    - `t`: new value for the text area
    Specified by:
      `setText` in interface `TextHolder`
    Overrides:
      `setText` in class `TextField`

  - ### updateFilterList

    protected void updateFilterList()
    In a case of an asynchronous filter this method can be invoked to refresh the completion list

  - ### filter

    protected boolean filter(String text)

    Subclasses can override this method to perform more elaborate filter operations

    ###### Parameters

    - `text`: the text to filter

    ###### Returns

    true if the filter has changed the list, false if it hasn't or is working asynchronously

  - ### getSuggestionModel

    protected ListModel<String> getSuggestionModel()

    Returns the list model to show within the completion list

    ###### Returns

    the list model can be anything

  - ### setCompletionRenderer

    public void setCompletionRenderer(ListCellRenderer completionRenderer)

    Sets a custom renderer to the completion suggestions list.

    ###### Parameters

    - `completionRenderer`: a ListCellRenderer for the suggestions List

  - ### keyPressed

    public void keyPressed(int k)

    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:
      `keyPressed` in class `TextField`

  - ### keyReleased

    public void keyReleased(int k)

    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:
      `keyReleased` in class `TextField`

  - ### addListListener

    public void addListListener(ActionListener a)

    Adds an action listener that fires an event when an entry in the auto-complete list is selected. Notice that this method will only take effect when the popup is reshown, if it is invoked when a popup is already showing it will have no effect.

    ###### Parameters

    - `a`: the listener

  - ### removeListListener

    public void removeListListener(ActionListener a)

    Removes an action listener that fires an event when an entry in the auto-complete list is selected. Notice that this method will only take effect when the popup is reshown, if it is invoked when a popup is already showing it will have no effect.

    ###### Parameters

    - `a`: the listener

  - ### getMinimumLength

    public int getMinimumLength()

    Indicates the minimum length of text in the field in order for a popup to show the default is 0 where a popup is shown immediately for all text length if the number is 2 a popup will only appear when there are two characters or more.

    ###### Returns

    the minimumLength

  - ### setMinimumLength

    public void setMinimumLength(int minimumLength)

    Indicates the minimum length of text in the field in order for a popup to show the default is 0 where a popup is shown immediately for all text length if the number is 2 a popup will only appear when there are two characters or more.

    ###### Parameters

    - `minimumLength`: the minimumLength to set

  - ### getMinimumElementsShownInPopup

    public int getMinimumElementsShownInPopup()

    The number of elements shown for the auto complete popup

    ###### Returns

    the minimumElementsShownInPopup

  - ### setMinimumElementsShownInPopup

    public void setMinimumElementsShownInPopup(int minimumElementsShownInPopup)

    The number of elements shown for the auto complete popup

    ###### Parameters

    - `minimumElementsShownInPopup`: the minimumElementsShownInPopup to set

  - ### setPopupPosition

    public void setPopupPosition(int popupPosition)

    Set the autocomplete popup position in respect of the text field; POPUP_POSITION_AUTO is the default and it means that the popup is placed according to the available space.

    ###### Parameters

    - `popupPosition`: @param popupPosition on of POPUP_POSITION_AUTO, POPUP_POSITION_OVER, POPUP_POSITION_UNDER

  - ### shouldShowPopup

    protected boolean shouldShowPopup()

    Callback that allows subclasses to block the popup from showing

    ###### Returns

    true to allow the popup if applicable, false to block it

  - ### getPropertyNames

    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

    ###### Returns

    the property names allowing mutation

    Overrides:
      `getPropertyNames` in class `Component`

  - ### getPropertyTypes

    public Class[] getPropertyTypes()

    Matches the property names method (see that method for further details).

    ###### Returns

    the types of the properties

    Overrides:
      `getPropertyTypes` in class `Component`

  - ### getPropertyTypeNames

    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[],Image,Image[],Object[],ListModel,ListCellRenderer

    ###### Returns

    Array of type names

    Overrides:
      `getPropertyTypeNames` in class `Component`

  - ### getPropertyValue

    public Object getPropertyValue(String name)

    Returns the current value of the property name, this method is used by the GUI builder

    ###### Parameters

    - `name`: the name of the property

    ###### Returns

    the value of said property

    Overrides:
      `getPropertyValue` in class `Component`

  - ### getCompletion

    public String[] getCompletion()

    Returns the completion values

    ###### Returns

    array of completion entries

  - ### setCompletion

    public void setCompletion(String... completion)

    Sets the completion values

    ###### Parameters

    - `completion`: the completion values

  - ### setPropertyValue

    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. Notice that some builtin properties such as "$designMode" might be sent to components to indicate application state.

    ###### Parameters

    - `name`: the name of the property

    - `value`: new value for the property

    ###### Returns

    error message or null

    Overrides:
      `setPropertyValue` in class `Component`

  - ### isStartsWithMode

    public boolean isStartsWithMode()

    When enabled this makes the filter check that the string starts with rather than within the index

    ###### Returns

    the startsWithMode

  - ### setStartsWithMode

    public void setStartsWithMode(boolean startsWithMode)

    When enabled this makes the filter check that the string starts with rather than within the index

    ###### Parameters

    - `startsWithMode`: the startsWithMode to set