Package org.gjt.sp.jedit.input
Class TextAreaInputHandler
- java.lang.Object
-
- org.gjt.sp.jedit.input.AbstractInputHandler<JEditBeanShellAction>
-
- org.gjt.sp.jedit.input.TextAreaInputHandler
-
public abstract class TextAreaInputHandler extends AbstractInputHandler<JEditBeanShellAction>
This class manage the key bindings and execute the actions binded on the keyboard events for the standalone textarea.
-
-
Field Summary
-
Fields inherited from class org.gjt.sp.jedit.input.AbstractInputHandler
bindings, currentBindings, keyEventInterceptor, lastAction, lastActionCount, PREFIX_STR, readNextChar, REPEAT_COUNT_THRESHOLD, repeatCount, shortcutOn
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TextAreaInputHandler(TextArea textArea)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract JEditBeanShellAction
getAction(java.lang.String action)
boolean
handleKey(KeyEventTranslator.Key keyStroke, boolean dryRun)
Handles the given keystroke.void
invokeAction(java.lang.String action)
Invokes the specified action, repeating and recording it as necessary.void
invokeAction(JEditBeanShellAction action)
Invokes the specified action, repeating and recording it as necessary.protected void
invokeReadNextChar(char ch)
void
processKeyEvent(java.awt.event.KeyEvent evt, int from, boolean global)
Forwards key events directly to the input handler.protected void
userInput(char ch)
-
Methods inherited from class org.gjt.sp.jedit.input.AbstractInputHandler
addKeyBinding, addKeyBinding, addKeyBinding, getKeyBinding, getKeyEventInterceptor, getLastActionCount, isPrefixActive, processKeyEventKeyStrokeHandling, removeAllKeyBindings, removeKeyBinding, resetLastActionCount, sendShortcutPrefixOff, setBindings, setCurrentBindings, setKeyEventInterceptor, toString
-
-
-
-
Constructor Detail
-
TextAreaInputHandler
protected TextAreaInputHandler(TextArea textArea)
-
-
Method Detail
-
processKeyEvent
public void processKeyEvent(java.awt.event.KeyEvent evt, int from, boolean global)
Forwards key events directly to the input handler. This is slightly faster than using a KeyListener because some Swing overhead is avoided.- Specified by:
processKeyEvent
in classAbstractInputHandler<JEditBeanShellAction>
- Parameters:
evt
- the keyboard eventfrom
- the source of the event. Since this is the input handler of the textarea, it should always be 1global
- it is only true if the event comes from the DefaultKeyboardFocusManager- Since:
- 4.3pre7
-
getAction
protected abstract JEditBeanShellAction getAction(java.lang.String action)
-
invokeAction
public void invokeAction(java.lang.String action)
Invokes the specified action, repeating and recording it as necessary.- Specified by:
invokeAction
in classAbstractInputHandler<JEditBeanShellAction>
- Parameters:
action
- The action- Since:
- jEdit 4.2pre1
-
invokeAction
public void invokeAction(JEditBeanShellAction action)
Invokes the specified action, repeating and recording it as necessary.- Specified by:
invokeAction
in classAbstractInputHandler<JEditBeanShellAction>
- Parameters:
action
- The action
-
handleKey
public boolean handleKey(KeyEventTranslator.Key keyStroke, boolean dryRun)
Handles the given keystroke.- Specified by:
handleKey
in classAbstractInputHandler<JEditBeanShellAction>
- Parameters:
keyStroke
- The key strokedryRun
- only calculate the return value, do not have any other effect- Returns:
- true if the input could be handled.
- Since:
- jEdit 4.2pre5
-
userInput
protected void userInput(char ch)
-
invokeReadNextChar
protected void invokeReadNextChar(char ch)
-
-