JComponent (@Nullable DiffContext context, @NotNull @NlsContexts.Label String message, @NotNull @NlsContexts.Label String reloadMessage, @Nullable Runnable beforeReload) { if (context instanceof DiffContextEx) { EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); Color linkColor = chooseNotNull(scheme.getAttributes(EditorColors.REFERENCE_HYPERLINK_COLOR).getForegroundColor(), JBUI.CurrentTheme.Link.Foreground.ENABLED); SimpleColoredComponent textLabel = new SimpleColoredComponent(); textLabel.setTextAlign(SwingConstants.CENTER); textLabel.setOpaque(false); textLabel.append(message); SimpleColoredComponent reloadLabel = new SimpleColoredComponent(); reloadLabel.setTextAlign(SwingConstants.CENTER); reloadLabel.setOpaque(false); reloadLabel.append(reloadMessage, new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, linkColor), (Runnable)() -> { if (beforeReload != null) beforeReload.run(); ((DiffContextEx)context).reloadDiffRequest(); }); LinkMouseListenerBase.installSingleTagOn(reloadLabel); return DiffUtil.createMessagePanel(JBUI.Panels.simplePanel(textLabel).addToBottom(reloadLabel).andTransparent()); } return DiffUtil.createMessagePanel(message); }