void (final CommittablePanel panel, final DomElement... elements) { final UserActivityWatcher userActivityWatcher = createEditorAwareUserActivityWatcher(); userActivityWatcher.addUserActivityListener(new UserActivityListener() { private boolean isProcessingChange; @Override public void stateChanged() { if (isProcessingChange) return; isProcessingChange = true; try { for (final DomElement element : elements) { ((DomElementAnnotationsManagerImpl)DomElementAnnotationsManager.getInstance(element.getManager().getProject())).outdateProblemHolder(element); } CommittableUtil.updateHighlighting(panel); } finally { isProcessingChange = false; } } }, panel); userActivityWatcher.register(panel.getComponent()); }