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
Simple key press handler which limits input to allowed characters.
- Author:
- Manfred Tremmel
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleFilterAndReplaceKeyPressHandler(String pallowedCharacters, boolean pallowCopyAndPast) constructor initializing fields.SimpleFilterAndReplaceKeyPressHandler(Set<Character> pallowedCharacters, boolean pallowCopyAndPast) constructor initializing fields. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisAllowedCharacter(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 final voidsetAllowedCharacters(String pallowedCharacters) protected final voidsetAllowedCharacters(Set<Character> pallowedCharacters) Methods inherited from class de.knightsoftnet.mtwidgets.client.ui.handler.AbstractFilterAndReplaceKeyPressHandler
onKeyPress
-
Constructor Details
-
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
constructor initializing fields.- Parameters:
pallowedCharacters- characters which are allowed to addpallowCopyAndPast- is copy and paste allowed?
-
-
Method Details
-
getAllowedCharacters
-
setAllowedCharacters
-
setAllowedCharacters
-
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
-