mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
Fix PsiElement nullability in EditorMouseHoverPopupManager (IDEA-CR-53414)
GitOrigin-RevId: 881f770c64a7c6354be7e03e9acd20306112f626
This commit is contained in:
committed by
intellij-monorepo-bot
parent
24d28329d6
commit
424c8caecc
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 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.
|
||||
// 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.codeInsight.documentation;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -51,7 +51,7 @@ public abstract class DockablePopupManager<T extends JComponent & Disposable> {
|
||||
protected abstract String getAutoUpdateDescription();
|
||||
|
||||
protected abstract T createComponent();
|
||||
protected abstract void doUpdateComponent(PsiElement element, PsiElement originalElement, T component);
|
||||
protected abstract void doUpdateComponent(@NotNull PsiElement element, PsiElement originalElement, T component);
|
||||
protected void doUpdateComponent(Editor editor, PsiFile psiFile, boolean requestFocus) { doUpdateComponent(editor, psiFile); }
|
||||
protected abstract void doUpdateComponent(Editor editor, PsiFile psiFile);
|
||||
protected abstract void doUpdateComponent(@NotNull PsiElement element);
|
||||
@@ -74,7 +74,7 @@ public abstract class DockablePopupManager<T extends JComponent & Disposable> {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void createToolWindow(final PsiElement element, PsiElement originalElement) {
|
||||
public void createToolWindow(@NotNull final PsiElement element, PsiElement originalElement) {
|
||||
assert myToolWindow == null;
|
||||
|
||||
final T component = createComponent();
|
||||
|
||||
@@ -180,7 +180,7 @@ public final class DocumentationManager extends DockablePopupManager<Documentati
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createToolWindow(PsiElement element, PsiElement originalElement) {
|
||||
public void createToolWindow(@NotNull PsiElement element, PsiElement originalElement) {
|
||||
super.createToolWindow(element, originalElement);
|
||||
|
||||
if (myToolWindow != null) {
|
||||
@@ -1049,7 +1049,7 @@ public final class DocumentationManager extends DockablePopupManager<Documentati
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doUpdateComponent(PsiElement element, PsiElement originalElement, DocumentationComponent component) {
|
||||
protected void doUpdateComponent(@NotNull PsiElement element, PsiElement originalElement, DocumentationComponent component) {
|
||||
cancelAndFetchDocInfo(component, new MyCollector(myProject, element, originalElement, null, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -627,10 +627,12 @@ public final class EditorMouseHoverPopupManager implements Disposable {
|
||||
component.setData(element, quickDocMessage, null, null, null);
|
||||
component.setToolwindowCallback(() -> {
|
||||
PsiElement docElement = component.getElement();
|
||||
documentationManager.createToolWindow(docElement, extractOriginalElement(docElement));
|
||||
ToolWindow createdToolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.DOCUMENTATION);
|
||||
if (createdToolWindow != null) {
|
||||
createdToolWindow.setAutoHide(false);
|
||||
if (docElement != null) {
|
||||
documentationManager.createToolWindow(docElement, extractOriginalElement(docElement));
|
||||
ToolWindow createdToolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.DOCUMENTATION);
|
||||
if (createdToolWindow != null) {
|
||||
createdToolWindow.setAutoHide(false);
|
||||
}
|
||||
}
|
||||
AbstractPopup popup = popupBridge.getPopup();
|
||||
if (popup != null) {
|
||||
|
||||
@@ -123,7 +123,7 @@ public class ByteCodeViewerManager extends DockablePopupManager<ByteCodeViewerCo
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doUpdateComponent(PsiElement element, PsiElement originalElement, ByteCodeViewerComponent component) {
|
||||
protected void doUpdateComponent(@NotNull PsiElement element, PsiElement originalElement, ByteCodeViewerComponent component) {
|
||||
final Content content = myToolWindow.getContentManager().getSelectedContent();
|
||||
if (content != null && element != null) {
|
||||
updateByteCode(element, component, content);
|
||||
|
||||
Reference in New Issue
Block a user