mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Added ad to the bottom of "Recent Tests" popup, set default execution mode to run
This commit is contained in:
@@ -45,7 +45,7 @@ class RecentTestRunnerImpl implements RecentTestRunner {
|
||||
private static AnAction RUN = ActionManager.getInstance().getAction("RunClass");
|
||||
private static AnAction DEBUG = ActionManager.getInstance().getAction("DebugClass");
|
||||
|
||||
protected AnAction myCurrentAction = DEBUG;
|
||||
protected AnAction myCurrentAction = RUN;
|
||||
private final Project myProject;
|
||||
|
||||
public RecentTestRunnerImpl(Project project) {
|
||||
|
||||
@@ -19,8 +19,10 @@ import com.intellij.execution.Location;
|
||||
import com.intellij.execution.TestStateStorage;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.keymap.MacKeymapUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.ListPopupStep;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.ui.popup.list.ListPopupImpl;
|
||||
import com.intellij.util.PsiNavigateUtil;
|
||||
import com.intellij.util.Time;
|
||||
@@ -66,6 +68,9 @@ class RecentTestsListPopup extends ListPopupImpl {
|
||||
myTestRunner = testRunner;
|
||||
shiftReleased();
|
||||
registerActions(this);
|
||||
|
||||
String shift = SystemInfo.isMac ? MacKeymapUtil.SHIFT : "Shift";
|
||||
setAdText("Debug with " + shift + ", navigate with F4");
|
||||
}
|
||||
|
||||
private void registerActions(ListPopupImpl popup) {
|
||||
@@ -103,13 +108,13 @@ class RecentTestsListPopup extends ListPopupImpl {
|
||||
}
|
||||
|
||||
private void shiftPressed() {
|
||||
setCaption("Run Recent Tests");
|
||||
myTestRunner.setMode(RecentTestRunner.Mode.RUN);
|
||||
setCaption("Debug Recent Tests");
|
||||
myTestRunner.setMode(RecentTestRunner.Mode.DEBUG);
|
||||
}
|
||||
|
||||
private void shiftReleased() {
|
||||
setCaption("Debug Recent Tests");
|
||||
myTestRunner.setMode(RecentTestRunner.Mode.DEBUG);
|
||||
setCaption("Run Recent Tests");
|
||||
myTestRunner.setMode(RecentTestRunner.Mode.RUN);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user