mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-229567 Alt+f1 from changes view shows a tiny popup
GitOrigin-RevId: 303fe46032d44ab81c3b27d32159942245e4aedf
This commit is contained in:
committed by
intellij-monorepo-bot
parent
aa4afca877
commit
f4fb72c397
+5
-6
@@ -1,5 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package com.intellij.ide.projectView.actions;
|
||||
|
||||
import com.intellij.ide.projectView.ProjectView;
|
||||
@@ -11,27 +10,27 @@ import com.intellij.openapi.wm.ToolWindowId;
|
||||
import com.intellij.openapi.wm.ToolWindowManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class ChangeProjectViewAction extends AnAction {
|
||||
final class ChangeProjectViewAction extends AnAction {
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
Project project = e.getProject();
|
||||
if (project == null) {
|
||||
return;
|
||||
}
|
||||
ProjectView projectView = ProjectView.getInstance(project);
|
||||
projectView.changeView();
|
||||
ProjectView.getInstance(project).changeView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent event){
|
||||
Presentation presentation = event.getPresentation();
|
||||
Project project = event.getProject();
|
||||
if (project == null){
|
||||
if (project == null) {
|
||||
presentation.setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
|
||||
String id = windowManager.getActiveToolWindowId();
|
||||
presentation.setEnabled(ToolWindowId.PROJECT_VIEW.equals(id) && !windowManager.isEditorComponentActive());
|
||||
presentation.setEnabled(ToolWindowId.PROJECT_VIEW.equals(id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,6 +274,10 @@ public class FrameWrapper implements Disposable, DataProvider {
|
||||
return myFrame;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return myFrame != null && myFrame.isActive();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected JFrame createJFrame(@NotNull IdeFrame parent) {
|
||||
return new MyJFrame(this, parent);
|
||||
|
||||
@@ -50,6 +50,7 @@ import com.intellij.openapi.wm.ex.ToolWindowManagerEx
|
||||
import com.intellij.openapi.wm.ex.ToolWindowManagerListener
|
||||
import com.intellij.openapi.wm.ex.WindowManagerEx
|
||||
import com.intellij.openapi.wm.impl.commands.RequestFocusInToolWindowCommand
|
||||
import com.intellij.openapi.wm.impl.content.ToolWindowContentUi
|
||||
import com.intellij.ui.BalloonImpl
|
||||
import com.intellij.ui.ComponentUtil
|
||||
import com.intellij.ui.GuiUtils
|
||||
@@ -591,9 +592,31 @@ open class ToolWindowManagerImpl(val project: Project) : ToolWindowManagerEx(),
|
||||
override val activeToolWindowId: String?
|
||||
get() {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread()
|
||||
return idToEntry.values.firstOrNull {
|
||||
it.readOnlyWindowInfo.isActive
|
||||
}?.toolWindow?.id
|
||||
val frame = frame?.frame ?: return null
|
||||
if (frame.isActive) {
|
||||
val focusOwner = focusManager.getLastFocusedFor(frame) ?: return null
|
||||
|
||||
var parent: Component? = focusOwner
|
||||
while (parent != null) {
|
||||
if (parent is InternalDecorator) {
|
||||
return parent.toolWindow.id
|
||||
}
|
||||
else if (parent is ToolWindowContentUi) {
|
||||
return parent.toolWindowId
|
||||
}
|
||||
|
||||
parent = parent.parent
|
||||
}
|
||||
}
|
||||
else {
|
||||
// let's check floating and windowed
|
||||
for (entry in idToEntry.values) {
|
||||
if (entry.floatingDecorator?.isActive == true || entry.windowedDecorator?.isActive == true) {
|
||||
return entry.id
|
||||
}
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getLastActiveToolWindowId(): String? {
|
||||
|
||||
+5
@@ -101,6 +101,11 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Data
|
||||
});
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getToolWindowId() {
|
||||
return myWindow.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uiSettingsChanged(@NotNull UISettings uiSettings) {
|
||||
revalidate();
|
||||
|
||||
Reference in New Issue
Block a user