IDEA-159940 Wrong default location for new jdk mac open dialog

This commit is contained in:
Denis Fokin
2016-08-17 14:50:34 +03:00
parent f41881277c
commit 917f5408ae
@@ -102,8 +102,10 @@ public class MacPathChooserDialog implements PathChooserDialog, FileChooserDialo
@Override
public void choose(@Nullable VirtualFile toSelect, @NotNull Consumer<List<VirtualFile>> callback) {
String path = toSelect != null ? toSelect.getCanonicalPath() : null;
myFileDialog.setFile(path);
if (toSelect != null && toSelect.getParent() != null) {
myFileDialog.setDirectory(toSelect.getParent().getCanonicalPath());
myFileDialog.setFile(toSelect.getPath());
}
final CommandProcessorEx commandProcessor =
ApplicationManager.getApplication() != null ? (CommandProcessorEx)CommandProcessor.getInstance() : null;