isModified is not called after I've changed a text value.

I have following scenario.

I’ve wrote a plugin that have a project component. On configuration panel, among other fields it has a textbox and a button attached to it. When the button is pressed a custom dialog appears. Based on user actions on that custom dialog the value of the text box may change.

My problem is that the even after the text box is changed the <Apply> button is not enable. I’ve checked and the isModified() isn’t called. If I change focus to other component isModified methods gets called and Apply button becomes enabled.

So, my question is: how can I convince idea to check if the configuration was modified?

Actually I'm using a import com.intellij.ui.FieldPanel to implement the textbox + button thing.See the code snippet below:

I’m using idea IU-94.633

        packageIncludesField = new JTextField();
        ActionListener packageIncludesListener = new ActionListener() {
            public void actionPerformed(ActionEvent e) {

                Map<String, Boolean> packagesData = new TreeMap<String, Boolean>();

                SelectPackagesForm dialog = new SelectPackagesForm(packagesData);
                if (dialog.isOK()) {

// various things to make intellj enable <Apply> button
//                boolean isModified = happyTrailsIdeaProjectComponent.isModified();
//      "isModified = %s", isModified));
        final FieldPanel packageIncludesFieldPanel = new FieldPanel(packageIncludesField, null, null,
                packageIncludesListener, null);
        BoxLayout layout = new BoxLayout(packageIncludesPanel, BoxLayout.Y_AXIS);
        this.packageIncludesPanel.add(packageIncludesFieldPanel, BorderLayout.CENTER);

1 comment
Comment actions Permalink

Figured out myself. I sholdn't use Dialog but com.intellij.openapi.ui.DialogWrapper


Please sign in to leave a comment.