Class Suggestion

java.lang.Object
io.jmix.ui.component.autocomplete.Suggestion

public class Suggestion extends Object
Class for single suggestion for an AutoCompleteSupport field.
Single suggestion has three attributes:
  • Suggestion value itself. If user selects this suggestion this value will be inserted to text field.
  • Display value that is presented inside the suggestion box.
  • Cursor positions (start and end) for the replacement.
  • Field Details

    • displayText

      protected String displayText
    • valueText

      protected String valueText
    • valueSuffix

      protected String valueSuffix
    • startPosition

      protected int startPosition
    • endPosition

      protected int endPosition
  • Constructor Details

    • Suggestion

      public Suggestion(AutoCompleteSupport component, String displayText, String valueText, String valueSuffix, int startPosition, int endPosition)
      Create new suggestion.
      Parameters:
      displayText - Text to display in the suggestion box
      valueText - Value to be inserted into text field if this suggestion is selected.
      valueSuffix - The part of the value that is located after the current cursor position. This is used by the client-side filtering method.
      startPosition - Start position of the replacement. Must be positive and below length of text in textfield. If negative number is given the current cursor position is used.
      endPosition - End position of the replacement. Must be positive and below length of text in textfield. If negative number is given the current cursor position is used.
  • Method Details

    • getValueSuffix

      public String getValueSuffix()
    • getDisplayText

      public String getDisplayText()
    • getValueText

      public String getValueText()
    • getStartPosition

      public int getStartPosition()
    • getEndPosition

      public int getEndPosition()