mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-44504 - assert: DockablePopupManager.createToolWindow
This commit is contained in:
+15
-2
@@ -70,8 +70,21 @@ public abstract class DockablePopupManager<T extends JComponent & Disposable> {
|
||||
protected abstract String getTitle(PsiElement element);
|
||||
protected abstract String getToolwindowId();
|
||||
|
||||
|
||||
|
||||
public Content recreateToolWindow(PsiElement element, PsiElement originalElement) {
|
||||
if (myToolWindow == null) {
|
||||
createToolWindow(element, originalElement);
|
||||
return null;
|
||||
}
|
||||
|
||||
final Content content = myToolWindow.getContentManager().getSelectedContent();
|
||||
if (content == null || !myToolWindow.isVisible()) {
|
||||
restorePopupBehavior();
|
||||
createToolWindow(element, originalElement);
|
||||
return null;
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
public void createToolWindow(final PsiElement element, PsiElement originalElement) {
|
||||
assert myToolWindow == null;
|
||||
|
||||
|
||||
+3
-12
@@ -190,21 +190,12 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
}
|
||||
|
||||
public void showJavaDocInfoAtToolWindow(@NotNull PsiElement element, @NotNull PsiElement original) {
|
||||
if (myToolWindow == null) {
|
||||
createToolWindow(element, original);
|
||||
return;
|
||||
}
|
||||
|
||||
final Content content = myToolWindow.getContentManager().getSelectedContent();
|
||||
if (content == null || !myToolWindow.isVisible()) {
|
||||
restorePopupBehavior();
|
||||
createToolWindow(element, original);
|
||||
return;
|
||||
}
|
||||
final Content content = recreateToolWindow(element, original);
|
||||
if (content == null) return;
|
||||
|
||||
fetchDocInfo(getDefaultCollector(element, original), (DocumentationComponent)content.getComponent(), true);
|
||||
}
|
||||
|
||||
|
||||
public void showJavaDocInfo(@NotNull final PsiElement element, final PsiElement original) {
|
||||
showJavaDocInfo(element, original, false, null);
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ShowByteCodeAction extends AnAction {
|
||||
Processor<JBPopup> pinCallback = new Processor<JBPopup>() {
|
||||
@Override
|
||||
public boolean process(JBPopup popup) {
|
||||
codeViewerManager.createToolWindow(targetElement, targetElement);
|
||||
codeViewerManager.recreateToolWindow(targetElement, targetElement);
|
||||
popup.cancel();
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user