mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
GUI-67 Can't record actions in mocha run tool window
Fix access allowed only from AWT
This commit is contained in:
+6
-1
@@ -73,7 +73,7 @@ public class EditorFixture {
|
||||
public final Robot robot;
|
||||
private final IdeFrameFixture myFrame;
|
||||
private final EditorTabsFixture tabs;
|
||||
private final Editor myEditor;
|
||||
private Editor myEditor;
|
||||
|
||||
/**
|
||||
* Constructs a new editor fixture, tied to the given project
|
||||
@@ -210,6 +210,11 @@ public class EditorFixture {
|
||||
return myEditor;
|
||||
}
|
||||
|
||||
public void setEditor(Editor editor) {
|
||||
myEditor = editor;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the contents of the current file, or null if there is no
|
||||
* file open. The caret position is indicated by {@code ^}, and
|
||||
|
||||
+8
-1
@@ -12,6 +12,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.fest.swing.core.Robot;
|
||||
import org.fest.swing.edt.GuiActionRunner;
|
||||
import org.fest.swing.edt.GuiQuery;
|
||||
import org.fest.swing.edt.GuiTask;
|
||||
import org.fest.swing.timing.Condition;
|
||||
@@ -38,8 +39,14 @@ public class FileEditorFixture extends EditorFixture {
|
||||
private final IdeFrameFixture myFrame;
|
||||
|
||||
public FileEditorFixture(Robot robot, IdeFrameFixture frame) {
|
||||
super(robot, FileEditorManager.getInstance(frame.getProject()).getSelectedTextEditor());
|
||||
super(robot, null);
|
||||
myManager = FileEditorManager.getInstance(frame.getProject());
|
||||
execute(new GuiTask() {
|
||||
@Override
|
||||
protected void executeInEDT() {
|
||||
FileEditorFixture.this.setEditor(myManager.getSelectedTextEditor());
|
||||
}
|
||||
});
|
||||
myFrame = frame;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user