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 Object
implements DefaultSelectionEventManager.EventTranslator<T>
An event translator that allows selection only for the specified
whitelisted columns.
-
Constructor Summary
ConstructorDescriptionWhitelistEventTranslator
(int... whitelistedColumns) Construct a newDefaultSelectionEventManager.WhitelistEventTranslator
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
clearCurrentSelection
(CellPreviewEvent<T> event) Check whether a user selection event should clear all currently selected values.void
Clear all columns from the whitelist.boolean
isColumnWhitelisted
(int index) Check if the specified column is whitelisted.void
setColumnWhitelisted
(int index, boolean isWhitelisted) Set whether or not the specified column in whitelisted.translateSelectionEvent
(CellPreviewEvent<T> event) Translate the user selection event into aDefaultSelectionEventManager.SelectAction
.
-
Constructor Details
-
WhitelistEventTranslator
public WhitelistEventTranslator(int... whitelistedColumns) Construct a newDefaultSelectionEventManager.WhitelistEventTranslator
.- Parameters:
whitelistedColumns
- the columns to whitelist
-
-
Method Details
-
clearCurrentSelection
Description copied from interface:DefaultSelectionEventManager.EventTranslator
Check whether a user selection event should clear all currently selected values.- Specified by:
clearCurrentSelection
in interfaceDefaultSelectionEventManager.EventTranslator<T>
- Parameters:
event
- theCellPreviewEvent
to 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
Description copied from interface:DefaultSelectionEventManager.EventTranslator
Translate the user selection event into aDefaultSelectionEventManager.SelectAction
.- Specified by:
translateSelectionEvent
in interfaceDefaultSelectionEventManager.EventTranslator<T>
- Parameters:
event
- theCellPreviewEvent
to translate
-