|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.event.KeyAdapter processing.app.syntax.InputHandler
public abstract class InputHandler
An input handler converts the user's key strokes into concrete actions. It also takes care of macro recording and action repetition.
This class provides all the necessary support code for an input handler, but doesn't actually do any key binding logic. It is up to the implementations of this class to do so.
Nested Class Summary | |
---|---|
static class |
InputHandler.backspace
|
static class |
InputHandler.backspace_word
|
static class |
InputHandler.delete
|
static class |
InputHandler.delete_word
|
static class |
InputHandler.document_end
|
static class |
InputHandler.document_home
|
static class |
InputHandler.end
|
static class |
InputHandler.home
|
static class |
InputHandler.insert_break
|
static class |
InputHandler.insert_char
|
static class |
InputHandler.insert_tab
|
static interface |
InputHandler.MacroRecorder
Macro recorder. |
static class |
InputHandler.next_char
|
static class |
InputHandler.next_line
|
static class |
InputHandler.next_page
|
static class |
InputHandler.next_word
|
static interface |
InputHandler.NonRecordable
If an action implements this interface, it should not be recorded by the macro recorder. |
static interface |
InputHandler.NonRepeatable
If an action implements this interface, it should not be repeated. |
static class |
InputHandler.overwrite
|
static class |
InputHandler.prev_char
|
static class |
InputHandler.prev_line
|
static class |
InputHandler.prev_page
|
static class |
InputHandler.prev_word
|
static class |
InputHandler.repeat
|
static class |
InputHandler.toggle_rect
|
static interface |
InputHandler.Wrapper
For use by EditAction.Wrapper only. |
Field Summary | |
---|---|
static java.awt.event.ActionListener |
BACKSPACE
|
static java.awt.event.ActionListener |
BACKSPACE_WORD
|
static java.awt.event.ActionListener |
DELETE
|
static java.awt.event.ActionListener |
DELETE_WORD
|
static java.awt.event.ActionListener |
DOCUMENT_END
|
static java.awt.event.ActionListener |
DOCUMENT_HOME
|
static java.awt.event.ActionListener |
END
|
static java.awt.event.ActionListener |
HOME
|
static java.awt.event.ActionListener |
INSERT_BREAK
|
static java.awt.event.ActionListener |
INSERT_CHAR
|
static java.awt.event.ActionListener |
INSERT_TAB
|
static java.awt.event.ActionListener |
NEXT_CHAR
|
static java.awt.event.ActionListener |
NEXT_LINE
|
static java.awt.event.ActionListener |
NEXT_PAGE
|
static java.awt.event.ActionListener |
NEXT_WORD
|
static java.awt.event.ActionListener |
OVERWRITE
|
static java.awt.event.ActionListener |
PREV_CHAR
|
static java.awt.event.ActionListener |
PREV_LINE
|
static java.awt.event.ActionListener |
PREV_PAGE
|
static java.awt.event.ActionListener |
PREV_WORD
|
static java.awt.event.ActionListener |
REPEAT
|
static java.awt.event.ActionListener |
SELECT_DOC_END
|
static java.awt.event.ActionListener |
SELECT_DOC_HOME
|
static java.awt.event.ActionListener |
SELECT_END
|
static java.awt.event.ActionListener |
SELECT_HOME
|
static java.awt.event.ActionListener |
SELECT_NEXT_CHAR
|
static java.awt.event.ActionListener |
SELECT_NEXT_LINE
|
static java.awt.event.ActionListener |
SELECT_NEXT_PAGE
|
static java.awt.event.ActionListener |
SELECT_NEXT_WORD
|
static java.awt.event.ActionListener |
SELECT_PREV_CHAR
|
static java.awt.event.ActionListener |
SELECT_PREV_LINE
|
static java.awt.event.ActionListener |
SELECT_PREV_PAGE
|
static java.awt.event.ActionListener |
SELECT_PREV_WORD
|
static java.lang.String |
SMART_HOME_END_PROPERTY
If this client property is set to Boolean.TRUE on the text area, the home/end keys will support 'smart' BRIEF-like behaviour (one press = start/end of line, two presses = start/end of viewscreen, three presses = start/end of document). |
static java.awt.event.ActionListener |
TOGGLE_RECT
|
Constructor Summary | |
---|---|
InputHandler()
|
Method Summary | |
---|---|
abstract void |
addDefaultKeyBindings()
Adds the default key bindings to this input handler. |
abstract void |
addKeyBinding(java.lang.String keyBinding,
java.awt.event.ActionListener action)
Adds a key binding to this input handler. |
abstract InputHandler |
copy()
Returns a copy of this input handler that shares the same key bindings. |
void |
executeAction(java.awt.event.ActionListener listener,
java.lang.Object source,
java.lang.String actionCommand)
Executes the specified action, repeating and recording it as necessary. |
static java.awt.event.ActionListener |
getAction(java.lang.String name)
Returns a named text area action. |
static java.lang.String |
getActionName(java.awt.event.ActionListener listener)
Returns the name of the specified text area action. |
static java.util.Enumeration |
getActions()
Returns an enumeration of all available actions. |
InputHandler.MacroRecorder |
getMacroRecorder()
Returns the macro recorder. |
int |
getRepeatCount()
Returns the number of times the next action will be repeated. |
static JEditTextArea |
getTextArea(java.util.EventObject evt)
Returns the text area that fired the specified event. |
void |
grabNextKeyStroke(java.awt.event.ActionListener listener)
Grabs the next key typed event and invokes the specified action with the key as a the action command. |
boolean |
isRepeatEnabled()
Returns if repeating is enabled. |
abstract void |
removeAllKeyBindings()
Removes all key bindings from this input handler. |
abstract void |
removeKeyBinding(java.lang.String keyBinding)
Removes a key binding from this input handler. |
void |
setMacroRecorder(InputHandler.MacroRecorder recorder)
Sets the macro recorder. |
void |
setRepeatCount(int repeatCount)
Sets the number of times the next action will be repeated. |
void |
setRepeatEnabled(boolean repeat)
Enables repeating. |
Methods inherited from class java.awt.event.KeyAdapter |
---|
keyPressed, keyReleased, keyTyped |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SMART_HOME_END_PROPERTY
public static final java.awt.event.ActionListener BACKSPACE
public static final java.awt.event.ActionListener BACKSPACE_WORD
public static final java.awt.event.ActionListener DELETE
public static final java.awt.event.ActionListener DELETE_WORD
public static final java.awt.event.ActionListener END
public static final java.awt.event.ActionListener DOCUMENT_END
public static final java.awt.event.ActionListener SELECT_END
public static final java.awt.event.ActionListener SELECT_DOC_END
public static final java.awt.event.ActionListener INSERT_BREAK
public static final java.awt.event.ActionListener INSERT_TAB
public static final java.awt.event.ActionListener HOME
public static final java.awt.event.ActionListener DOCUMENT_HOME
public static final java.awt.event.ActionListener SELECT_HOME
public static final java.awt.event.ActionListener SELECT_DOC_HOME
public static final java.awt.event.ActionListener NEXT_CHAR
public static final java.awt.event.ActionListener NEXT_LINE
public static final java.awt.event.ActionListener NEXT_PAGE
public static final java.awt.event.ActionListener NEXT_WORD
public static final java.awt.event.ActionListener SELECT_NEXT_CHAR
public static final java.awt.event.ActionListener SELECT_NEXT_LINE
public static final java.awt.event.ActionListener SELECT_NEXT_PAGE
public static final java.awt.event.ActionListener SELECT_NEXT_WORD
public static final java.awt.event.ActionListener OVERWRITE
public static final java.awt.event.ActionListener PREV_CHAR
public static final java.awt.event.ActionListener PREV_LINE
public static final java.awt.event.ActionListener PREV_PAGE
public static final java.awt.event.ActionListener PREV_WORD
public static final java.awt.event.ActionListener SELECT_PREV_CHAR
public static final java.awt.event.ActionListener SELECT_PREV_LINE
public static final java.awt.event.ActionListener SELECT_PREV_PAGE
public static final java.awt.event.ActionListener SELECT_PREV_WORD
public static final java.awt.event.ActionListener REPEAT
public static final java.awt.event.ActionListener TOGGLE_RECT
public static final java.awt.event.ActionListener INSERT_CHAR
Constructor Detail |
---|
public InputHandler()
Method Detail |
---|
public static java.awt.event.ActionListener getAction(java.lang.String name)
name
- The action namepublic static java.lang.String getActionName(java.awt.event.ActionListener listener)
listener
- The actionpublic static java.util.Enumeration getActions()
public abstract void addDefaultKeyBindings()
public abstract void addKeyBinding(java.lang.String keyBinding, java.awt.event.ActionListener action)
keyBinding
- The key binding (the format of this is
input-handler specific)action
- The actionpublic abstract void removeKeyBinding(java.lang.String keyBinding)
keyBinding
- The key bindingpublic abstract void removeAllKeyBindings()
public void grabNextKeyStroke(java.awt.event.ActionListener listener)
public boolean isRepeatEnabled()
public void setRepeatEnabled(boolean repeat)
public int getRepeatCount()
public void setRepeatCount(int repeatCount)
repeatCount
- The repeat countpublic InputHandler.MacroRecorder getMacroRecorder()
public void setMacroRecorder(InputHandler.MacroRecorder recorder)
recorder
- The macro recorderpublic abstract InputHandler copy()
public void executeAction(java.awt.event.ActionListener listener, java.lang.Object source, java.lang.String actionCommand)
listener
- The action listenersource
- The event sourceactionCommand
- The action commandpublic static JEditTextArea getTextArea(java.util.EventObject evt)
evt
- The event
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |