void () { if (project.isDisposed()) return; final PsiElement targetElement = element.getElement(); if (targetElement == null) return; final ByteCodeViewerManager codeViewerManager = ByteCodeViewerManager.getInstance(project); if (codeViewerManager.hasActiveDockedDocWindow()) { codeViewerManager.doUpdateComponent(targetElement, lineNumber, myByteCode); } else { if (myByteCode == null) { Messages.showErrorDialog(project, JavaByteCodeViewerBundle.message("bytecode.parser.failure.message", psiElementTitle), JavaByteCodeViewerBundle.message("bytecode.not.found.title")); return; } final ByteCodeViewerComponent component = new ByteCodeViewerComponent(project); component.setText(myByteCode, targetElement, lineNumber); Processor<JBPopup> pinCallback = popup -> { codeViewerManager.recreateToolWindow(targetElement, targetElement); popup.cancel(); return false; }; if (myErrorTitle != null) { JLabel errorLabel = new JLabel(myErrorTitle); Color color = EditorColorsManager.getInstance().getGlobalScheme().getColor(EditorColors.NOTIFICATION_BACKGROUND); if (color != null) { errorLabel.setBorder(new JBEmptyBorder(2)); errorLabel.setBackground(color); errorLabel.setOpaque(true); } component.add(errorLabel, BorderLayout.NORTH); } final JBPopup popup = JBPopupFactory.getInstance().createComponentPopupBuilder(component, component.getEditorComponent()) .setProject(project) .setDimensionServiceKey(project, ShowByteCodeAction.class.getName(), false) .setResizable(true) .setMovable(true) .setRequestFocus(LookupManager.getActiveLookup(editor) == null) .setTitle(JavaByteCodeViewerBundle.message("popup.title.element.bytecode", psiElementTitle)) .setCouldPin(pinCallback) .createPopup(); Disposer.register(popup, component); if (editor != null) { popup.showInBestPositionFor(editor); } else { popup.show(bestPopupLocation); } } }