Clean up BaseChatToolWindowTabPanel code

This commit is contained in:
Carl-Robert Linnupuu 2023-11-09 03:11:50 +02:00
parent bfd50b18ad
commit c3da76f2bd
16 changed files with 450 additions and 400 deletions

View file

@ -22,12 +22,17 @@ import javax.swing.event.HyperlinkListener;
public class SwingUtils {
public static JTextPane createTextPane(HyperlinkListener listener) {
public static JTextPane createTextPane(String text) {
return createTextPane(text, SwingUtils::handleHyperlinkClicked);
}
public static JTextPane createTextPane(String text, HyperlinkListener listener) {
var textPane = new JTextPane();
textPane.putClientProperty(JTextPane.HONOR_DISPLAY_PROPERTIES, true);
textPane.addHyperlinkListener(listener);
textPane.setContentType("text/html");
textPane.setEditable(false);
textPane.setText(text);
return textPane;
}