/** * Installs a "trigger key" action onto the current text component. * * @param ks The keystroke that should trigger the action. * @see #uninstallTriggerKey() */ private void installTriggerKey(KeyStroke ks) { InputMap im = textComponent.getInputMap(); oldTriggerKey = im.get(ks); im.put(ks, PARAM_TRIGGER_KEY); ActionMap am = textComponent.getActionMap(); oldTriggerAction = am.get(PARAM_TRIGGER_KEY); am.put(PARAM_TRIGGER_KEY, createAutoCompleteAction()); }