Drop "Shift modifier activates first content of a tool window" behavior

* Few users actually use it
* It is not discoverable and not configurable in any way

d4515ba1b0 follow-up

GitOrigin-RevId: 0ca39736f5ec9d6e6f86c5b56112e8ffd3052cef
This commit is contained in:
Konstantin Kolosovsky
2020-01-22 02:33:41 +00:00
committed by intellij-monorepo-bot
parent ae4ea98e4f
commit 3c94648ac6
@@ -13,7 +13,6 @@ import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.openapi.wm.impl.ToolWindowImpl;
import com.intellij.ui.SizedIcon;
import com.intellij.ui.content.Content;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -96,25 +95,12 @@ public class ActivateToolWindowAction extends DumbAwareAction {
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
ToolWindow window = windowManager.getToolWindow(myToolWindowId);
InputEvent event = e.getInputEvent();
Runnable run = null;
if (event instanceof KeyEvent && event.isShiftDown()) {
Content[] contents = window.getContentManager().getContents();
if (contents.length > 0 && window.getContentManager().getSelectedContent() != contents[0]) {
run = () -> window.getContentManager().setSelectedContent(contents[0], true, true);
}
}
if (windowManager.isEditorComponentActive() || !myToolWindowId.equals(windowManager.getActiveToolWindowId()) || run != null) {
if (run != null && window.isActive()) {
run.run();
}
else {
window.activate(run);
}
if (windowManager.isEditorComponentActive() || !myToolWindowId.equals(windowManager.getActiveToolWindowId())) {
window.activate(null);
}
else {
windowManager.getToolWindow(myToolWindowId).hide(null);
window.hide(null);
}
}