private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed File attachment = new FileChooserBuilder(AttachmentPanel.class).showOpenDialog(); if (attachment != null) { attachment = FileUtil.normalizeFile(attachment); fileField.setText(attachment.getAbsolutePath()); } }//GEN-LAST:event_browseButtonActionPerformed
@Override public File showOpenDialog(){ super.setFileFilter(createSwingFileFilter(allExtensions, "All supported files")); return super.showOpenDialog(); }
private void browseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseActionPerformed // TODO add your handling code here: String dlgTitle = NbBundle.getMessage(DefaultProjectCopyPanel.class, "TITLE_BrowseProjectLocation"); String okText = NbBundle.getMessage(DefaultProjectCopyPanel.class, "LBL_BrowseProjectLocation_OK_Button"); File dir = new FileChooserBuilder(DefaultProjectCopyPanel.class).setDefaultWorkingDirectory( new File(projectLocation.getText())).setDirectoriesOnly( true).setTitle(dlgTitle).setApproveText(okText).showOpenDialog(); if (dir != null) { projectLocation.setText(dir.getAbsolutePath()); } }//GEN-LAST:event_browseActionPerformed
@NbBundle.Messages("LessOptionsPanel.less.browse.title=Select LESS") private void lessPathBrowseButtonActionPerformed(ActionEvent evt) {//GEN-FIRST:event_lessPathBrowseButtonActionPerformed File file = new FileChooserBuilder(LessOptionsPanel.class) .setFilesOnly(true) .setTitle(Bundle.LessOptionsPanel_less_browse_title()) .showOpenDialog(); if (file != null) { lessPathTextField.setText(file.getAbsolutePath()); } }//GEN-LAST:event_lessPathBrowseButtonActionPerformed
@NbBundle.Messages("SassOptionsPanel.browse.title=Select Sass") private void sassPathBrowseButtonActionPerformed(ActionEvent evt) {//GEN-FIRST:event_sassPathBrowseButtonActionPerformed File file = new FileChooserBuilder(SassOptionsPanel.class) .setFilesOnly(true) .setTitle(Bundle.SassOptionsPanel_browse_title()) .showOpenDialog(); if (file != null) { sassPathTextField.setText(file.getAbsolutePath()); } }//GEN-LAST:event_sassPathBrowseButtonActionPerformed
private void locationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_locationButtonActionPerformed FileChooserBuilder builder = new FileChooserBuilder(PatchContextChooser.class); File file = builder.setApproveText(NbBundle.getMessage(PatchContextChooser.class, "LBL_Select")).showOpenDialog(); if (file != null) { FileObject fob = FileUtil.toFileObject(file); locationField.setText(FileUtil.getFileDisplayName(fob)); } }//GEN-LAST:event_locationButtonActionPerformed
private void chooseDocButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chooseDocButtonActionPerformed File file = new FileChooserBuilder(SupportPanel.class) .setDirectoriesOnly(true) .setDefaultWorkingDirectory(null) .setTitle(NbBundle.getMessage(SupportPanel.class, "LBL_Select_Directory")) .setApproveText(NbBundle.getMessage(SupportPanel.class, "LBL_Select_Directory")) .showOpenDialog(); if (file != null) { if (!new File(new File(file, "groovy-jdk"), "index.html").isFile()) { DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message( NbBundle.getMessage(SupportPanel.class, "LBL_Not_groovy_doc"), NotifyDescriptor.Message.WARNING_MESSAGE)); return; } groovyDocTextField.setText(file.getAbsolutePath()); } }//GEN-LAST:event_chooseDocButtonActionPerformed
@NbBundle.Messages("TypeScriptOptionsPanel.browse.title=Select TypeScript") private void tscPathBrowseButtonActionPerformed(ActionEvent evt) {//GEN-FIRST:event_tscPathBrowseButtonActionPerformed File file = new FileChooserBuilder(TypeScriptOptionsPanel.class) .setFilesOnly(true) .setTitle(Bundle.TypeScriptOptionsPanel_browse_title()) .showOpenDialog(); if (file != null) { tscPathTextField.setText(file.getAbsolutePath()); } }//GEN-LAST:event_tscPathBrowseButtonActionPerformed
private void chooseDirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chooseDirActionPerformed File file = new FileChooserBuilder(GrailsRuntimePanel.class) .setDirectoriesOnly(true) .setDefaultWorkingDirectory(new File(System.getProperty("user.home"))) .setApproveText(NbBundle.getMessage(GrailsRuntimePanel.class, "LBL_Select_Directory")) .setTitle(NbBundle.getMessage(GrailsRuntimePanel.class, "LBL_Select_Directory")) .showOpenDialog(); if (file != null && RuntimeHelper.isValidRuntime(file)) { grailsHomeLocation.setText(file.getAbsolutePath()); } else if (file != null) { displayGrailsHomeWarning(); } }//GEN-LAST:event_chooseDirActionPerformed
private File browseFile(String dirKey, String title, String currentDirectory) { File workDir = null; if (currentDirectory != null && !currentDirectory.isEmpty()) { File currDir = new File(currentDirectory); if (currDir.isDirectory()) { workDir = currDir; } } FileChooserBuilder builder = new FileChooserBuilder(NewClientSideProject.class.getName() + dirKey) .setTitle(title) .setDirectoriesOnly(true); if (workDir != null) { builder.setDefaultWorkingDirectory(workDir) .forceUseOfDefaultWorkingDirectory(true); } return builder.showOpenDialog(); }
private String browse(final String title) { File f; if ((f = new FileChooserBuilder(DetectPanel.class). setFileFilter(new BrowseFilter()). setTitle(title).showOpenDialog()) != null) { return f.getAbsolutePath(); } return null; }
private String browse(final String title) { File f; if ((f = new FileChooserBuilder(SrcDocPathsPanel.class). setFileFilter(new ArchiveFilter()). setTitle(title).showOpenDialog()) != null) { return f.getAbsolutePath(); } return null; }
private String browseFolder(final String title) { File defPath = platform.getHomePath() == null ? null : new File(platform.getHomePath()); File f; if ((f = new FileChooserBuilder (getClass().getName() + ".fld"). setFileFilter(new FolderFilter()).setTitle(title). setDefaultWorkingDirectory(defPath).showOpenDialog()) != null) { return f.getAbsolutePath(); } return null; }
private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed File selectedFile = new FileChooserBuilder(RunFilePanel.class) .setTitle(NbBundle.getMessage(RunFilePanel.class, "LBL_SelectWorkingDirectory")) .setDirectoriesOnly(true) .forceUseOfDefaultWorkingDirectory(true) .setDefaultWorkingDirectory(new File(createRunConfig().getWorkDir())) .showOpenDialog(); if (selectedFile != null) { File workDir = FileUtil.normalizeFile(selectedFile); workDirField.setText(workDir.getAbsolutePath()); } }//GEN-LAST:event_browseButtonActionPerformed
private String browseFolder(final String title) { File f; if ((f = new FileChooserBuilder(CommandLinesPanel.class).setTitle(title). setDirectoriesOnly(true).setFileFilter(new FolderFilter()).showOpenDialog()) != null) { return f.getAbsolutePath(); } return null; }
private String browseArchive(final String title) { File f; if ((f = new FileChooserBuilder(CustomizerPanel.class). setFilesOnly(true).setFileFilter(new ArchiveFilter()). setTitle(title).showOpenDialog()) != null) { return f.getAbsolutePath(); } return null; }
private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed File file = new FileChooserBuilder(SiteZipPanel.class.getName()) .setTitle(Bundle.LBL_SiteZipPanel_Title()) .setFilesOnly(true) .setApproveText(Bundle.LBL_SiteZipPanel_Select()) .showOpenDialog(); if (file != null) { ((JTextField)(archiveComboBox.getEditor().getEditorComponent())).setText(file.getAbsolutePath()); } }//GEN-LAST:event_browseButtonActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed if (searchTask != null && !searchTask.isFinished()) return; String aDescription = NbBundle.getMessage(FindPanel.class, "AD_LocationChooser"); //NOI18N String title = NbBundle.getMessage(FindPanel.class, "Title_FindPanel_Choose_To_Search"); //NOI18N Badger badger = new Badger(); File dir; if ((dir = new FileChooserBuilder(getClass().getName()).setDirectoriesOnly(true). setTitle(title). setAccessibleDescription(aDescription). setBadgeProvider(badger). setDefaultWorkingDirectory(File.listRoots().length > 0 ? File.listRoots()[0] : null). setFileFilter(badger).showOpenDialog()) != null) { searchRunnable = new SearchRunnable(this, dir, -1); jButton1.setEnabled(false); showError(NbBundle.getMessage(FindPanel.class, "WARN_SearchInProgress"));//NOI18N searchTask = RequestProcessor.getDefault().post(searchRunnable); } }//GEN-LAST:event_jButton1ActionPerformed
public static File browseTestSources(JTextField textField, PhpProject phpProject) { File selectedFile = new FileChooserBuilder(LastUsedFolders.TEST_DIR) .setTitle(NbBundle.getMessage(Utils.class, "LBL_SelectUnitTestFolder", ProjectUtils.getInformation(phpProject).getDisplayName())) .setDirectoriesOnly(true) .setDefaultWorkingDirectory(FileUtil.toFile(phpProject.getProjectDirectory())) .forceUseOfDefaultWorkingDirectory(true) .showOpenDialog(); if (selectedFile != null) { selectedFile = FileUtil.normalizeFile(selectedFile); if (textField != null) { textField.setText(selectedFile.getAbsolutePath()); } } return selectedFile; }
private static File browseAction(String dirKey, String title, boolean filesOnly, File workDir) { FileChooserBuilder builder = new FileChooserBuilder(dirKey) .setTitle(title); if (workDir != null) { builder.setDefaultWorkingDirectory(workDir) .forceUseOfDefaultWorkingDirectory(true); } if (filesOnly) { builder.setFilesOnly(true); } else { builder.setDirectoriesOnly(true); } File selectedFile = builder.showOpenDialog(); if (selectedFile != null) { return FileUtil.normalizeFile(selectedFile); } return null; }