JComponent () { myUsagePreviewPanel = new UsagePreviewPanel(myProject, new UsageViewPresentation()); myUsageFileLabel = new JLabel(); myTable.setModel(myTableModel); myTableModel.getSpaceAction().register(); myTableModel.addTableModelListener(e -> handleChanges()); myTable.addMouseListener(new PopupHandler() { @Override public void invokePopup(Component comp, int x, int y) { if (myTable.getSelectedRows() != null) { compoundPopup().show(comp, x, y); } } }); TableColumnModel columnModel = myTable.getColumnModel(); columnModel.getColumn(CHECK_COLUMN).setCellRenderer(new BooleanTableCellRenderer()); TableUtil.setupCheckboxColumn(columnModel.getColumn(CHECK_COLUMN), 0); columnModel.getColumn(NEW_NAME_COLUMN).setCellEditor(new StringTableCellEditor(myProject)); mySelectAllButton.addActionListener(e -> { Arrays.fill(myShouldRename, true); fireDataChanged(); }); myUnselectAllButton.addActionListener(e -> { Arrays.fill(myShouldRename, false); fireDataChanged(); }); myListSelectionListener = e -> { myUsageFileLabel.setText(""); int index = myTable.getSelectionModel().getLeadSelectionIndex(); if (index != -1) { PsiNamedElement element = myRenames[index]; UsageInfo usageInfo = new UsageInfo(element); myUsagePreviewPanel.updateLayout(Collections.singletonList(usageInfo)); final PsiFile containingFile = element.getContainingFile(); if (containingFile != null) { final VirtualFile virtualFile = containingFile.getVirtualFile(); if (virtualFile != null) { myUsageFileLabel.setText(virtualFile.getName()); } } } else { myUsagePreviewPanel.updateLayout(null); } }; myTable.getSelectionModel().addListSelectionListener(myListSelectionListener); myPanelForPreview.add(myUsagePreviewPanel, BorderLayout.CENTER); myUsagePreviewPanel.updateLayout(null); myPanelForPreview.add(myUsageFileLabel, BorderLayout.NORTH); double top = mySplitPane.getTopComponent().getPreferredSize().getHeight(); double bottom = mySplitPane.getBottomComponent().getPreferredSize().getHeight(); mySplitPane.setDividerLocation(top / (top + bottom)); GuiUtils.replaceJSplitPaneWithIDEASplitter(myPanel); if (!ApplicationManager.getApplication().isUnitTestMode()) { SwingUtilities.invokeLater(() -> { if (myTableModel.getRowCount() != 0) { myTable.getSelectionModel().addSelectionInterval(0, 0); } }); } myOptionsPanel.setVisible(false); return myPanel; }