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;
}