Commit de38d17b authored by Sergey Ignatov's avatar Sergey Ignatov
Browse files

allow to override initial selection in open file action

parent ae8773a2
Branches unavailable Tags unavailable
No related merge requests found
Showing with 6 additions and 1 deletion
+6 -1
......@@ -56,7 +56,7 @@ public class OpenFileAction extends AnAction implements DumbAware {
final FileChooserDescriptor descriptor = showFiles ? new ProjectOrFileChooserDescriptor() : new ProjectOnlyFileChooserDescriptor();
descriptor.putUserData(PathChooserDialog.PREFER_LAST_OVER_EXPLICIT, showFiles);
FileChooser.chooseFiles(descriptor, project, VfsUtil.getUserHomeDir(), files -> {
FileChooser.chooseFiles(descriptor, project, getPathToSelect(), files -> {
for (VirtualFile file : files) {
if (!descriptor.isFileSelectable(file)) {
String message = IdeBundle.message("error.dir.contains.no.project", file.getPresentableUrl());
......@@ -68,6 +68,11 @@ public class OpenFileAction extends AnAction implements DumbAware {
});
}
@Nullable
protected VirtualFile getPathToSelect() {
return VfsUtil.getUserHomeDir();
}
@Override
public void update(@NotNull AnActionEvent e) {
if (NewWelcomeScreen.isNewWelcomeScreen(e)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment