|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gjt.sp.jedit.input.AbstractInputHandler<E>
public abstract class AbstractInputHandler<E extends JEditAbstractEditAction>
The abstract input handler manage the keyboard handling.
The entry point is
processKeyEvent(java.awt.event.KeyEvent, int, boolean)
| Field Summary | |
|---|---|
protected java.util.Hashtable |
bindings
|
protected java.util.Hashtable |
currentBindings
|
protected java.awt.event.KeyListener |
keyEventInterceptor
This listener will receive keyboard events if it is not null. |
protected E |
lastAction
|
protected int |
lastActionCount
|
static java.lang.Object |
PREFIX_STR
|
protected java.lang.String |
readNextChar
|
protected static int |
REPEAT_COUNT_THRESHOLD
|
protected int |
repeatCount
|
protected boolean |
shortcutOn
|
| Constructor Summary | |
|---|---|
AbstractInputHandler()
|
|
| Method Summary | |
|---|---|
void |
addKeyBinding(java.lang.String keyBinding,
E action)
Adds a key binding to this input handler. |
void |
addKeyBinding(java.lang.String keyBinding,
java.lang.Object action)
Adds a key binding to this input handler. |
void |
addKeyBinding(java.lang.String keyBinding,
java.lang.String action)
Adds a key binding to this input handler. |
java.lang.Object |
getKeyBinding(java.lang.String keyBinding)
Returns either an edit action, or a hashtable if the specified key is a prefix. |
java.awt.event.KeyListener |
getKeyEventInterceptor()
|
int |
getLastActionCount()
Returns the number of times the last action was executed. |
abstract boolean |
handleKey(KeyEventTranslator.Key keyStroke,
boolean dryRun)
Handles a keystroke. |
abstract void |
invokeAction(E action)
|
abstract void |
invokeAction(java.lang.String action)
|
boolean |
isPrefixActive()
Returns if a prefix key has been pressed. |
abstract void |
processKeyEvent(java.awt.event.KeyEvent evt,
int from,
boolean global)
Process a keyboard event. |
protected void |
processKeyEventKeyStrokeHandling(java.awt.event.KeyEvent evt,
int from,
java.lang.String mode,
boolean global)
|
void |
removeAllKeyBindings()
Removes all key bindings from this input handler. |
void |
removeKeyBinding(java.lang.String keyBinding)
Removes a key binding from this input handler. |
void |
resetLastActionCount()
Resets the last action count. |
protected void |
sendShortcutPrefixOff()
If |
void |
setBindings(java.util.Hashtable bindings)
Replace the set of key bindings. |
void |
setCurrentBindings(java.util.Hashtable bindings)
|
void |
setKeyEventInterceptor(java.awt.event.KeyListener keyEventInterceptor)
Sets the listener that will handle all key events in this view. |
static java.lang.String |
toString(java.awt.event.KeyEvent evt)
Return a String representation of the keyboard event for debugging purpose. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int lastActionCount
protected java.awt.event.KeyListener keyEventInterceptor
protected java.lang.String readNextChar
protected int repeatCount
protected E extends JEditAbstractEditAction lastAction
protected static final int REPEAT_COUNT_THRESHOLD
public static java.lang.Object PREFIX_STR
protected boolean shortcutOn
protected java.util.Hashtable bindings
protected java.util.Hashtable currentBindings
| Constructor Detail |
|---|
public AbstractInputHandler()
| Method Detail |
|---|
public void addKeyBinding(java.lang.String keyBinding,
java.lang.String action)
keyBinding - The key bindingaction - The action
public void addKeyBinding(java.lang.String keyBinding,
E action)
keyBinding - The key bindingaction - The action
public void addKeyBinding(java.lang.String keyBinding,
java.lang.Object action)
keyBinding - The key bindingaction - The actionpublic void removeKeyBinding(java.lang.String keyBinding)
keyBinding - The key bindingpublic void removeAllKeyBindings()
public java.lang.Object getKeyBinding(java.lang.String keyBinding)
keyBinding - The key bindingpublic int getLastActionCount()
public void resetLastActionCount()
public java.awt.event.KeyListener getKeyEventInterceptor()
public void setKeyEventInterceptor(java.awt.event.KeyListener keyEventInterceptor)
keyEventInterceptor - the KeyListener that will receive the eventspublic boolean isPrefixActive()
public void setBindings(java.util.Hashtable bindings)
public void setCurrentBindings(java.util.Hashtable bindings)
public abstract boolean handleKey(KeyEventTranslator.Key keyStroke,
boolean dryRun)
keyStroke - The key stroke.dryRun - only calculate the return value, do not have any other effect
public abstract void processKeyEvent(java.awt.event.KeyEvent evt,
int from,
boolean global)
evt - the keyboard eventfrom - the source, it can be View.VIEW,
View.ACTION_BAR or View.TEXT_AREAglobal - tell if the event comes from the DefaultKeyboardFocusManager or notprotected void sendShortcutPrefixOff()
public abstract void invokeAction(java.lang.String action)
public abstract void invokeAction(E action)
public static java.lang.String toString(java.awt.event.KeyEvent evt)
evt - the keyboard event
protected void processKeyEventKeyStrokeHandling(java.awt.event.KeyEvent evt,
int from,
java.lang.String mode,
boolean global)
evt - the keyboard eventfrom - the source, it can be View.VIEW,
View.ACTION_BAR or View.TEXT_AREAmode - the mode is "press" or "type" and is used for debug onlyglobal - tell if the event comes from the DefaultKeyboardFocusManager or not
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||