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?
请先登录再写评论。
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.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
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?
Dmitry?
Hello Björn,
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.
No, the CompilerConfiguration class doesn't fire any notifications when changed.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
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.