Class VComboBox.ComboBoxSuggestion

  • All Implemented Interfaces:
    com.google.gwt.core.client.Scheduler.ScheduledCommand, com.google.gwt.user.client.Command, com.google.gwt.user.client.ui.SuggestOracle.Suggestion
    Enclosing class:
    VComboBox

    public class VComboBox.ComboBoxSuggestion
    extends Object
    implements com.google.gwt.user.client.ui.SuggestOracle.Suggestion, com.google.gwt.user.client.Command
    Represents a suggestion in the suggestion popup box.
    • Constructor Detail

      • ComboBoxSuggestion

        public ComboBoxSuggestion​(String key,
                                  String caption,
                                  String style,
                                  String untranslatedIconUri)
        Constructor for a single suggestion.
        Parameters:
        key - item key, empty string for a special null item not in container
        caption - item caption
        style - item style name, can be empty string
        untranslatedIconUri - icon URI or null
    • Method Detail

      • getDisplayString

        public String getDisplayString()
        Gets the visible row in the popup as a HTML string. The string contains an image tag with the rows icon (if an icon has been specified) and the caption of the item
        Specified by:
        getDisplayString in interface com.google.gwt.user.client.ui.SuggestOracle.Suggestion
      • getReplacementString

        public String getReplacementString()
        Get a string that represents this item. This is used in the text box.
        Specified by:
        getReplacementString in interface com.google.gwt.user.client.ui.SuggestOracle.Suggestion
      • getOptionKey

        public String getOptionKey()
        Get the option key which represents the item on the server side.
        Returns:
        The key of the item
      • getIconUri

        public String getIconUri()
        Get the URI of the icon. Used when constructing the displayed option.
        Returns:
        real (translated) icon URI or null if none
      • getStyle

        public String getStyle()
        Gets the style set for this suggestion item. Styles are typically set by a server-side com.vaadin.ui.ComboBox.ItemStyleProvider. The returned style is prefixed by v-filterselect-item-.
        Returns:
        the style name to use, or null to not apply any custom style.
        Since:
        7.5.6
      • execute

        public void execute()
        Executes a selection of this item.
        Specified by:
        execute in interface com.google.gwt.user.client.Command
        Specified by:
        execute in interface com.google.gwt.core.client.Scheduler.ScheduledCommand
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object