|
|||||||||
| Home >> All >> org >> gjt >> sp >> jedit >> [ gui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.gjt.sp.jedit.gui
Class DefaultInputHandler

java.lang.Objectorg.gjt.sp.jedit.gui.InputHandler
org.gjt.sp.jedit.gui.DefaultInputHandler
- public class DefaultInputHandler
- extends InputHandler
The default input handler. It maps sequences of keystrokes into actions and inserts key typed events into the text area.
- Version:
- $Id: DefaultInputHandler.java,v 1.37 2003/08/28 22:05:24 spestov Exp $
| Field Summary | |
private java.util.Hashtable |
bindings
|
private java.util.Hashtable |
currentBindings
|
private static java.lang.Object |
PREFIX_STR
|
| Fields inherited from class org.gjt.sp.jedit.gui.InputHandler |
lastAction, lastActionCount, readNextChar, repeatCount, view |
| Constructor Summary | |
DefaultInputHandler(org.gjt.sp.jedit.View view)
Creates a new input handler with no key bindings defined. |
|
DefaultInputHandler(org.gjt.sp.jedit.View view,
DefaultInputHandler copy)
Creates a new input handler with the same set of key bindings as the one specified. |
|
| Method Summary | |
void |
_addKeyBinding(java.lang.String keyBinding,
java.lang.Object action)
Adds a key binding to this input handler. |
void |
addKeyBinding(java.lang.String keyBinding,
org.gjt.sp.jedit.EditAction 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. |
static java.lang.String |
getModifierString(java.awt.event.InputEvent evt)
Returns a string containing symbolic modifier names set in the specified event. |
static char |
getSymbolicModifierName(int mod)
Returns a the symbolic modifier name for the specified Java modifier flag. |
boolean |
handleKey(KeyEventTranslator.Key keyStroke)
Handles the given keystroke. |
boolean |
isPrefixActive()
Returns if a prefix key has been pressed. |
static javax.swing.KeyStroke |
parseKeyStroke(java.lang.String keyStroke)
Deprecated. We don't use Swing KeyStrokes anymore. |
void |
removeAllKeyBindings()
Removes all key bindings from this input handler. |
void |
removeKeyBinding(java.lang.String keyBinding)
Removes a key binding from this input handler. |
private void |
setCurrentBindings(java.util.Hashtable bindings)
|
| Methods inherited from class org.gjt.sp.jedit.gui.InputHandler |
getLastAction, getLastActionCount, getRepeatCount, invokeAction, invokeAction, invokeLastAction, invokeReadNextChar, readNextChar, readNextChar, resetLastActionCount, setRepeatCount, userInput |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
PREFIX_STR
private static java.lang.Object PREFIX_STR
bindings
private java.util.Hashtable bindings
currentBindings
private java.util.Hashtable currentBindings
| Constructor Detail |
DefaultInputHandler
public DefaultInputHandler(org.gjt.sp.jedit.View view)
- Creates a new input handler with no key bindings defined.
DefaultInputHandler
public DefaultInputHandler(org.gjt.sp.jedit.View view, DefaultInputHandler copy)
- Creates a new input handler with the same set of key bindings
as the one specified. Note that both input handlers share
a pointer to exactly the same key binding table; so adding
a key binding in one will also add it to the other.
| Method Detail |
addKeyBinding
public void addKeyBinding(java.lang.String keyBinding, java.lang.String action)
- Adds a key binding to this input handler. The key binding is
a list of white space separated key strokes of the form
[modifiers+]key where modifier is C for Control, A for Alt,
or S for Shift, and key is either a character (a-z) or a field
name in the KeyEvent class prefixed with VK_ (e.g., BACK_SPACE)
- Specified by:
addKeyBindingin classInputHandler
- Since:
- jEdit 4.2pre1
addKeyBinding
public void addKeyBinding(java.lang.String keyBinding, org.gjt.sp.jedit.EditAction action)
- Adds a key binding to this input handler. The key binding is
a list of white space separated key strokes of the form
[modifiers+]key where modifier is C for Control, A for Alt,
or S for Shift, and key is either a character (a-z) or a field
name in the KeyEvent class prefixed with VK_ (e.g., BACK_SPACE)
- Specified by:
addKeyBindingin classInputHandler
removeKeyBinding
public void removeKeyBinding(java.lang.String keyBinding)
- Removes a key binding from this input handler. This is not yet
implemented.
- Specified by:
removeKeyBindingin classInputHandler
removeAllKeyBindings
public void removeAllKeyBindings()
- Removes all key bindings from this input handler.
- Specified by:
removeAllKeyBindingsin classInputHandler
getKeyBinding
public java.lang.Object getKeyBinding(java.lang.String keyBinding)
- Returns either an edit action, or a hashtable if the specified key
is a prefix.
- Since:
- jEdit 3.2pre5
isPrefixActive
public boolean isPrefixActive()
- Returns if a prefix key has been pressed.
- Overrides:
isPrefixActivein classInputHandler
handleKey
public boolean handleKey(KeyEventTranslator.Key keyStroke)
- Handles the given keystroke.
- Specified by:
handleKeyin classInputHandler
- Since:
- jEdit 4.2pre5
getSymbolicModifierName
public static char getSymbolicModifierName(int mod)
- Returns a the symbolic modifier name for the specified Java modifier
flag.
- Since:
- jEdit 4.1pre3
getModifierString
public static java.lang.String getModifierString(java.awt.event.InputEvent evt)
- Returns a string containing symbolic modifier names set in the
specified event.
- Since:
- jEdit 4.1pre3
parseKeyStroke
public static javax.swing.KeyStroke parseKeyStroke(java.lang.String keyStroke)
- Deprecated. We don't use Swing KeyStrokes anymore.
setCurrentBindings
private void setCurrentBindings(java.util.Hashtable bindings)
_addKeyBinding
public void _addKeyBinding(java.lang.String keyBinding, java.lang.Object action)
- Adds a key binding to this input handler. The key binding is
a list of white space separated key strokes of the form
[modifiers+]key where modifier is C for Control, A for Alt,
or S for Shift, and key is either a character (a-z) or a field
name in the KeyEvent class prefixed with VK_ (e.g., BACK_SPACE)
|
|||||||||
| Home >> All >> org >> gjt >> sp >> jedit >> [ gui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC