Example usage for javax.swing.text JTextComponent removeCaretListener

List of usage examples for javax.swing.text JTextComponent removeCaretListener

Introduction

In this page you can find the example usage for javax.swing.text JTextComponent removeCaretListener.

Prototype

public void removeCaretListener(CaretListener listener) 

Source Link

Document

Removes a caret listener.

Usage

From source file:org.executequery.gui.editor.autocomplete.QueryEditorAutoCompletePopupProvider.java

private void resetEditorActions() {

    JTextComponent textComponent = queryEditorTextComponent();

    ActionMap actionMap = textComponent.getActionMap();
    actionMap.remove(LIST_FOCUS_ACTION_KEY);
    actionMap.remove(LIST_SELECTION_ACTION_KEY);
    actionMap.remove(LIST_SCROLL_ACTION_KEY_DOWN);
    actionMap.remove(LIST_SCROLL_ACTION_KEY_UP);

    InputMap inputMap = textComponent.getInputMap();
    inputMap.remove(KEY_STROKE_DOWN);//from  w  w w. ja  va 2 s .c  o m
    inputMap.remove(KEY_STROKE_UP);
    inputMap.remove(KEY_STROKE_PAGE_DOWN);
    inputMap.remove(KEY_STROKE_PAGE_UP);
    inputMap.remove(KEY_STROKE_ENTER);
    inputMap.remove(KEY_STROKE_TAB);

    inputMap.put(KEY_STROKE_DOWN, existingKeyStrokeDownAction);
    inputMap.put(KEY_STROKE_UP, existingKeyStrokeUpAction);
    inputMap.put(KEY_STROKE_PAGE_DOWN, existingKeyStrokePageDownAction);
    inputMap.put(KEY_STROKE_PAGE_UP, existingKeyStrokePageUpAction);
    inputMap.put(KEY_STROKE_TAB, existingKeyStrokeTabAction);
    inputMap.put(KEY_STROKE_ENTER, existingKeyStrokeEnterAction);

    textComponent.removeCaretListener(this);
}