From c774fdd050864c242ff8f87fa703fa3d62a5c569 Mon Sep 17 00:00:00 2001 From: Kirill Kalishev Date: Thu, 18 Aug 2011 08:56:55 +0400 Subject: [PATCH] funcTests: playback refctoring --- .../openapi/ui/playback/PlaybackCommand.java | 2 +- .../openapi/ui/playback/PlaybackContext.java | 16 ++++++++++++- .../openapi/ui/playback/PlaybackRunner.java | 3 +-- .../ui/playback/commands/AbstractCommand.java | 15 ++++++------ .../ui/playback/commands/ActionCommand.java | 15 ++++++------ .../commands/AlphaNumericTypeCommand.java | 6 ++--- .../ui/playback/commands/AssertFocused.java | 9 +++---- .../ui/playback/commands/CallCommand.java | 24 +++++++++---------- .../ui/playback/commands/DelayCommand.java | 10 ++++---- .../ui/playback/commands/EmptyCommand.java | 6 ++--- .../ui/playback/commands/ErrorCommand.java | 8 +++---- .../playback/commands/KeyCodeTypeCommand.java | 10 ++++---- .../playback/commands/KeyShortcutCommand.java | 10 ++++---- .../ui/playback/commands/PrintCommand.java | 8 +++---- .../ui/playback/commands/StopCommand.java | 8 +++---- 15 files changed, 73 insertions(+), 77 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackCommand.java index 76b3f4b82711..c9b03186fab8 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackCommand.java @@ -20,6 +20,6 @@ import com.intellij.openapi.util.ActionCallback; import java.awt.*; public interface PlaybackCommand { - ActionCallback execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean useDirectActionCall); + ActionCallback execute(PlaybackContext context); boolean canGoFurther(); } \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackContext.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackContext.java index e7698e4cfe2d..2c576b487563 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackContext.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackContext.java @@ -15,6 +15,8 @@ */ package com.intellij.openapi.ui.playback; +import java.awt.*; + /** * Created by IntelliJ IDEA. * User: kirillk @@ -26,10 +28,14 @@ public class PlaybackContext { private PlaybackRunner.StatusCallback myCallback; private int myCurrentLine; + private Robot myRobot; + private boolean myUseDirectActionCall; - public PlaybackContext(PlaybackRunner.StatusCallback callback, int currentLine) { + public PlaybackContext(PlaybackRunner.StatusCallback callback, int currentLine, Robot robot, boolean useDriectActionCall) { myCallback = callback; myCurrentLine = currentLine; + myRobot = robot; + myUseDirectActionCall = useDriectActionCall; } public PlaybackRunner.StatusCallback getCallback() { @@ -39,4 +45,12 @@ public class PlaybackContext { public int getCurrentLine() { return myCurrentLine; } + + public Robot getRobot() { + return myRobot; + } + + public boolean isUseDirectActionCall() { + return myUseDirectActionCall; + } } diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackRunner.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackRunner.java index bee76bcf6d7d..b882f4283cde 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackRunner.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackRunner.java @@ -26,7 +26,6 @@ import com.intellij.util.text.StringTokenizer; import javax.swing.*; import java.awt.*; -import java.awt.event.KeyEvent; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -92,7 +91,7 @@ public class PlaybackRunner { myActionCallback.setRejected(); return; } - final ActionCallback cmdCallback = cmd.execute(myCallback, myRobot, myUseDirectActionCall); + final ActionCallback cmdCallback = cmd.execute(new PlaybackContext(myCallback, cmdIndex, myRobot, myUseDirectActionCall)); cmdCallback.doWhenDone(new Runnable() { public void run() { if (cmd.canGoFurther()) { diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AbstractCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AbstractCommand.java index 2f467f140043..084bb441dcd2 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AbstractCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AbstractCommand.java @@ -17,11 +17,10 @@ package com.intellij.openapi.ui.playback.commands; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.ui.playback.PlaybackCommand; +import com.intellij.openapi.ui.playback.PlaybackContext; import com.intellij.openapi.ui.playback.PlaybackRunner; import com.intellij.openapi.util.ActionCallback; -import java.awt.*; - public abstract class AbstractCommand implements PlaybackCommand { public static String CMD_PREFIX = "%"; @@ -46,17 +45,17 @@ public abstract class AbstractCommand implements PlaybackCommand { return true; } - public final ActionCallback execute(final PlaybackRunner.StatusCallback cb, final Robot robot, final boolean useDirectActionCall) { + public final ActionCallback execute(final PlaybackContext context) { try { - dumpCommand(cb); + dumpCommand(context.getCallback()); final ActionCallback result = new ActionCallback(); if (isAwtThread()) { - _execute(cb, robot, useDirectActionCall).notify(result); + _execute(context).notify(result); } else { ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { - _execute(cb, robot, useDirectActionCall).notify(result); + _execute(context).notify(result); } }); } @@ -64,7 +63,7 @@ public abstract class AbstractCommand implements PlaybackCommand { return result; } catch (Exception e) { - cb.error(e.getMessage(), getLine()); + context.getCallback().error(e.getMessage(), getLine()); return new ActionCallback.Rejected(); } } @@ -73,7 +72,7 @@ public abstract class AbstractCommand implements PlaybackCommand { return false; } - protected abstract ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall); + protected abstract ActionCallback _execute(PlaybackContext context); public void dumpCommand(final PlaybackRunner.StatusCallback cb) { cb.message(getText(), getLine()); diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/ActionCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/ActionCommand.java index 1a554a18a3b6..7546cfab772a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/ActionCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/ActionCommand.java @@ -15,7 +15,7 @@ */ package com.intellij.openapi.ui.playback.commands; -import com.intellij.openapi.ui.playback.PlaybackRunner; +import com.intellij.openapi.ui.playback.PlaybackContext; import com.intellij.openapi.util.ActionCallback; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.actionSystem.AnAction; @@ -25,7 +25,6 @@ import com.intellij.openapi.actionSystem.KeyboardShortcut; import com.intellij.openapi.keymap.KeymapManager; import javax.swing.*; -import java.awt.*; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; @@ -38,17 +37,17 @@ public class ActionCommand extends TypeCommand { super(text, line); } - protected ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { + protected ActionCallback _execute(PlaybackContext context) { final String actionName = getText().substring(PREFIX.length()).trim(); final AnAction action = ActionManager.getInstance().getAction(actionName); if (action == null) { - dumpError(cb, "Unknown action: " + actionName); + dumpError(context.getCallback(), "Unknown action: " + actionName); return new ActionCallback.Rejected(); } - if (!directActionCall) { + if (!context.isUseDirectActionCall()) { final Shortcut[] sc = KeymapManager.getInstance().getActiveKeymap().getShortcuts(actionName); KeyStroke stroke = null; for (Shortcut each : sc) { @@ -64,8 +63,8 @@ public class ActionCommand extends TypeCommand { } if (stroke != null) { - cb.message("Invoking action via shortcut: " + stroke.toString(), getLine()); - type(robot, stroke); + context.getCallback().message("Invoking action via shortcut: " + stroke.toString(), getLine()); + type(context.getRobot(), stroke); return new ActionCallback.Done(); } } @@ -74,7 +73,7 @@ public class ActionCommand extends TypeCommand { final ActionCallback result = new ActionCallback(); - robot.delay(Registry.intValue("actionSystem.playback.autodelay")); + context.getRobot().delay(Registry.intValue("actionSystem.playback.autodelay")); SwingUtilities.invokeLater(new Runnable() { public void run() { ActionManager.getInstance().tryToExecute(action, input, null, null, false).doWhenProcessed(new Runnable() { diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java index 10a938d963ab..f9f5e6204570 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java @@ -16,8 +16,8 @@ package com.intellij.openapi.ui.playback.commands; import com.intellij.openapi.ui.TypingTarget; +import com.intellij.openapi.ui.playback.PlaybackContext; import com.intellij.openapi.util.ActionCallback; -import com.intellij.openapi.ui.playback.PlaybackRunner; import com.intellij.openapi.util.registry.Registry; import org.jetbrains.annotations.Nullable; @@ -30,8 +30,8 @@ public class AlphaNumericTypeCommand extends TypeCommand { super(text, line); } - public ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { - return type(robot, getText()); + public ActionCallback _execute(PlaybackContext context) { + return type(context.getRobot(), getText()); } protected ActionCallback type(final Robot robot, final String text) { diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AssertFocused.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AssertFocused.java index 22c60e3f2ead..8fd5f0c2854c 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AssertFocused.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AssertFocused.java @@ -16,6 +16,7 @@ package com.intellij.openapi.ui.playback.commands; import com.intellij.openapi.ui.Queryable; +import com.intellij.openapi.ui.playback.PlaybackContext; import com.intellij.openapi.ui.playback.PlaybackRunner; import com.intellij.openapi.util.ActionCallback; import com.intellij.openapi.wm.IdeFocusManager; @@ -31,7 +32,7 @@ public class AssertFocused extends AbstractCommand { super(text, line); } - protected ActionCallback _execute(final PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { + protected ActionCallback _execute(final PlaybackContext context) { final ActionCallback result = new ActionCallback(); String text = getText().substring(PREFIX.length()).trim(); @@ -42,7 +43,7 @@ public class AssertFocused extends AbstractCommand { for (String each : keyValue) { final String[] eachPair = each.split("="); if (eachPair.length != 2) { - cb.error("Syntax error, must be comma-separated pairs key=value", getLine()); + context.getCallback().error("Syntax error, must be comma-separated pairs key=value", getLine()); result.setRejected(); return result; } @@ -54,11 +55,11 @@ public class AssertFocused extends AbstractCommand { IdeFocusManager.findInstance().doWhenFocusSettlesDown(new Runnable() { public void run() { try { - doAssert(expected, cb); + doAssert(expected, context.getCallback()); result.setDone(); } catch (AssertionError error) { - cb.error("Assertion failed: " + error.getMessage(), getLine()); + context.getCallback().error("Assertion failed: " + error.getMessage(), getLine()); result.setRejected(); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/CallCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/CallCommand.java index e54524cf5aba..0d0fd5a85ba3 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/CallCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/CallCommand.java @@ -17,11 +17,9 @@ package com.intellij.openapi.ui.playback.commands; import com.intellij.openapi.ui.playback.PlaybackCallFacade; import com.intellij.openapi.ui.playback.PlaybackContext; -import com.intellij.openapi.ui.playback.PlaybackRunner; import com.intellij.openapi.util.ActionCallback; import com.intellij.openapi.util.AsyncResult; -import java.awt.*; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -41,19 +39,19 @@ public class CallCommand extends AbstractCommand { } @Override - protected ActionCallback _execute(final PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { + protected ActionCallback _execute(final PlaybackContext context) { final ActionCallback cmdResult = new ActionCallback(); final String cmd = getText().substring(PREFIX.length()).trim(); final int open = cmd.indexOf("("); if (open == -1) { - cb.error("( expected", getLine()); + context.getCallback().error("( expected", getLine()); return new ActionCallback.Done(); } final int close = cmd.lastIndexOf(")"); if (close == -1) { - cb.error(") expected", getLine()); + context.getCallback().error(") expected", getLine()); return new ActionCallback.Done(); } @@ -71,12 +69,12 @@ public class CallCommand extends AbstractCommand { try { final Method m = PlaybackCallFacade.class.getMethod(methodName, types); if (!m.getReturnType().isAssignableFrom(AsyncResult.class)) { - cb.error("Method " + methodName + " must return AsyncResult object", getLine()); + context.getCallback().error("Method " + methodName + " must return AsyncResult object", getLine()); return new ActionCallback.Rejected(); } Object[] actualArgs = noArgs ? new Object[1] : new Object[args.length + 1]; - actualArgs[0] = new PlaybackContext(cb, getLine()); + actualArgs[0] = new PlaybackContext(context.getCallback(), getLine(), context.getRobot(), context.isUseDirectActionCall()); for (int i = 1; i < actualArgs.length; i++) { actualArgs[i] = args[i - 1]; } @@ -84,7 +82,7 @@ public class CallCommand extends AbstractCommand { AsyncResult result = (AsyncResult)m.invoke(null, actualArgs); if (result == null) { - cb.error("Method " + methodName + " must return AsyncResult object, but was null", getLine()); + context.getCallback().error("Method " + methodName + " must return AsyncResult object, but was null", getLine()); return new ActionCallback.Done(); } @@ -92,27 +90,27 @@ public class CallCommand extends AbstractCommand { @Override public void run(String s) { if (s != null) { - cb.message("[" + methodName + "] " + s, getLine()); + context.getCallback().message("[" + methodName + "] " + s, getLine()); } cmdResult.setDone(); } }).doWhenRejected(new AsyncResult.Handler() { @Override public void run(String s) { - cb.error("[" + methodName + "] " + s, getLine()); + context.getCallback().error("[" + methodName + "] " + s, getLine()); cmdResult.setDone(); } }); } catch (NoSuchMethodException e) { - cb.error("No method found in PlaybackCallFacade", getLine()); + context.getCallback().error("No method found in PlaybackCallFacade", getLine()); } catch (InvocationTargetException e) { - cb.error("InvocationTargetException while executing command: " + cmd, getLine()); + context.getCallback().error("InvocationTargetException while executing command: " + cmd, getLine()); } catch (IllegalAccessException e) { - cb.error("IllegalAccessException while executing command: " + cmd, getLine()); + context.getCallback().error("IllegalAccessException while executing command: " + cmd, getLine()); } return cmdResult; } diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/DelayCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/DelayCommand.java index 101fb358d73c..71788151014f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/DelayCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/DelayCommand.java @@ -15,10 +15,8 @@ */ package com.intellij.openapi.ui.playback.commands; +import com.intellij.openapi.ui.playback.PlaybackContext; import com.intellij.openapi.util.ActionCallback; -import com.intellij.openapi.ui.playback.PlaybackRunner; - -import java.awt.*; public class DelayCommand extends AbstractCommand { public static String PREFIX = CMD_PREFIX + "delay"; @@ -27,15 +25,15 @@ public class DelayCommand extends AbstractCommand { super(text, line); } - public ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { + public ActionCallback _execute(PlaybackContext context) { final String s = getText().substring(PREFIX.length()).trim(); try { final Integer delay = Integer.valueOf(s); - robot.delay(delay.intValue()); + context.getRobot().delay(delay.intValue()); } catch (NumberFormatException e) { - dumpError(cb, "Invalid delay value: " + s); + dumpError(context.getCallback(), "Invalid delay value: " + s); return new ActionCallback.Rejected(); } diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/EmptyCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/EmptyCommand.java index 870bfea344bb..b27654f19f04 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/EmptyCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/EmptyCommand.java @@ -15,17 +15,15 @@ */ package com.intellij.openapi.ui.playback.commands; +import com.intellij.openapi.ui.playback.PlaybackContext; import com.intellij.openapi.util.ActionCallback; -import com.intellij.openapi.ui.playback.PlaybackRunner; - -import java.awt.*; public class EmptyCommand extends AbstractCommand { public EmptyCommand(int line) { super("", line); } - public ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { + public ActionCallback _execute(PlaybackContext context) { return new ActionCallback.Done(); } } \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/ErrorCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/ErrorCommand.java index 41e04f88ba69..f43df109c08a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/ErrorCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/ErrorCommand.java @@ -15,10 +15,8 @@ */ package com.intellij.openapi.ui.playback.commands; +import com.intellij.openapi.ui.playback.PlaybackContext; import com.intellij.openapi.util.ActionCallback; -import com.intellij.openapi.ui.playback.PlaybackRunner; - -import java.awt.*; public class ErrorCommand extends AbstractCommand { @@ -26,8 +24,8 @@ public class ErrorCommand extends AbstractCommand { super(text, line); } - public ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { - dumpError(cb, getText()); + public ActionCallback _execute(PlaybackContext context) { + dumpError(context.getCallback(), getText()); return new ActionCallback.Rejected(); } } \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java index b0b8745fa3e4..05f0d23d6739 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java @@ -16,14 +16,12 @@ package com.intellij.openapi.ui.playback.commands; import com.intellij.openapi.ui.TypingTarget; +import com.intellij.openapi.ui.playback.PlaybackContext; import com.intellij.openapi.ui.playback.PlaybackRunner; import com.intellij.openapi.util.ActionCallback; import com.intellij.openapi.util.Pair; -import com.intellij.openapi.util.registry.Registry; -import org.jetbrains.annotations.Nullable; import java.awt.*; -import java.awt.List; import java.util.*; public class KeyCodeTypeCommand extends AlphaNumericTypeCommand { @@ -37,7 +35,7 @@ public class KeyCodeTypeCommand extends AlphaNumericTypeCommand { } @Override - public ActionCallback _execute(final PlaybackRunner.StatusCallback cb, final Robot robot, boolean directActionCall) { + public ActionCallback _execute(final PlaybackContext context) { String text = getText().substring(PREFIX.length()).trim(); int textDelim = text.indexOf(" "); @@ -66,11 +64,11 @@ public class KeyCodeTypeCommand extends AlphaNumericTypeCommand { } }).doWhenRejected(new Runnable() { public void run() { - typeCodes(cb, robot, codes).notify(result); + typeCodes(context.getCallback(), context.getRobot(), codes).notify(result); } }); } else { - typeCodes(cb, robot, codes).notify(result); + typeCodes(context.getCallback(), context.getRobot(), codes).notify(result); } return result; diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyShortcutCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyShortcutCommand.java index c5bd853b1588..1849a8566956 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyShortcutCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyShortcutCommand.java @@ -15,10 +15,8 @@ */ package com.intellij.openapi.ui.playback.commands; +import com.intellij.openapi.ui.playback.PlaybackContext; import com.intellij.openapi.util.ActionCallback; -import com.intellij.openapi.ui.playback.PlaybackRunner; - -import java.awt.*; public class KeyShortcutCommand extends TypeCommand { @@ -29,14 +27,14 @@ public class KeyShortcutCommand extends TypeCommand { super(text, line); } - public ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { + public ActionCallback _execute(PlaybackContext context) { final String one = getText().substring(PREFIX.length()); if (!one.endsWith(POSTFIX)) { - dumpError(cb, "Expected " + "]"); + dumpError(context.getCallback(), "Expected " + "]"); return new ActionCallback.Rejected(); } - type(robot, getFromShortcut(one.substring(0, one.length() - 1).trim())); + type(context.getRobot(), getFromShortcut(one.substring(0, one.length() - 1).trim())); return new ActionCallback.Done(); } diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/PrintCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/PrintCommand.java index 3e6eabf6f98d..587ddf137438 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/PrintCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/PrintCommand.java @@ -15,11 +15,9 @@ */ package com.intellij.openapi.ui.playback.commands; -import com.intellij.openapi.ui.playback.PlaybackRunner; +import com.intellij.openapi.ui.playback.PlaybackContext; import com.intellij.openapi.util.ActionCallback; -import java.awt.*; - /** * Created by IntelliJ IDEA. * User: kirillk @@ -37,8 +35,8 @@ public class PrintCommand extends AbstractCommand { } @Override - protected ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { - cb.message(myText, getLine()); + protected ActionCallback _execute(PlaybackContext context) { + context.getCallback().message(myText, getLine()); return new ActionCallback.Done(); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/StopCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/StopCommand.java index 467d3a633fc7..093251864700 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/StopCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/StopCommand.java @@ -15,10 +15,8 @@ */ package com.intellij.openapi.ui.playback.commands; +import com.intellij.openapi.ui.playback.PlaybackContext; import com.intellij.openapi.util.ActionCallback; -import com.intellij.openapi.ui.playback.PlaybackRunner; - -import java.awt.*; public class StopCommand extends AbstractCommand { @@ -28,8 +26,8 @@ public class StopCommand extends AbstractCommand { super(text, line); } - protected ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { - cb.message("Stopped", getLine()); + protected ActionCallback _execute(PlaybackContext context) { + context.getCallback().message("Stopped", getLine()); return new ActionCallback.Done(); }