This is an automated email from the ASF dual-hosted git repository. neilcsmith pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push: new ca50591 Allow File chooser for non-project New File Wizard new 1b12c2b Merge pull request #2219 from SiddheshRane/master ca50591 is described below commit ca50591eaa2f3f8095f28a82eeb837c11f57a456 Author: Siddhesh Rane <siddheshdr...@yahoo.com> AuthorDate: Sun Jun 28 22:53:29 2020 -0400 Allow File chooser for non-project New File Wizard --- .../modules/project/ui/SimpleTargetChooserPanelGUI.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ide/projectui/src/org/netbeans/modules/project/ui/SimpleTargetChooserPanelGUI.java b/ide/projectui/src/org/netbeans/modules/project/ui/SimpleTargetChooserPanelGUI.java index 459f51d..3ed00e1 100644 --- a/ide/projectui/src/org/netbeans/modules/project/ui/SimpleTargetChooserPanelGUI.java +++ b/ide/projectui/src/org/netbeans/modules/project/ui/SimpleTargetChooserPanelGUI.java @@ -493,10 +493,10 @@ public class SimpleTargetChooserPanelGUI extends javax.swing.JPanel implements A //non project space String previousTargetFolder = getTargetFolder(); //can be relative or absolute.. SourceGroup group = (SourceGroup)locationComboBox.getSelectedItem(); - if (group == null) { // #161478 - return; + FileObject oldFo = null; + if (group != null) { + oldFo = previousTargetFolder != null ? group.getRootFolder().getFileObject(previousTargetFolder) : group.getRootFolder(); } - FileObject oldFo = previousTargetFolder != null ? group.getRootFolder().getFileObject(previousTargetFolder) : group.getRootFolder(); if (oldFo == null && previousTargetFolder != null) { oldFo = FileUtil.toFileObject(FileUtil.normalizeFile(new File(previousTargetFolder))); } @@ -506,13 +506,13 @@ public class SimpleTargetChooserPanelGUI extends javax.swing.JPanel implements A new FileChooserBuilder(SimpleTargetChooserPanel.class) .setDirectoriesOnly(true) .setDefaultWorkingDirectory(currFile) - .forceUseOfDefaultWorkingDirectory(true) + .forceUseOfDefaultWorkingDirectory(group != null) //if no source group, allow other directories .showSaveDialog(); FileObject fo = targetFolder != null ? FileUtil.toFileObject(FileUtil.normalizeFile(targetFolder)) : null; if ( fo != null && fo.isFolder() ) { - String path = FileUtil.getRelativePath(group.getRootFolder(), fo); + String path = group == null ? null : FileUtil.getRelativePath(group.getRootFolder(), fo); if (path == null) { path = fo.getPath(); } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists