How to listen for changed settings

Is there a way to listen for changed settings of other components?
To be exact, if someone clicks Apply after changing Compiler settings, I want to see and react on this in my own Configurable.
Is this possible somehow without a timer that regularly pulls the values and looks whether they have changed?

5 comments
Comment actions Permalink

Hello Björn,

Some specific components fire notifications when their settings are changed,
but there is no general API to listen to changes in a specific component.

Is there a way to listen for changed settings of other components?

To be exact, if someone clicks Apply after changing Compiler settings,
I want to see and react on this in my own Configurable.

Is this possible somehow without a timer that regularly pulls the
values and looks whether they have changed?


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Oh, too bad, maybe this should be changed.
IntelliJ could always fire a settings changed after it called an apply() method automatically. It could even supply the Configurable which settings were applied.

And I guess the Compiler settings are not one of those components that fire some event if their settings are changed?

0
Comment actions Permalink

Hello Björn,

Oh, too bad, maybe this should be changed.
IntelliJ could always fire a settings changed after it called an
apply() method automatically. It could even supply the Configurable
which settings were applied.


Since there can be many ways of changing the settings, not only through the
Settings dialog, I don't think it would be a particularly good design to
implement such a listener for the dialog.

And I guess the Compiler settings are not one of those components that
fire some event if their settings are changed?


No, the CompilerConfiguration class doesn't fire any notifications when changed.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thanks Dmitry,
I would have needed this because I display a warning about a setting that doesn't display nicely with a functionality. And if the setting is changed, there is no real way to update this display, except when overwriting the paint method and make the check there.
For now I just update the display if any action is done on the settings pane.

0

Please sign in to leave a comment.