void (@NotNull JTable table, @NotNull AbstractPopup popup, @NotNull RelativePoint popupPosition, @NotNull IntRef minWidth, boolean showCodePreview, int dataSize) { if (isCodeWithMeClientInstance(popup)) return; Component toolbarComponent = ((BorderLayout)popup.getComponent().getLayout()).getLayoutComponent(BorderLayout.NORTH); Dimension toolbarSize = toolbarComponent != null ? toolbarComponent.getPreferredSize() : JBUI.emptySize(); Dimension headerSize = popup.getHeaderPreferredSize(); int width = calcMaxWidth(table); width = Math.max(headerSize.width, width); width = Math.max(toolbarSize.width, width); width = Math.max(minWidth.get(), width); minWidth.set(width); int minHeight = headerSize.height + toolbarSize.height; Rectangle rectangle = getPreferredBounds(table, popupPosition.getScreenPoint(), width, minHeight, dataSize, showCodePreview); table.setSize(rectangle.width, rectangle.height - minHeight); if (dataSize > 0) ScrollingUtil.ensureSelectionExists(table); Dimension savedSize = WindowStateService.getInstance().getSize(DIMENSION_SERVICE_KEY); JBSplitter splitter = popup.getUserData(JBSplitter.class); if (savedSize != null) { rectangle.width = Math.min(savedSize.width, rectangle.width); } if (splitter != null) { int newHeight = rectangle.height + splitter.getDividerWidth() + splitter.getSecondComponent().getMinimumSize().height; if (savedSize != null) { savedSize.height -= popup.getAdComponentHeight(); newHeight = Math.max(newHeight, savedSize.height); } rectangle.height = newHeight; } popup.setSize(rectangle.getSize()); popup.moveToFitScreen(); }