public static class MaterialAutoComplete.DefaultMaterialChipProvider extends Object implements MaterialAutoComplete.MaterialChipProvider
MaterialAutoComplete.MaterialChipProvider
interface,
used by the MaterialAutoComplete
.
By default all chips are selectable and removable. The default IconType
used by the chips provided is the IconType.CLOSE
.
Constructor and Description |
---|
DefaultMaterialChipProvider() |
Modifier and Type | Method and Description |
---|---|
gwt.material.design.client.ui.MaterialChip |
getChip(com.google.gwt.user.client.ui.SuggestOracle.Suggestion suggestion)
Creates and returns a
MaterialChip based on the selected
SuggestOracle.Suggestion . |
boolean |
isChipRemovable(com.google.gwt.user.client.ui.SuggestOracle.Suggestion suggestion)
Returns whether the chip defined by the suggestion should be removed from the autocomplete when clicked on its icon.
|
boolean |
isChipSelectable(com.google.gwt.user.client.ui.SuggestOracle.Suggestion suggestion)
Returns whether the chip defined by the suggestion should be selected when the user clicks on it.
|
public DefaultMaterialChipProvider()
public gwt.material.design.client.ui.MaterialChip getChip(com.google.gwt.user.client.ui.SuggestOracle.Suggestion suggestion)
MaterialAutoComplete.MaterialChipProvider
MaterialChip
based on the selected
SuggestOracle.Suggestion
.getChip
in interface MaterialAutoComplete.MaterialChipProvider
suggestion
- the selected SuggestOracle.Suggestion
null
if the
suggestion should be ignored.public boolean isChipRemovable(com.google.gwt.user.client.ui.SuggestOracle.Suggestion suggestion)
MaterialAutoComplete.MaterialChipProvider
Override this method returning false
to implement your own logic when the user clicks on the chip icon.
isChipRemovable
in interface MaterialAutoComplete.MaterialChipProvider
suggestion
- the selected SuggestOracle.Suggestion
public boolean isChipSelectable(com.google.gwt.user.client.ui.SuggestOracle.Suggestion suggestion)
MaterialAutoComplete.MaterialChipProvider
Selecion of chips is used to batch remove suggestions, for example.
isChipSelectable
in interface MaterialAutoComplete.MaterialChipProvider
suggestion
- the selected SuggestOracle.Suggestion
MaterialAutoComplete.setSelectedChipStyle(String)
Copyright © 2018. All rights reserved.