Package com.google.gwt.view.client
Class DefaultSelectionEventManager.WhitelistEventTranslator<T>
- java.lang.Object
-
- com.google.gwt.view.client.DefaultSelectionEventManager.WhitelistEventTranslator<T>
-
- Type Parameters:
T- the data type
- All Implemented Interfaces:
DefaultSelectionEventManager.EventTranslator<T>
- Enclosing class:
- DefaultSelectionEventManager<T>
public static class DefaultSelectionEventManager.WhitelistEventTranslator<T> extends java.lang.Object implements DefaultSelectionEventManager.EventTranslator<T>
An event translator that allows selection only for the specified whitelisted columns.
-
-
Constructor Summary
Constructors Constructor Description WhitelistEventTranslator(int... whitelistedColumns)Construct a newDefaultSelectionEventManager.WhitelistEventTranslator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclearCurrentSelection(CellPreviewEvent<T> event)Check whether a user selection event should clear all currently selected values.voidclearWhitelist()Clear all columns from the whitelist.booleanisColumnWhitelisted(int index)Check if the specified column is whitelisted.voidsetColumnWhitelisted(int index, boolean isWhitelisted)Set whether or not the specified column in whitelisted.DefaultSelectionEventManager.SelectActiontranslateSelectionEvent(CellPreviewEvent<T> event)Translate the user selection event into aDefaultSelectionEventManager.SelectAction.
-
-
-
Constructor Detail
-
WhitelistEventTranslator
public WhitelistEventTranslator(int... whitelistedColumns)
Construct a newDefaultSelectionEventManager.WhitelistEventTranslator.- Parameters:
whitelistedColumns- the columns to whitelist
-
-
Method Detail
-
clearCurrentSelection
public boolean clearCurrentSelection(CellPreviewEvent<T> event)
Description copied from interface:DefaultSelectionEventManager.EventTranslatorCheck whether a user selection event should clear all currently selected values.- Specified by:
clearCurrentSelectionin interfaceDefaultSelectionEventManager.EventTranslator<T>- Parameters:
event- theCellPreviewEventto translate
-
clearWhitelist
public void clearWhitelist()
Clear all columns from the whitelist.
-
isColumnWhitelisted
public boolean isColumnWhitelisted(int index)
Check if the specified column is whitelisted.- Parameters:
index- the column index- Returns:
- true if whitelisted, false if not
-
setColumnWhitelisted
public void setColumnWhitelisted(int index, boolean isWhitelisted)Set whether or not the specified column in whitelisted.- Parameters:
index- the column indexisWhitelisted- true to whitelist, false to allow disallow selection
-
translateSelectionEvent
public DefaultSelectionEventManager.SelectAction translateSelectionEvent(CellPreviewEvent<T> event)
Description copied from interface:DefaultSelectionEventManager.EventTranslatorTranslate the user selection event into aDefaultSelectionEventManager.SelectAction.- Specified by:
translateSelectionEventin interfaceDefaultSelectionEventManager.EventTranslator<T>- Parameters:
event- theCellPreviewEventto translate
-
-