From a68da65b4ff76362ba75103b6b7bab46f995990c Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 3 Jul 2006 13:22:34 +0400 Subject: [PATCH] HTML support in message boxes is back --- ui/openapi/com/intellij/openapi/ui/Messages.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/openapi/com/intellij/openapi/ui/Messages.java b/ui/openapi/com/intellij/openapi/ui/Messages.java index 64ea686d11..a21a2ed7ef 100644 --- a/ui/openapi/com/intellij/openapi/ui/Messages.java +++ b/ui/openapi/com/intellij/openapi/ui/Messages.java @@ -452,6 +452,7 @@ public class Messages { if (myMessage != null) { JTextPane messagePane = new JTextPane(); + messagePane.setContentType("text/html"); messagePane.setBackground(panel.getBackground()); messagePane.setText(myMessage); messagePane.setEditable(false); @@ -459,14 +460,14 @@ public class Messages { messagePane.setFont(new JLabel().getFont()); final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); final Dimension textSize = messagePane.getPreferredSize(); - if (textSize.width > screenSize.width /2 || textSize.height > screenSize.height / 2) { + if (textSize.width > screenSize.width *4/5 || textSize.height > screenSize.height / 2) { final JScrollPane pane = ScrollPaneFactory.createScrollPane(messagePane); pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); - final Dimension preferredSize = new Dimension(Math.min(textSize.width, screenSize.width/2), Math.min(textSize.height, screenSize.height/2)); + final Dimension preferredSize = new Dimension(Math.min(textSize.width, screenSize.width * 4 / 5), Math.min(textSize.height, screenSize.height/2)); pane.setPreferredSize(preferredSize); panel.add(pane, BorderLayout.CENTER); } -- 2.11.4.GIT