From 9ba8627b09e97aeb1e6dfad5839149ad815cf2d4 Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Tue, 20 Mar 2018 12:45:20 +0100 Subject: [PATCH] ensure byte code viewer works in Project view, make focusable IDEA-185007; IDEA-188549 --- .../com/intellij/byteCodeViewer/ByteCodeViewerComponent.java | 4 ++++ .../src/com/intellij/byteCodeViewer/ShowByteCodeAction.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ByteCodeViewerComponent.java b/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ByteCodeViewerComponent.java index c3f8ef8c1a2f..f709752b6d4a 100644 --- a/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ByteCodeViewerComponent.java +++ b/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ByteCodeViewerComponent.java @@ -108,6 +108,10 @@ public class ByteCodeViewerComponent extends JPanel implements Disposable { public String getText() { return myEditor.getDocument().getText(); } + + public JComponent getEditorComponent() { + return myEditor.getContentComponent(); + } @Override public void dispose() { diff --git a/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ShowByteCodeAction.java b/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ShowByteCodeAction.java index 05622ae054b6..8152263cfa9e 100644 --- a/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ShowByteCodeAction.java +++ b/plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ShowByteCodeAction.java @@ -130,7 +130,7 @@ public class ShowByteCodeAction extends AnAction { return false; }; - final JBPopup popup = JBPopupFactory.getInstance().createComponentPopupBuilder(component, editor.getComponent()) + final JBPopup popup = JBPopupFactory.getInstance().createComponentPopupBuilder(component, component.getEditorComponent()) .setProject(project) .setDimensionServiceKey(project, ShowByteCodeAction.class.getName(), false) .setResizable(true)