aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/swingnotification
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2015-03-21 12:11:24 +0200
committerDamian Minkov <damencho@jitsi.org>2015-03-21 12:11:24 +0200
commitaf7a0f59e74515048ca0358796a753d65f758d0d (patch)
tree8dbb1402b67aa0b2b8c3c5956f6fbac5b4481502 /src/net/java/sip/communicator/impl/swingnotification
parentbaa47d4f22831c8ec4c8b658498e1929046d5b0b (diff)
downloadjitsi-af7a0f59e74515048ca0358796a753d65f758d0d.zip
jitsi-af7a0f59e74515048ca0358796a753d65f758d0d.tar.gz
jitsi-af7a0f59e74515048ca0358796a753d65f758d0d.tar.bz2
Adds None popup message handler.
Diffstat (limited to 'src/net/java/sip/communicator/impl/swingnotification')
-rw-r--r--src/net/java/sip/communicator/impl/swingnotification/NonePopupMessageHandlerImpl.java50
-rw-r--r--src/net/java/sip/communicator/impl/swingnotification/SwingNotificationActivator.java9
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())