mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-35109: File->Reopen Project: SHIFT-Click to open project in new window w/o going through confirmation popup
This commit is contained in:
@@ -44,7 +44,7 @@ public class RecentProjectsManager extends RecentProjectsManagerBase {
|
||||
return location == null ? null : location.replace('/', File.separatorChar);
|
||||
}
|
||||
|
||||
protected void doOpenProject(final String projectPath, Project projectToClose) {
|
||||
ProjectUtil.openProject(projectPath, projectToClose, false);
|
||||
protected void doOpenProject(final String projectPath, Project projectToClose, final boolean forceOpenInNewFrame) {
|
||||
ProjectUtil.openProject(projectPath, projectToClose, forceOpenInNewFrame);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,10 +54,10 @@ public class RecentDirectoryProjectsManager extends RecentProjectsManagerBase {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void doOpenProject(final String projectPath, final Project projectToClose) {
|
||||
protected void doOpenProject(final String projectPath, final Project projectToClose, final boolean forceOpenInNewFrame) {
|
||||
final VirtualFile projectDir = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(projectPath));
|
||||
if (projectDir != null) {
|
||||
PlatformProjectOpenProcessor.getInstance().doOpenProject(projectDir, projectToClose, false);
|
||||
PlatformProjectOpenProcessor.getInstance().doOpenProject(projectDir, projectToClose, forceOpenInNewFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.intellij.util.messages.MessageBus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.event.InputEvent;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
@@ -198,7 +199,7 @@ public abstract class RecentProjectsManagerBase implements PersistentStateCompon
|
||||
@Nullable
|
||||
protected abstract String getProjectPath(Project project);
|
||||
|
||||
protected abstract void doOpenProject(String projectPath, Project projectToClose);
|
||||
protected abstract void doOpenProject(String projectPath, Project projectToClose, final boolean forceOpenInNewFrame);
|
||||
|
||||
private class MyProjectManagerListener extends ProjectManagerAdapter {
|
||||
public void projectOpened(final Project project) {
|
||||
@@ -226,7 +227,9 @@ public abstract class RecentProjectsManagerBase implements PersistentStateCompon
|
||||
}
|
||||
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
doOpenProject(myProjectPath, PlatformDataKeys.PROJECT.getData(e.getDataContext()));
|
||||
final int modifiers = e.getModifiers();
|
||||
final boolean forceOpenInNewFrame = (modifiers & InputEvent.CTRL_MASK) != 0 || (modifiers & InputEvent.SHIFT_MASK) != 0;
|
||||
doOpenProject(myProjectPath, PlatformDataKeys.PROJECT.getData(e.getDataContext()), forceOpenInNewFrame);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +246,7 @@ public abstract class RecentProjectsManagerBase implements PersistentStateCompon
|
||||
if (generalSettings.isReopenLastProject()) {
|
||||
String lastProjectPath = getLastProjectPath();
|
||||
if (lastProjectPath != null) {
|
||||
doOpenProject(lastProjectPath, null);
|
||||
doOpenProject(lastProjectPath, null, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user