org.xnap.commons.gui.shortcut
Class EmacsKeyBindings

java.lang.Object
  extended by org.xnap.commons.gui.shortcut.EmacsKeyBindings

public class EmacsKeyBindings
extends Object

Generic class which activates Emacs keybindings for java input JTextComponents. The inner class actions can also be used independently.

Author:
Felix Berger

Nested Class Summary
static class EmacsKeyBindings.BackwardKillWordAction
          This action kills the previous word.
static class EmacsKeyBindings.CapitalizeWordAction
          This action capitalizes the next word on the right side of the caret.
static class EmacsKeyBindings.DowncaseWordAction
          This action renders all characters of the next word to lowercase.
static class EmacsKeyBindings.KillLineAction
          This actin kills text up to the end of the current line and stores it in the killring.
static class EmacsKeyBindings.KillRegionAction
          This action Kills the marked region and stores it in the killring.
static class EmacsKeyBindings.KillRing
          Manages all killed (cut) text pieces in a ring which is accessible through EmacsKeyBindings.YankPopAction.
static class EmacsKeyBindings.KillRingSaveAction
          This action copies the marked region and stores it in the killring.
static class EmacsKeyBindings.KillWordAction
          This action kills the next word.
static class EmacsKeyBindings.SetMarkCommandAction
          This action sets a beginning mark for a selection.
static class EmacsKeyBindings.UpcaseWordAction
          This action renders all characters of the next word to upppercase.
static class EmacsKeyBindings.YankAction
          This action pastes text from the killring.
static class EmacsKeyBindings.YankPopAction
          This action pastes an element from the killring cycling through it.
 
Field Summary
static String backwardKillWordAction
           
static String capitalizeWordAction
           
static String downcaseWordAction
           
static JTextComponent.KeyBinding[] EMACS_KEY_BINDINGS
           
static String killLineAction
           
static String killRegionAction
           
static String killRingSaveAction
           
static String killWordAction
           
static String setMarkCommandAction
           
static String upcaseWordAction
           
static String yankAction
           
static String yankPopAction
           
 
Constructor Summary
EmacsKeyBindings()
           
 
Method Summary
static void load()
          Loads the emacs keybindings for all common JTextComponents.
static void unload()
          Restores the original keybindings for the concrete subclasses of JTextComponent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

killLineAction

public static final String killLineAction
See Also:
Constant Field Values

killRingSaveAction

public static final String killRingSaveAction
See Also:
Constant Field Values

killRegionAction

public static final String killRegionAction
See Also:
Constant Field Values

backwardKillWordAction

public static final String backwardKillWordAction
See Also:
Constant Field Values

capitalizeWordAction

public static final String capitalizeWordAction
See Also:
Constant Field Values

downcaseWordAction

public static final String downcaseWordAction
See Also:
Constant Field Values

killWordAction

public static final String killWordAction
See Also:
Constant Field Values

setMarkCommandAction

public static final String setMarkCommandAction
See Also:
Constant Field Values

yankAction

public static final String yankAction
See Also:
Constant Field Values

yankPopAction

public static final String yankPopAction
See Also:
Constant Field Values

upcaseWordAction

public static final String upcaseWordAction
See Also:
Constant Field Values

EMACS_KEY_BINDINGS

public static final JTextComponent.KeyBinding[] EMACS_KEY_BINDINGS
Constructor Detail

EmacsKeyBindings

public EmacsKeyBindings()
Method Detail

load

public static void load()
Loads the emacs keybindings for all common JTextComponents. The shared keymap instances of the concrete subclasses of JTextComponent are fed with the keybindings. The original keybindings are stored in a backup array.


unload

public static void unload()
Restores the original keybindings for the concrete subclasses of JTextComponent.



Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.