How to close FileChooser dialog from FileChooserToolbar action [SOLVED]

I have made an action to quickly create a new project in the FileChooser dialog, and I would like to immediately open it, but the problem is that the dialog stays opened...I have no idea how could I possibly close it.

        <action id="UsefulActions.QuickCreteProject"                                  text="Quick Create Project"                 >             <add-to-group group-id="FileChooserToolbar" anchor="first"/>         </action>

source: https://github.com/krasa/UsefulActions/blob/master/src/krasa/usefulactions/QuickCreateProject.java

1 comment
Comment actions Permalink

Solved:
        Component c = e.getData(PlatformDataKeys.CONTEXT_COMPONENT);
        final DialogWrapper instance = DialogWrapper.findInstance(c);
        if (instance != null) {
            instance.close(0);
        }

0

Please sign in to leave a comment.