Class SimpleFilterAndReplaceKeyPressHandler
- java.lang.Object
-
- de.knightsoftnet.mtwidgets.client.ui.handler.AbstractFilterAndReplaceKeyPressHandler
-
- de.knightsoftnet.mtwidgets.client.ui.handler.SimpleFilterAndReplaceKeyPressHandler
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.KeyPressHandler,com.google.gwt.event.shared.EventHandler
- Direct Known Subclasses:
PostalCodeKeyPressHandler,RegExKeyPressHandler,TaxNumberKeyPressHandler,TinKeyPressHandler,VatIdKeyPressHandler
public class SimpleFilterAndReplaceKeyPressHandler extends AbstractFilterAndReplaceKeyPressHandler
Simple key press handler which limits input to allowed characters.- Author:
- Manfred Tremmel
-
-
Constructor Summary
Constructors Constructor Description SimpleFilterAndReplaceKeyPressHandler(String pallowedCharacters, boolean pallowCopyAndPast)constructor initializing fields.SimpleFilterAndReplaceKeyPressHandler(Set<Character> pallowedCharacters, boolean pallowCopyAndPast)constructor initializing fields.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<Character>getAllowedCharacters()booleanisAllowedCharacter(char pcharacter)check if character is allowed to type in unchanged.booleanisCharacterToReplace(char pcharacter)check if character is one which has to be replaced.charreplaceCharacter(char pcharacter)replace character by another.protected voidsetAllowedCharacters(String pallowedCharacters)protected voidsetAllowedCharacters(Set<Character> pallowedCharacters)-
Methods inherited from class de.knightsoftnet.mtwidgets.client.ui.handler.AbstractFilterAndReplaceKeyPressHandler
onKeyPress
-
-
-
-
Constructor Detail
-
SimpleFilterAndReplaceKeyPressHandler
public SimpleFilterAndReplaceKeyPressHandler(Set<Character> pallowedCharacters, boolean pallowCopyAndPast)
constructor initializing fields.- Parameters:
pallowedCharacters- characters which are allowed to addpallowCopyAndPast- is copy and paste allowed?
-
SimpleFilterAndReplaceKeyPressHandler
public SimpleFilterAndReplaceKeyPressHandler(String pallowedCharacters, boolean pallowCopyAndPast)
constructor initializing fields.- Parameters:
pallowedCharacters- characters which are allowed to addpallowCopyAndPast- is copy and paste allowed?
-
-
Method Detail
-
setAllowedCharacters
protected final void setAllowedCharacters(String pallowedCharacters)
-
isAllowedCharacter
public boolean isAllowedCharacter(char pcharacter)
Description copied from class:AbstractFilterAndReplaceKeyPressHandlercheck if character is allowed to type in unchanged.- Specified by:
isAllowedCharacterin classAbstractFilterAndReplaceKeyPressHandler- Parameters:
pcharacter- character to check- Returns:
- true if it's allowed
-
isCharacterToReplace
public boolean isCharacterToReplace(char pcharacter)
Description copied from class:AbstractFilterAndReplaceKeyPressHandlercheck if character is one which has to be replaced.- Specified by:
isCharacterToReplacein classAbstractFilterAndReplaceKeyPressHandler- Parameters:
pcharacter- character to check- Returns:
- true if character has to be replaced
-
replaceCharacter
public char replaceCharacter(char pcharacter)
Description copied from class:AbstractFilterAndReplaceKeyPressHandlerreplace character by another.- Specified by:
replaceCharacterin classAbstractFilterAndReplaceKeyPressHandler- Parameters:
pcharacter- character to replace- Returns:
- replaced character
-
-