aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/osdependent
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2009-10-25 10:44:40 +0000
committerLyubomir Marinov <lyubomir.marinov@jitsi.org>2009-10-25 10:44:40 +0000
commit19e7816133bc3c54ebe0c1302c3a94800cff9204 (patch)
treec2d9ec0905d5f5edfcaee1f87fa21df97c556852 /src/net/java/sip/communicator/impl/osdependent
parent93c157e8d8a88b1a3d64cc217978c987806b0af6 (diff)
downloadjitsi-19e7816133bc3c54ebe0c1302c3a94800cff9204.zip
jitsi-19e7816133bc3c54ebe0c1302c3a94800cff9204.tar.gz
jitsi-19e7816133bc3c54ebe0c1302c3a94800cff9204.tar.bz2
Removes duplication from PopupMessageHandler implementations.
Diffstat (limited to 'src/net/java/sip/communicator/impl/osdependent')
-rw-r--r--src/net/java/sip/communicator/impl/osdependent/PopupMessageHandlerTrayIconImpl.java57
1 files changed, 3 insertions, 54 deletions
diff --git a/src/net/java/sip/communicator/impl/osdependent/PopupMessageHandlerTrayIconImpl.java b/src/net/java/sip/communicator/impl/osdependent/PopupMessageHandlerTrayIconImpl.java
index 3d59031..2baa1c5 100644
--- a/src/net/java/sip/communicator/impl/osdependent/PopupMessageHandlerTrayIconImpl.java
+++ b/src/net/java/sip/communicator/impl/osdependent/PopupMessageHandlerTrayIconImpl.java
@@ -7,7 +7,6 @@
package net.java.sip.communicator.impl.osdependent;
import java.awt.event.*;
-import java.util.*;
import net.java.sip.communicator.service.systray.*;
import net.java.sip.communicator.service.systray.event.*;
@@ -17,7 +16,8 @@ import net.java.sip.communicator.util.*;
* An implementation of the <tt>PopupMsystrayessageHandler</tt> using the
* tray icon.
*/
-public class PopupMessageHandlerTrayIconImpl implements PopupMessageHandler
+public class PopupMessageHandlerTrayIconImpl
+ extends AbstractPopupMessageHandler
{
/**
* The logger for this class.
@@ -25,14 +25,9 @@ public class PopupMessageHandlerTrayIconImpl implements PopupMessageHandler
private static Logger logger =
Logger.getLogger(PopupMessageHandlerTrayIconImpl.class);
- /** The list of all added systray popup listeners */
- private final List<SystrayPopupMessageListener> PopupMessageListener =
- new Vector<SystrayPopupMessageListener>();
-
/** the tray icon we will use to popup messages */
private TrayIcon trayIcon;
-
/**
* Creates a new <tt>PopupMessageHandlerTrayIconImpl</tt> which will uses
* the provided <tt>TrayIcon</tt> to show message.
@@ -51,31 +46,6 @@ public class PopupMessageHandlerTrayIconImpl implements PopupMessageHandler
}
/**
- * Implementation of <tt>PopupMessageHandler.addPopupMessageListener</tt>
- * @param listener the listener to add
- */
- public void addPopupMessageListener(SystrayPopupMessageListener listener)
- {
- synchronized (PopupMessageListener)
- {
- if (!PopupMessageListener.contains(listener))
- PopupMessageListener.add(listener);
- }
- }
-
- /**
- * Implementation of <tt>PopupMessageHandler.removePopupMessageListener</tt>
- * @param listener the listener to remove
- */
- public void removePopupMessageListener(SystrayPopupMessageListener listener)
- {
- synchronized (PopupMessageListener)
- {
- PopupMessageListener.remove(listener);
- }
- }
-
- /**
* Implements <tt>PopupMessageHandler#showPopupMessage()</tt>
*
* @param popupMessage the message we will show
@@ -97,31 +67,10 @@ public class PopupMessageHandlerTrayIconImpl implements PopupMessageHandler
}
/**
- * Notifies all interested listeners that a <tt>SystrayPopupMessageEvent</tt>
- * has occured.
- *
- * @param SystrayPopupMessageEvent the evt to send to listener.
- */
- private void firePopupMessageClicked(SystrayPopupMessageEvent evt)
- {
- logger.trace("Will dispatch the following systray popup event: " + evt);
-
- List<SystrayPopupMessageListener> listeners;
- synchronized (PopupMessageListener)
- {
- listeners =
- new ArrayList<SystrayPopupMessageListener>(
- PopupMessageListener);
- }
-
- for (SystrayPopupMessageListener listener : listeners)
- listener.popupMessageClicked(evt);
- }
-
- /**
* Implements <tt>toString</tt> from <tt>PopupMessageHandler</tt>
* @return a description of this handler
*/
+ @Override
public String toString()
{
return OsDependentActivator.getResources()