Examples of FileChooserBuilder


Examples of org.openide.filesystems.FileChooserBuilder

        if (!initialDialog || DialogDescriptor.OK_OPTION.equals( DialogDisplayer.getDefault().notify( new NotifyDescriptor.Confirmation( msg, title ) ) )) {
            String approve = NbBundle.getMessage( Npm.class, "APPROVE_FIND_NPM" );

            File[] roots = File.listRoots();

            FileChooserBuilder bldr = new FileChooserBuilder( Npm.class ).setApproveText( approve ).setFilesOnly( true ).setFileFilter( new javax.swing.filechooser.FileFilter() {
                @Override
                public boolean accept ( File f ) {
                    return f.isDirectory() || f.isFile() && f.canExecute();
                }

                @Override
                public String getDescription () {
                    return null;
                }
            } ).setTitle( title );
            if (roots.length > 0) {
                bldr.setDefaultWorkingDirectory( roots[0] );
            }

            File f = bldr.showOpenDialog();
            return f == null || !f.exists() ? null : f.getAbsolutePath();
        }
        return null;
    }
View Full Code Here

Examples of org.openide.filesystems.FileChooserBuilder

        }
        return null;
    }

    public String askUserForExecutableLocation () {
        File f = new FileChooserBuilder( DefaultExecutable.class ).setTitle( NbBundle.getMessage( DefaultExecutable.class, "LOCATE_EXECUTABLE" ) ).setFilesOnly( true ).setApproveText( NbBundle.getMessage( DefaultExecutable.class, "LOCATE_EXECUTABLE_APPROVE" ) ).showOpenDialog();
        return f == null ? null : f.getAbsolutePath();
    }
View Full Code Here

Examples of org.openide.filesystems.FileChooserBuilder

            binaryField.setText( s );
        }
    }//GEN-LAST:event_browseButtonActionPerformed

    private void browseForSourcesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseForSourcesActionPerformed
        File where = new FileChooserBuilder( NodePanel.class ).setApproveText( NbBundle.getMessage( NodePanel.class, "BROWSE_FOR_SOURCES_APPROVE" ) ).setTitle( NbBundle.getMessage( NodePanel.class, "BROWSE_FOR_SOURCES" ) ).showOpenDialog();
        if (where != null) {
            sourcesField.setText( where.getAbsolutePath() );
        }
    }//GEN-LAST:event_browseForSourcesActionPerformed
View Full Code Here

Examples of org.openide.filesystems.FileChooserBuilder

    }//GEN-LAST:event_browseForSourcesActionPerformed
    private static volatile boolean downloading;

    private void downloadSources(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_downloadSources
        downloadButton.setEnabled( false );
        final File targetDir = new FileChooserBuilder( NodePanel.class.getName() + "_sources" ).setDirectoriesOnly( true ).setTitle( NbBundle.getMessage( NodePanel.class, "DOWNLOAD_FOLDER" ) ).showOpenDialog();
        String destName;
        if (!new File( targetDir, "node" ).exists()) {
            destName = "node";
        } else {
            int ix = 0;
View Full Code Here

Examples of org.openide.filesystems.FileChooserBuilder

    private void createInFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_createInFieldFocusGained
        createInField.selectAll();
    }//GEN-LAST:event_createInFieldFocusGained

    private void onBrowse(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onBrowse
        File dir = new FileChooserBuilder( ProjectWizardPanel.class ).setDirectoriesOnly( true ).setTitle( NbBundle.getMessage( ProjectWizardPanel.class, "TTL_BrowseProjectLocation" ) ).showOpenDialog();
        if (dir != null) {
            createInField.setText( dir.getAbsolutePath() );
        }
    }//GEN-LAST:event_onBrowse
View Full Code Here

Examples of org.openide.filesystems.FileChooserBuilder

    }

    private void jBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBrowseButtonActionPerformed
        File initialDir = project.getAvailableModel().getRootProjectDir();

        FileChooserBuilder dlgChooser = new FileChooserBuilder(
                LicenseHeaderPanel.class.getName() + "-" + initialDir.getName());
        dlgChooser.setDefaultWorkingDirectory(initialDir);

        File f = dlgChooser.showOpenDialog();
        if (f == null || f.isDirectory()) {
            return;
        }

        File file = f.getAbsoluteFile();
View Full Code Here

Examples of org.openide.filesystems.FileChooserBuilder

                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jBrowsePathButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBrowsePathButtonActionPerformed
        FileChooserBuilder dlgChooser = new FileChooserBuilder(GradleSettingsPanel.class);
        dlgChooser.setDirectoriesOnly(true);
        File f = dlgChooser.showOpenDialog();
        if (f != null && f.isDirectory()) {
            File file = f.getAbsoluteFile();
            jGradlePathEdit.setText(file.toString());
        }
    }//GEN-LAST:event_jBrowsePathButtonActionPerformed
View Full Code Here

Examples of org.openide.filesystems.FileChooserBuilder

            jGradlePathEdit.setText(file.toString());
        }
    }//GEN-LAST:event_jBrowsePathButtonActionPerformed

    private void jBrowseUserHomeDirButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBrowseUserHomeDirButtonActionPerformed
        FileChooserBuilder dlgChooser = new FileChooserBuilder(GradleSettingsPanel.class);
        dlgChooser.setDirectoriesOnly(true);

        File f = dlgChooser.showOpenDialog();
        if (f != null && f.isDirectory()) {
            File file = f.getAbsoluteFile();
            jGradleUserHomeEdit.setText(file.toString());
        }
    }//GEN-LAST:event_jBrowseUserHomeDirButtonActionPerformed
View Full Code Here

Examples of org.openide.filesystems.FileChooserBuilder

        }
    }//GEN-LAST:event_wpCliSearchButtonActionPerformed

    @NbBundle.Messages("WordPressOptionsPanel.browse.title=Select wp-cli script")
    private void wpCliBrowseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_wpCliBrowseButtonActionPerformed
        File wp = new FileChooserBuilder(WordPressOptionsPanel.class.getName() + WP_CLI_LAST_FOLDER_SUFFIX)
                .setTitle(Bundle.WordPressOptionsPanel_browse_title())
                .setFilesOnly(true)
                .showOpenDialog();
        if (wp != null) {
            wp = FileUtil.normalizeFile(wp);
View Full Code Here

Examples of org.openide.filesystems.FileChooserBuilder

        );
    }// </editor-fold>//GEN-END:initComponents

    @NbBundle.Messages("LBL_LocalFilePath=Local file path")
    private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
        File localFile = new FileChooserBuilder(WordPressOptionsPanel.class.getName())
                .setTitle(Bundle.LBL_LocalFilePath())
                .setFilesOnly(true)
                .showOpenDialog();
        if (localFile != null) {
            setLocalPath(localFile.getAbsolutePath());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.