VcsDependentHistoryComponents (final VcsHistorySession session, JComponent forShortcutRegistration) { final ColumnInfo<?, ?>[] columns; final Consumer<VcsFileRevision> listener; final JComponent addComp; if (((SvnHistorySession)session).isHaveMergeSources()) { final MergeSourceColumnInfo mergeSourceColumn = new MergeSourceColumnInfo((SvnHistorySession)session); columns = new ColumnInfo[]{new CopyFromColumnInfo(), mergeSourceColumn}; final JTextArea field = new JTextArea() { final StatusText statusText = new StatusText(this) { @Override protected boolean isStatusVisible() { return getDocument().getLength() == 0; } }; @Override public Color getBackground() { return UIUtil.getEditorPaneBackground(); } { statusText.setText(message("status.text.merge.sources")); setEditable(false); setWrapStyleWord(true); setLineWrap(true); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); statusText.paint(this, g); } }; listener = vcsFileRevision -> { field.setText(mergeSourceColumn.getText(vcsFileRevision)); field.setCaretPosition(0); field.repaint(); }; final MergeSourceDetailsAction sourceAction = new MergeSourceDetailsAction(); sourceAction.registerSelf(forShortcutRegistration); JPanel fieldPanel = new ToolbarDecorator() { @Override protected @NotNull JComponent getComponent() { return createScrollPane(field, true); } @Override protected void updateButtons() { } @Override protected void installDnDSupport() { } @Override protected boolean isModelEditable() { return false; } }.initPosition() .addExtraAction(AnActionButton.fromAction(sourceAction)) .createPanel(); fieldPanel.setBorder(JBUI.Borders.empty()); addComp = fieldPanel; } else { columns = new ColumnInfo[]{new CopyFromColumnInfo()}; addComp = null; listener = null; } return new VcsDependentHistoryComponents(columns, listener, addComp); }