Search in sources :

Example 1 with UiActivityMonitor

use of com.intellij.ide.UiActivityMonitor in project intellij-community by JetBrains.

the class PlaybackRunner method run.

public ActionCallback run() {
    myStopRequested = false;
    myRegistryValues.clear();
    final UiActivityMonitor activityMonitor = UiActivityMonitor.getInstance();
    activityMonitor.clear();
    activityMonitor.setActive(true);
    myCurrentStageDepth.clear();
    myPassedStages.clear();
    myContextTimestamp++;
    ApplicationManager.getApplication().getMessageBus().connect(ApplicationManager.getApplication()).subscribe(ApplicationActivationListener.TOPIC, myAppListener);
    try {
        myActionCallback = new ActionCallback();
        myActionCallback.doWhenProcessed(() -> {
            stop();
            SwingUtilities.invokeLater(() -> {
                activityMonitor.setActive(false);
                restoreRegistryValues();
            });
        });
        myRobot = new Robot();
        parse();
        new Thread("playback runner") {

            @Override
            public void run() {
                if (myUseDirectActionCall) {
                    executeFrom(0, getScriptDir());
                } else {
                    IdeEventQueue.getInstance().doWhenReady(() -> executeFrom(0, getScriptDir()));
                }
            }
        }.start();
    } catch (AWTException e) {
        LOG.error(e);
    }
    return myActionCallback;
}
Also used : UiActivityMonitor(com.intellij.ide.UiActivityMonitor) ActionCallback(com.intellij.openapi.util.ActionCallback)

Aggregations

UiActivityMonitor (com.intellij.ide.UiActivityMonitor)1 ActionCallback (com.intellij.openapi.util.ActionCallback)1