| |
|
| java.lang.Object java.awt.event.KeyAdapter net.xoetrope.builder.editor.syntaxhighlight.InputHandler
All known Subclasses: net.xoetrope.builder.editor.syntaxhighlight.DefaultInputHandler,
InputHandler | abstract public class InputHandler extends KeyAdapter (Code) | | 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.
author: Slava Pestov version: $Id: InputHandler.java,v 1.22 2005/01/05 17:20:48 luano Exp $ See Also: net.xoetrope.builder.editor.syntaxhighlight.DefaultInputHandler |
Inner Class :public interface NonRepeatable | |
Inner Class :public interface NonRecordable | |
Inner Class :public interface Wrapper | |
Inner Class :public interface MacroRecorder | |
Inner Class :public static class backspace_word implements ActionListener | |
Inner Class :public static class delete_word implements ActionListener | |
Inner Class :public static class document_end implements ActionListener | |
Inner Class :public static class document_home implements ActionListener | |
Inner Class :public static class insert_break implements ActionListener | |
Inner Class :public static class toggle_rect implements ActionListener | |
SMART_HOME_END_PROPERTY | final public static String SMART_HOME_END_PROPERTY(Code) | | 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). By default,
this property is not set.
|
repeat | protected boolean repeat(Code) | | |
repeatCount | protected int repeatCount(Code) | | |
addDefaultKeyBindings | abstract public void addDefaultKeyBindings()(Code) | | Adds the default key bindings to this input handler.
This should not be called in the constructor of this
input handler, because applications might load the
key bindings from a file, etc.
|
addKeyBinding | abstract public void addKeyBinding(String keyBinding, ActionListener action)(Code) | | Adds a key binding to this input handler.
Parameters: keyBinding - The key binding (the format of this isinput-handler specific) Parameters: action - The action |
copy | abstract public InputHandler copy()(Code) | | 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.
|
executeAction | public void executeAction(ActionListener listener, Object source, String actionCommand)(Code) | | Executes the specified action, repeating and recording it as
necessary.
Parameters: listener - The action listener Parameters: source - The event source Parameters: actionCommand - The action command |
getAction | public static ActionListener getAction(String name)(Code) | | Returns a named text area action.
Parameters: name - The action name |
getActionName | public static String getActionName(ActionListener listener)(Code) | | Returns the name of the specified text area action.
Parameters: listener - The action |
getActions | public static Enumeration getActions()(Code) | | Returns an enumeration of all available actions.
|
getMacroRecorder | public InputHandler.MacroRecorder getMacroRecorder()(Code) | | Returns the macro recorder. If this is non-null, all executed
actions should be forwarded to the recorder.
|
getRepeatCount | public int getRepeatCount()(Code) | | Returns the number of times the next action will be repeated.
|
getTextArea | public static JEditTextArea getTextArea(EventObject evt)(Code) | | Returns the text area that fired the specified event.
Parameters: evt - The event |
grabNextKeyStroke | public void grabNextKeyStroke(ActionListener listener)(Code) | | Grabs the next key typed event and invokes the specified
action with the key as a the action command.
Parameters: action - The action |
handleGrabAction | protected void handleGrabAction(KeyEvent evt)(Code) | | If a key is being grabbed, this method should be called with
the appropriate key event. It executes the grab action with
the typed character as the parameter.
|
isRepeatEnabled | public boolean isRepeatEnabled()(Code) | | Returns if repeating is enabled. When repeating is enabled,
actions will be executed multiple times. This is usually
invoked with a special key stroke in the input handler.
|
removeAllKeyBindings | abstract public void removeAllKeyBindings()(Code) | | Removes all key bindings from this input handler.
|
removeKeyBinding | abstract public void removeKeyBinding(String keyBinding)(Code) | | Removes a key binding from this input handler.
Parameters: keyBinding - The key binding |
setMacroRecorder | public void setMacroRecorder(InputHandler.MacroRecorder recorder)(Code) | | Sets the macro recorder. If this is non-null, all executed
actions should be forwarded to the recorder.
Parameters: recorder - The macro recorder |
setRepeatCount | public void setRepeatCount(int repeatCount)(Code) | | Sets the number of times the next action will be repeated.
Parameters: repeatCount - The repeat count |
setRepeatEnabled | public void setRepeatEnabled(boolean repeat)(Code) | | Enables repeating. When repeating is enabled, actions will be
executed multiple times. Once repeating is enabled, the input
handler should read a number from the keyboard.
|
|
|
|