protected CodeStyleAbstractPanel(@Nullable Language defaultLanguage, @Nullable CodeStyleSettings currentSettings, @NotNull CodeStyleSettings settings) { Disposer.register(this, myDiffCalculator); myCurrentSettings = currentSettings; mySettings = settings; myDefaultLanguage = defaultLanguage; myEditor = createEditor(); if (myEditor != null) { myUpdateAlarm.setActivationComponent(myEditor.getComponent()); } myUserActivityWatcher.addUserActivityListener(new UserActivityListener() { @Override public void stateChanged() { somethingChanged(); } }); updatePreview(true); }
@Override public void setupErrorOutdatingUserActivityWatcher(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.outdateProblemHolder(element); } CommittableUtil.updateHighlighting(panel); } finally { isProcessingChange = false; } } }, panel); userActivityWatcher.register(panel.getComponent()); }
public void setupErrorOutdatingUserActivityWatcher(final CommittablePanel panel, final DomElement... elements) { final UserActivityWatcher userActivityWatcher = createEditorAwareUserActivityWatcher(); userActivityWatcher.addUserActivityListener(new UserActivityListener() { private boolean isProcessingChange; public void stateChanged() { if (isProcessingChange) return; isProcessingChange = true; try { for (final DomElement element : elements) { DomElementAnnotationsManagerImpl.outdateProblemHolder(element); } CommittableUtil.updateHighlighting(panel); } finally { isProcessingChange = false; } } }, panel); userActivityWatcher.register(panel.getComponent()); }
protected CodeStyleAbstractPanel(@Nullable Language defaultLanguage, @Nullable CodeStyleSettings currentSettings, @Nonnull CodeStyleSettings settings) { Disposer.register(this, myDiffCalculator); myCurrentSettings = currentSettings; mySettings = settings; myDefaultLanguage = defaultLanguage; myEditor = createEditor(); if (myEditor != null) { myUpdateAlarm.setActivationComponent(myEditor.getComponent()); } myUserActivityWatcher.addUserActivityListener(new UserActivityListener() { @Override public void stateChanged() { somethingChanged(); } }); updatePreview(true); }
protected void installWatcher(JComponent c) { myWatcher = new UserActivityWatcher(); myWatcher.register(c); UserActivityListener userActivityListener = new UserActivityListener() { @Override public void stateChanged() { fireEditorStateChanged(); } }; myWatcher.addUserActivityListener(userActivityListener, this); }
@Override public void registerValidator(final FacetEditorValidator validator, JComponent... componentsToWatch) { myValidators.add(validator); final UserActivityWatcher watcher = new UserActivityWatcher(); for (JComponent component : componentsToWatch) { watcher.register(component); } watcher.addUserActivityListener(new UserActivityListener() { @Override public void stateChanged() { validate(); } }); }