List of usage examples for javax.swing.text JTextComponent getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:net.sf.jabref.gui.keyboard.EmacsKeyBindings.java
private static void createBackup() { Keymap oldBackup = JTextComponent.getKeymap(EmacsKeyBindings.JTCS[0].getClass().getName()); if (oldBackup != null) { // if there is already a backup, do not create a new backup return;//from ww w . ja v a 2s .c o m } for (JTextComponent jtc : EmacsKeyBindings.JTCS) { Keymap orig = jtc.getKeymap(); Keymap backup = JTextComponent.addKeymap(jtc.getClass().getName(), null); Action[] bound = orig.getBoundActions(); for (Action aBound : bound) { KeyStroke[] strokes = orig.getKeyStrokesForAction(aBound); for (KeyStroke stroke : strokes) { backup.addActionForKeyStroke(stroke, aBound); } } backup.setDefaultAction(orig.getDefaultAction()); } }