Access to the "apply" button in settings
Hi,
I can't find the access point to the "apply" button in the settings dialog. My plugin has a panel under the settings, and I need to enable/disable and add functionality to the "apply" button, when settings are changed.
Joonas
---
Original message URL: http://devnet.jetbrains.net/message/5463717#5463717
Please sign in to leave a comment.
Implementing Configurable Interface and overriding some methods seems to be the solution.
You can find an example project in samples/applicationConfigurable
I have another problem. I'm trying ot use JFileChooser to choose a file and place it in the JTextField, but the isModified method gets called way too early. Somehow the method is called by the fileChooser.showOpenDialog(new JFrame()), which is really unexpected.
I need the isModified method to be called after the file is chosen, not when the dialog is opened. Right now the change is not detected, because my isModified method checks the JTextField for changes, but ofcourse, there are none while opening the dialog. The weirdest part is that the isModified method is accessed by the same Thread which opens the dialog, which means synchronization is ignored. myMethod() -> fileChooser.showOpenDialog(new JFrame()) -> ? -> isModified() -> myMethod(). Is this behaviour intentional?
I Actually have no problem that it accesses the isModified method, but is there a way for me to manually notify something after I update the JTextField, that something has changed?
Don't do that. Use the TextFieldWithBrowseButton component instead.
Also note that the isModified() method will be called repeatedly while the dialog is open. It's correct that the first call of the method will occur before the user has made any changes.
Thanks, I'll look into that.
I was using wrong component for parent, that was the problem.