From 0500d52186bc5131214101e2a62c8f626b7a0442 Mon Sep 17 00:00:00 2001 From: "Kirill.Safonov" Date: Mon, 6 Sep 2010 17:43:12 +0400 Subject: [PATCH] tests for Extract Super actions availability --- .../src/com/intellij/testFramework/PlatformTestCase.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java index 9b7a99dfd010..c4051040ccc4 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java @@ -31,7 +31,9 @@ import com.intellij.openapi.command.impl.UndoManagerImpl; import com.intellij.openapi.command.undo.UndoManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; +import com.intellij.openapi.editor.Editor; import com.intellij.openapi.fileEditor.FileEditorManager; +import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; import com.intellij.openapi.module.EmptyModuleType; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; @@ -570,6 +572,11 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro return FileEditorManager.getInstance(myProject).getSelectedTextEditor(); } else { + Editor editor = (Editor)getData(PlatformDataKeys.EDITOR.getName()); + if (editor != null) { + FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(myProject); + return manager.getData(dataId, editor, manager.getSelectedFiles()[0]); + } return null; } }