Class AbstractFilterAndReplaceKeyPressHandler
java.lang.Object
de.knightsoftnet.mtwidgets.client.ui.handler.AbstractFilterAndReplaceKeyPressHandler
- All Implemented Interfaces:
com.google.gwt.event.dom.client.KeyPressHandler,com.google.gwt.event.shared.EventHandler
- Direct Known Subclasses:
NumericAndUpperAsciiKeyPressHandler,SimpleFilterAndReplaceKeyPressHandler,UpperAsciiKeyPressHandler
public abstract class AbstractFilterAndReplaceKeyPressHandler
extends Object
implements com.google.gwt.event.dom.client.KeyPressHandler
Abstract key press handler which limits input to allowed characters and replaces characters by
other.
- Author:
- Manfred Tremmel
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFilterAndReplaceKeyPressHandler(boolean allowCopyAndPast) constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanisAllowedCharacter(char character) check if character is allowed to type in unchanged.abstract booleanisCharacterToReplace(char character) check if character is one which has to be replaced.voidonKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event) abstract charreplaceCharacter(char character) replace character by another.
-
Constructor Details
-
AbstractFilterAndReplaceKeyPressHandler
protected AbstractFilterAndReplaceKeyPressHandler(boolean allowCopyAndPast) constructor.- Parameters:
allowCopyAndPast- is copy and paste allowed?
-
-
Method Details
-
onKeyPress
public void onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event) - Specified by:
onKeyPressin interfacecom.google.gwt.event.dom.client.KeyPressHandler
-
isAllowedCharacter
public abstract boolean isAllowedCharacter(char character) check if character is allowed to type in unchanged.- Parameters:
character- character to check- Returns:
- true if it's allowed
-
isCharacterToReplace
public abstract boolean isCharacterToReplace(char character) check if character is one which has to be replaced.- Parameters:
character- character to check- Returns:
- true if character has to be replaced
-
replaceCharacter
public abstract char replaceCharacter(char character) replace character by another.- Parameters:
character- character to replace- Returns:
- replaced character
-