IDEA-215905 Update 'Open in Find Tool Window' for Documentation pop-up

GitOrigin-RevId: 3185a5c12b07d7c258ad2db2e7dc5a889e1ef59b
This commit is contained in:
Vassiliy.Kudryashov
2019-06-13 23:10:31 +03:00
committed by intellij-monorepo-bot
parent 10653858e8
commit ceaa24deba
@@ -51,6 +51,8 @@ import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.ToolWindowId;
import com.intellij.openapi.wm.ex.ToolWindowManagerEx;
import com.intellij.openapi.wm.ex.WindowManagerEx;
import com.intellij.pom.Navigatable;
import com.intellij.psi.PsiElement;
@@ -516,7 +518,8 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
layeredPane.setLayer(myScrollPane, 0);
DefaultActionGroup gearActions = new MyGearActionGroup();
gearActions.add(new ShowAsToolwindowAction());
ShowAsToolwindowAction showAsToolwindowAction = new ShowAsToolwindowAction();
gearActions.add(showAsToolwindowAction);
gearActions.add(new MyShowSettingsAction(false));
gearActions.add(new ShowToolbarAction());
gearActions.add(new RestoreDefaultSizeAction());
@@ -525,8 +528,14 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
Presentation presentation = new Presentation();
presentation.setIcon(AllIcons.Actions.More);
presentation.putClientProperty(ActionButton.HIDE_DROPDOWN_ICON, Boolean.TRUE);
myCorner = new ActionButton(gearActions, presentation, ActionPlaces.UNKNOWN, new Dimension(20, 20));
myCorner = new ActionButton(gearActions, presentation, ActionPlaces.UNKNOWN, new Dimension(20, 20)) {
@Override
protected DataContext getDataContext() {
return DataManager.getInstance().getDataContext(myCorner);
}
};
myCorner.setNoIconsInPopup(true);
showAsToolwindowAction.registerCustomShortcutSet(KeymapUtil.getActiveKeymapShortcuts("QuickJavaDoc"), myCorner);
layeredPane.add(myCorner);
layeredPane.setLayer(myCorner, JLayeredPane.POPUP_LAYER);
add(layeredPane, BorderLayout.CENTER);
@@ -1793,6 +1802,7 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setIcon(ToolWindowManagerEx.getInstanceEx(myManager.myProject).getLocationIcon(ToolWindowId.DOCUMENTATION, EmptyIcon.ICON_16));
e.getPresentation().setEnabledAndVisible(myToolwindowCallback != null);
}