aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/swingnotification
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2009-02-24 21:19:17 +0000
committerYana Stamcheva <yana@jitsi.org>2009-02-24 21:19:17 +0000
commit35f1ff2288a9388b869484c7958661b04c6f1ae2 (patch)
treebb726c0b6a72afd4042aede81fc8c2bf4d343f1f /src/net/java/sip/communicator/impl/swingnotification
parent34209282eb100dc384b0a77b23701d3505adae7f (diff)
downloadjitsi-35f1ff2288a9388b869484c7958661b04c6f1ae2.zip
jitsi-35f1ff2288a9388b869484c7958661b04c6f1ae2.tar.gz
jitsi-35f1ff2288a9388b869484c7958661b04c6f1ae2.tar.bz2
Optimize HTML2Text to parse html directly through HTMLEditorKit, instead of creating an HTMLDocument.
Diffstat (limited to 'src/net/java/sip/communicator/impl/swingnotification')
-rw-r--r--src/net/java/sip/communicator/impl/swingnotification/PopupMessageHandlerSwingImpl.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/net/java/sip/communicator/impl/swingnotification/PopupMessageHandlerSwingImpl.java b/src/net/java/sip/communicator/impl/swingnotification/PopupMessageHandlerSwingImpl.java
index 04b86bf..48364b6 100644
--- a/src/net/java/sip/communicator/impl/swingnotification/PopupMessageHandlerSwingImpl.java
+++ b/src/net/java/sip/communicator/impl/swingnotification/PopupMessageHandlerSwingImpl.java
@@ -143,16 +143,16 @@ public class PopupMessageHandlerSwingImpl implements PopupMessageHandler
*/
private JComponent createPopup( String titleString,
String message,
- byte[] imageIcon,
+ byte[] imageBytes,
Object tag)
{
FramedImage msgIcon = new FramedImage(defaultIcon, 45, 45);
- if (imageIcon != null)
+ if (imageBytes != null)
{
- ImageIcon contactIcon = new ImageIcon(imageIcon);
+ ImageIcon imageIcon = new ImageIcon(imageBytes);
- msgIcon = new FramedImage(contactIcon, 45, 45);
+ msgIcon = new FramedImage(imageIcon, 45, 45);
}
JLabel msgTitle = new JLabel(titleString);
@@ -161,13 +161,15 @@ public class PopupMessageHandlerSwingImpl implements PopupMessageHandler
msgTitle.setPreferredSize(new Dimension(200, msgTitleHeight));
msgTitle.setFont(msgTitle.getFont().deriveFont(Font.BOLD));
- JTextArea msgContent = new JTextArea(message);
+ String plainMessage = Html2Text.extractText(message);
+ JTextArea msgContent = new JTextArea(plainMessage);
msgContent.setLineWrap(true);
msgContent.setWrapStyleWord(true);
msgContent.setOpaque(false);
msgContent.setAlignmentX(JTextArea.LEFT_ALIGNMENT);
- int msgContentHeight = getPopupMessageAreaHeight(msgContent, message);
+ int msgContentHeight
+ = getPopupMessageAreaHeight(msgContent, plainMessage);
msgContent.setPreferredSize(new Dimension(200, msgContentHeight));
TransparentPanel notificationBody = new TransparentPanel();