aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/service
diff options
context:
space:
mode:
authorSymphorien Wanko <wsympho@gmail.com>2009-02-20 17:59:58 +0000
committerSymphorien Wanko <wsympho@gmail.com>2009-02-20 17:59:58 +0000
commitfecc1bc966159c745cd1b23e49dc4ef5e89e08a3 (patch)
tree892b7f1bf761342a66e54b11f8b28137c2d9e907 /src/net/java/sip/communicator/service
parent41da838ce215b00d7a2fefa32d2f132d3652a01c (diff)
downloadjitsi-fecc1bc966159c745cd1b23e49dc4ef5e89e08a3.zip
jitsi-fecc1bc966159c745cd1b23e49dc4ef5e89e08a3.tar.gz
jitsi-fecc1bc966159c745cd1b23e49dc4ef5e89e08a3.tar.bz2
enhancements to the swing popup notification, new behavior for the trayicon, minors code tweak
Diffstat (limited to 'src/net/java/sip/communicator/service')
-rw-r--r--src/net/java/sip/communicator/service/notification/NotificationService.java4
-rw-r--r--src/net/java/sip/communicator/service/systray/PopupMessage.java31
-rw-r--r--src/net/java/sip/communicator/service/systray/event/SystrayPopupMessageEvent.java32
3 files changed, 58 insertions, 9 deletions
diff --git a/src/net/java/sip/communicator/service/notification/NotificationService.java b/src/net/java/sip/communicator/service/notification/NotificationService.java
index 6026354..1998426 100644
--- a/src/net/java/sip/communicator/service/notification/NotificationService.java
+++ b/src/net/java/sip/communicator/service/notification/NotificationService.java
@@ -333,10 +333,12 @@ public interface NotificationService
* (e.g. with systray)
* @param message the message to use if and where appropriate (e.g. with
* systray or log notification.)
+ * @param tag additional info to be used by the notification handler
*/
public void fireNotification( String eventType,
String messageTitle,
- String message);
+ String message,
+ Object tag);
/**
* Fires all notifications registered for the specified <tt>eventType</tt>
diff --git a/src/net/java/sip/communicator/service/systray/PopupMessage.java b/src/net/java/sip/communicator/service/systray/PopupMessage.java
index 3f82324..60c97e0 100644
--- a/src/net/java/sip/communicator/service/systray/PopupMessage.java
+++ b/src/net/java/sip/communicator/service/systray/PopupMessage.java
@@ -35,8 +35,8 @@ public class PopupMessage
/** type of the message */
private int messageType;
- /** the contact which is the cause of this popup message */
- private Contact contact;
+ /** additional info to be used by the <tt>PopupMessageHandler</tt> */
+ private Object tag;
/**
* Creates a <tt>PopupMessage</tt> with the given title and message inside
@@ -95,6 +95,21 @@ public class PopupMessage
}
/**
+ * Creates a new <tt>PopupMessage</tt> with the given
+ * <tt>JComponent</tt> as its content. This constructor also takes a title
+ * and a message as replacements in cases the component is not usable.
+ *
+ * @param component the component to put in the <tt>PopupMessage</tt>
+ * @param title of the message
+ * @param tag additional info to be used by the <tt>PopupMessageHandler</tt>
+ */
+ public PopupMessage(String title, String message, Object tag)
+ {
+ this(title, message);
+ this.tag = tag;
+ }
+
+ /**
* @return the message
*/
public String getMessage()
@@ -175,18 +190,18 @@ public class PopupMessage
}
/**
- * @return the contact
+ * @return the object used to tag this <tt>PopupMessage</tt>
*/
- public Contact getContact()
+ public Object getTag()
{
- return contact;
+ return tag;
}
/**
- * @param contact the contact to set
+ * @param tag the object to set
*/
- public void setContact(Contact contact)
+ public void setTag(Object tag)
{
- this.contact = contact;
+ this.tag = tag;
}
}
diff --git a/src/net/java/sip/communicator/service/systray/event/SystrayPopupMessageEvent.java b/src/net/java/sip/communicator/service/systray/event/SystrayPopupMessageEvent.java
index ac0f7ef..bdc8318 100644
--- a/src/net/java/sip/communicator/service/systray/event/SystrayPopupMessageEvent.java
+++ b/src/net/java/sip/communicator/service/systray/event/SystrayPopupMessageEvent.java
@@ -17,8 +17,40 @@ import java.util.*;
public class SystrayPopupMessageEvent
extends EventObject
{
+ /** an object to distinguish this <tt>SystrayPopupMessageEvent</tt> */
+ private Object tag;
+
public SystrayPopupMessageEvent(Object source)
{
super(source);
}
+
+ /**
+ * Creates a new <tt>SystrayPopupMessageEvent</tt> with the source of the
+ * event and additional info provided by the popup handler.
+ * @param source the source of the event
+ * @param tag additional info for listeners
+ */
+ public SystrayPopupMessageEvent(Object source, Object tag)
+ {
+ super(source);
+ this.tag = tag;
+ }
+
+ /**
+ * @return the tag
+ */
+ public Object getTag()
+ {
+ return tag;
+ }
+
+ /**
+ * @param tag the tag to set
+ */
+ public void setTag(Object tag)
+ {
+ this.tag = tag;
+ }
+
}