Package com.vaadin.client.ui
Class VComboBox.ComboBoxSuggestion
- java.lang.Object
-
- com.vaadin.client.ui.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 Summary
Constructors Constructor Description ComboBoxSuggestion(String key, String caption, String style, String untranslatedIconUri)
Constructor for a single suggestion.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
void
execute()
Executes a selection of this item.String
getDisplayString()
Gets the visible row in the popup as a HTML string.String
getIconUri()
Get the URI of the icon.String
getOptionKey()
Get the option key which represents the item on the server side.String
getReplacementString()
Get a string that represents this item.String
getStyle()
Gets the style set for this suggestion item.int
hashCode()
String
toString()
-
-
-
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 containercaption
- item captionstyle
- item style name, can be empty stringuntranslatedIconUri
- 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 interfacecom.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 interfacecom.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-sidecom.vaadin.ui.ComboBox.ItemStyleProvider
. The returned style is prefixed byv-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 interfacecom.google.gwt.user.client.Command
- Specified by:
execute
in interfacecom.google.gwt.core.client.Scheduler.ScheduledCommand
-
-