diff options
author | Tor Norbye <tnorbye@google.com> | 2014-09-18 11:43:07 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-09-18 11:43:28 -0700 |
commit | e782c57d74000722f9db4c9426317410520670c6 (patch) | |
tree | 6e5d3e8934107ffabb7661f8bfc0e1a08eb37faf /platform/platform-impl/src/com/intellij/ide/actions/PinActiveTabAction.java | |
parent | c3d3a90f6b4ead083d63e28e6b9fcea93d675678 (diff) | |
download | idea-e782c57d74000722f9db4c9426317410520670c6.tar.gz |
Snapshot idea/138.2210 from git://git.jetbrains.org/idea/community.git
Change-Id: I8f0204d7887ee78cf1fd8c09f936c5afff0edd2f
Diffstat (limited to 'platform/platform-impl/src/com/intellij/ide/actions/PinActiveTabAction.java')
-rw-r--r-- | platform/platform-impl/src/com/intellij/ide/actions/PinActiveTabAction.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/platform/platform-impl/src/com/intellij/ide/actions/PinActiveTabAction.java b/platform/platform-impl/src/com/intellij/ide/actions/PinActiveTabAction.java index ddfc1a3989aa..560082bf9e64 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/PinActiveTabAction.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/PinActiveTabAction.java @@ -116,12 +116,17 @@ public class PinActiveTabAction extends ToggleAction implements DumbAware { super.update(e); Presentation presentation = e.getPresentation(); DataContext context = e.getDataContext(); - if (getFile(context) != null) { - presentation.setEnabledAndVisible(true); - } - else { - Content content = getContent(context); - presentation.setEnabledAndVisible(content != null && content.isPinnable()); + EditorWindow window = getEditorWindow(context); + if (window == null || window.getOwner().isPreview()) { + presentation.setEnabledAndVisible(false); + } else { + if (getFile(context) != null) { + presentation.setEnabledAndVisible(true); + } + else { + Content content = getContent(context); + presentation.setEnabledAndVisible(content != null && content.isPinnable()); + } } if (ActionPlaces.EDITOR_TAB_POPUP.equals(e.getPlace()) || ViewContext.CELL_POPUP_PLACE.equals(e.getPlace())) { |