public class BaseComponentKeyStrokeTrigger<C extends Component>
extends com.google.code.validationframework.base.trigger.AbstractTrigger
implements com.google.code.validationframework.api.common.Disposable
AbstractTrigger,
Disposable| Modifier and Type | Field and Description |
|---|---|
protected C |
source
Text component that is the source of the trigger.
|
| Constructor and Description |
|---|
BaseComponentKeyStrokeTrigger(C source,
int... keyCodes)
Constructor specifying the text component to listen to and the virtual key codes to trigger the validation.
|
BaseComponentKeyStrokeTrigger(C source,
KeyStroke... keyStrokes)
Constructor specifying the text component to listen to and the key stroke to trigger the validation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyStroke(KeyStroke keyStroke)
Adds a key stroke for which the validation will be triggered.
|
void |
dispose() |
C |
getComponent()
Gets the source component.
|
Collection<KeyStroke> |
getKeyStokes()
Gets the key strokes for which the validation will be triggered.
|
void |
removeKey(KeyStroke keyStroke)
Removes a key stroke for which the validation should no longer be triggered.
|
public BaseComponentKeyStrokeTrigger(C source, int... keyCodes)
KeyStroke constants to see the available virtual key codes.source - Text component to listen to.keyCodes - Virtual key strokes to trigger the validation.BaseComponentKeyStrokeTrigger(Component, KeyStroke...),
KeyStrokepublic BaseComponentKeyStrokeTrigger(C source, KeyStroke... keyStrokes)
KeyStroke utility methods to build a KeyStroke.source - Text component to listen to.keyStrokes - Key strokes to trigger the validation.KeyStrokepublic C getComponent()
public Collection<KeyStroke> getKeyStokes()
public void addKeyStroke(KeyStroke keyStroke)
KeyStroke utility methods to build a KeyStroke.keyStroke - Key stroke to be added to trigger the validation.KeyStrokepublic void removeKey(KeyStroke keyStroke)
keyStroke - Key stroke to be removed.public void dispose()
dispose in interface com.google.code.validationframework.api.common.Disposabledispose in class com.google.code.validationframework.base.trigger.AbstractTriggerDisposable.dispose()Copyright © 2015. All Rights Reserved.