diff options
Diffstat (limited to 'src/net/java/sip/communicator/impl/swingnotification')
-rw-r--r-- | src/net/java/sip/communicator/impl/swingnotification/NonePopupMessageHandlerImpl.java | 50 | ||||
-rw-r--r-- | src/net/java/sip/communicator/impl/swingnotification/SwingNotificationActivator.java | 9 |
2 files changed, 55 insertions, 4 deletions
diff --git a/src/net/java/sip/communicator/impl/swingnotification/NonePopupMessageHandlerImpl.java b/src/net/java/sip/communicator/impl/swingnotification/NonePopupMessageHandlerImpl.java new file mode 100644 index 0000000..474cb60 --- /dev/null +++ b/src/net/java/sip/communicator/impl/swingnotification/NonePopupMessageHandlerImpl.java @@ -0,0 +1,50 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.impl.swingnotification; + +import net.java.sip.communicator.service.systray.*; + +/** + * Empty popup message handler. Used when we want to disable popup messages. + * @author Damian Minkov + */ +public class NonePopupMessageHandlerImpl + extends AbstractPopupMessageHandler +{ + /** + * Implements <tt>PopupMessageHandler#showPopupMessage()</tt> + * Doing nothing. + * + * @param popupMessage the message we will show + */ + @Override + public void showPopupMessage(PopupMessage popupMessage) + {} + + /** + * Implements <tt>getPreferenceIndex</tt> from + * <tt>NonePopupMessageHandlerImpl</tt>. + * This handler is a empty one, thus the preference index is 0. + * @return a preference index + */ + @Override + public int getPreferenceIndex() + { + return 0; + } + + /** + * Implements <tt>toString</tt> from <tt>PopupMessageHandler</tt> + * @return a description of this handler + */ + @Override + public String toString() + { + return SwingNotificationActivator.getResources() + .getI18NString("service.gui.NONE"); + } +} diff --git a/src/net/java/sip/communicator/impl/swingnotification/SwingNotificationActivator.java b/src/net/java/sip/communicator/impl/swingnotification/SwingNotificationActivator.java index 8424ec9..31dcb02 100644 --- a/src/net/java/sip/communicator/impl/swingnotification/SwingNotificationActivator.java +++ b/src/net/java/sip/communicator/impl/swingnotification/SwingNotificationActivator.java @@ -53,14 +53,15 @@ public class SwingNotificationActivator implements BundleActivator bundleContext = bc; - PopupMessageHandler handler = null; - handler = new PopupMessageHandlerSwingImpl(); - getConfigurationService(); bc.registerService( PopupMessageHandler.class.getName() - , handler + , new PopupMessageHandlerSwingImpl() + , null); + bc.registerService( + PopupMessageHandler.class.getName() + , new NonePopupMessageHandlerImpl() , null); if (logger.isInfoEnabled()) |