Added ad to the bottom of "Recent Tests" popup, set default execution mode to run

This commit is contained in:
Yaroslav Lepenkin
2016-01-29 15:43:29 +03:00
parent 52b7dbd5c6
commit 0c877c89fc
2 changed files with 10 additions and 5 deletions
@@ -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);
}
}