Class DefaultInputHandler
- java.lang.Object
-
- net.sf.gridarta.textedit.textarea.InputHandler
-
- net.sf.gridarta.textedit.textarea.DefaultInputHandler
-
- All Implemented Interfaces:
java.awt.event.KeyListener,java.util.EventListener
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.gridarta.textedit.textarea.InputHandler
InputHandler.NonRepeatable
-
-
Field Summary
-
Fields inherited from class net.sf.gridarta.textedit.textarea.InputHandler
repeatCount
-
-
Constructor Summary
Constructors Constructor Description DefaultInputHandler(@NotNull ScriptEditControl scriptEditControl, @NotNull MenuEntries menuEntries)Creates a new input handler with no key bindings defined.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDefaultKeyBindings()Sets up the default key bindings.InputHandlercopy()Returns a copy of this input handler that shares the same key bindings.voidkeyPressed(java.awt.event.KeyEvent e)Handle a key pressed event.voidkeyReleased(java.awt.event.KeyEvent e)voidkeyTyped(java.awt.event.KeyEvent e)Handle a key typed event.-
Methods inherited from class net.sf.gridarta.textedit.textarea.InputHandler
executeAction, getRepeatCount, getTextArea, handleGrabAction, isRepeatEnabled, setRepeatCount, setRepeatEnabled
-
-
-
-
Constructor Detail
-
DefaultInputHandler
public DefaultInputHandler(@NotNull @NotNull ScriptEditControl scriptEditControl, @NotNull @NotNull MenuEntries menuEntries)Creates a new input handler with no key bindings defined.- Parameters:
scriptEditControl- the script edit control to affectmenuEntries- the menu entries to include in the function list popup
-
-
Method Detail
-
addDefaultKeyBindings
public void addDefaultKeyBindings()
Sets up the default key bindings.- Specified by:
addDefaultKeyBindingsin classInputHandler
-
copy
public InputHandler copy()
Returns a copy of this input handler that shares the same key bindings. Setting key bindings in the copy will also set them in the original.- Specified by:
copyin classInputHandler- Returns:
- copy of this InputHandler
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
Handle a key pressed event. This will look up the binding for the key stroke and execute it.
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)
Handle a key typed event. This inserts the key into the text area.
-
-