Search in sources :

Example 1 with GoToFilePanel

use of com.igormaznitsa.sciareto.ui.misc.GoToFilePanel in project netbeans-mmd-plugin by raydac.

the class MainFrame method menuGoToFileActionPerformed.

// GEN-LAST:event_menuMakeDonationActionPerformed
private void menuGoToFileActionPerformed(java.awt.event.ActionEvent evt) {
    // GEN-FIRST:event_menuGoToFileActionPerformed
    final GoToFilePanel panel = new GoToFilePanel(this.explorerTree, JOptionPane.OK_OPTION);
    if (DialogProviderManager.getInstance().getDialogProvider().msgOkCancel(null, "Go To File", panel)) {
        final NodeFileOrFolder selected = panel.getSelected();
        if (selected != null) {
            final File file = selected.makeFileForNode();
            if (file != null) {
                this.focusInTree(file);
                SwingUtilities.invokeLater(new Runnable() {

                    @Override
                    public void run() {
                        explorerTree.requestFocus();
                    }
                });
            }
        }
    }
}
Also used : GoToFilePanel(com.igormaznitsa.sciareto.ui.misc.GoToFilePanel) NodeFileOrFolder(com.igormaznitsa.sciareto.ui.tree.NodeFileOrFolder) File(java.io.File)

Aggregations

GoToFilePanel (com.igormaznitsa.sciareto.ui.misc.GoToFilePanel)1 NodeFileOrFolder (com.igormaznitsa.sciareto.ui.tree.NodeFileOrFolder)1 File (java.io.File)1