UserActivityWatcher () { return new UserActivityWatcher() { private final DocumentListener myListener = new DocumentListener() { @Override public void documentChanged(@NotNull DocumentEvent e) { fireUIChanged(); } }; @Override protected void processComponent(final Component component) { super.processComponent(component); if (component instanceof EditorComponentImpl) { ((EditorComponentImpl)component).getEditor().getDocument().addDocumentListener(myListener); } } @Override protected void unprocessComponent(final Component component) { super.unprocessComponent(component); if (component instanceof EditorComponentImpl) { ((EditorComponentImpl)component).getEditor().getDocument().removeDocumentListener(myListener); } } }; }