Class MaterialAutoComplete.DefaultMaterialChipProvider
- java.lang.Object
-
- org.gcube.portets.user.message_conversations.client.autocomplete.MaterialAutoComplete.DefaultMaterialChipProvider
-
- All Implemented Interfaces:
MaterialAutoComplete.MaterialChipProvider
- Enclosing class:
- MaterialAutoComplete
public static class MaterialAutoComplete.DefaultMaterialChipProvider extends Object implements MaterialAutoComplete.MaterialChipProvider
Default implementation of theMaterialAutoComplete.MaterialChipProviderinterface, used by theMaterialAutoComplete.By default all chips are selectable and removable. The default
IconTypeused by the chips provided is theIconType.CLOSE.
-
-
Constructor Summary
Constructors Constructor Description DefaultMaterialChipProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description gwt.material.design.client.ui.MaterialChipgetChip(com.google.gwt.user.client.ui.SuggestOracle.Suggestion suggestion)Creates and returns aMaterialChipbased on the selectedSuggestOracle.Suggestion.booleanisChipRemovable(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.booleanisChipSelectable(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.
-
-
-
Method Detail
-
getChip
public gwt.material.design.client.ui.MaterialChip getChip(com.google.gwt.user.client.ui.SuggestOracle.Suggestion suggestion)
Description copied from interface:MaterialAutoComplete.MaterialChipProviderCreates and returns aMaterialChipbased on the selectedSuggestOracle.Suggestion.- Specified by:
getChipin interfaceMaterialAutoComplete.MaterialChipProvider- Parameters:
suggestion- the selectedSuggestOracle.Suggestion- Returns:
- the created MaterialChip, or
nullif the suggestion should be ignored.
-
isChipRemovable
public boolean isChipRemovable(com.google.gwt.user.client.ui.SuggestOracle.Suggestion suggestion)
Description copied from interface:MaterialAutoComplete.MaterialChipProviderReturns whether the chip defined by the suggestion should be removed from the autocomplete when clicked on its icon.Override this method returning
falseto implement your own logic when the user clicks on the chip icon.- Specified by:
isChipRemovablein interfaceMaterialAutoComplete.MaterialChipProvider- Parameters:
suggestion- the selectedSuggestOracle.Suggestion
-
isChipSelectable
public boolean isChipSelectable(com.google.gwt.user.client.ui.SuggestOracle.Suggestion suggestion)
Description copied from interface:MaterialAutoComplete.MaterialChipProviderReturns whether the chip defined by the suggestion should be selected when the user clicks on it.Selecion of chips is used to batch remove suggestions, for example.
- Specified by:
isChipSelectablein interfaceMaterialAutoComplete.MaterialChipProvider- Parameters:
suggestion- the selectedSuggestOracle.Suggestion- See Also:
MaterialAutoComplete.setSelectedChipStyle(String)
-
-