aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2012-08-21 15:03:33 +0000
committerDamian Minkov <damencho@jitsi.org>2012-08-21 15:03:33 +0000
commitf43ef94f586fb2cac0cca8c62cf8d2c84861ee4b (patch)
treeeb19cadf70e3a6e55af638dd422dd9acd5c8dc81 /src
parent544336a5ec981cc996592056dbc3da4093faf2e2 (diff)
downloadjitsi-f43ef94f586fb2cac0cca8c62cf8d2c84861ee4b.zip
jitsi-f43ef94f586fb2cac0cca8c62cf8d2c84861ee4b.tar.gz
jitsi-f43ef94f586fb2cac0cca8c62cf8d2c84861ee4b.tar.bz2
Adds contact removed to the ContactQuery listener, that will give the option to remove a contact once it has been shown in the ui after a query.
Diffstat (limited to 'src')
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/FilterQuery.java8
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java17
-rw-r--r--src/net/java/sip/communicator/service/contactsource/ContactQueryListener.java7
-rw-r--r--src/net/java/sip/communicator/service/contactsource/ContactRemovedEvent.java61
4 files changed, 93 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/FilterQuery.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/FilterQuery.java
index b189242..4ac17b9 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/FilterQuery.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/FilterQuery.java
@@ -330,6 +330,14 @@ public class FilterQuery
contactReceived(event.getQuerySource(), event.getContact());
}
+ /**
+ * Indicates that a contact has been removed after a search.
+ * @param event the <tt>ContactQueryEvent</tt> containing information
+ * about the received <tt>SourceContact</tt>
+ */
+ public void contactRemoved(ContactRemovedEvent event)
+ {}
+
public void metaContactReceived(MetaContactQueryEvent event) {}
public void metaGroupReceived(MetaGroupQueryEvent event) {}
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java
index 29c9b71..b20e7ae 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java
@@ -202,6 +202,14 @@ public class TreeContactList
}
/**
+ * Indicates that a contact has been removed after a search.
+ * @param event the <tt>ContactQueryEvent</tt> containing information
+ * about the received <tt>SourceContact</tt>
+ */
+ public void contactRemoved(ContactRemovedEvent event)
+ {}
+
+ /**
* Indicates that a <tt>MetaContact</tt> has been received for a search in
* the <tt>MetaContactListService</tt>.
* @param event the received <tt>MetaContactQueryEvent</tt>
@@ -1536,6 +1544,15 @@ public class TreeContactList
imageSearchCanceled = true;
}
}
+
+ /**
+ * Indicates that a contact has been removed after a search.
+ * @param event the <tt>ContactQueryEvent</tt> containing
+ * information
+ * about the received <tt>SourceContact</tt>
+ */
+ public void contactRemoved(ContactRemovedEvent event)
+ {}
});
// If the image search has been canceled from one of the
diff --git a/src/net/java/sip/communicator/service/contactsource/ContactQueryListener.java b/src/net/java/sip/communicator/service/contactsource/ContactQueryListener.java
index dc1aa90..0610331 100644
--- a/src/net/java/sip/communicator/service/contactsource/ContactQueryListener.java
+++ b/src/net/java/sip/communicator/service/contactsource/ContactQueryListener.java
@@ -28,4 +28,11 @@ public interface ContactQueryListener
* about the status change
*/
public void queryStatusChanged(ContactQueryStatusEvent event);
+
+ /**
+ * Indicates that a contact has been removed after a search.
+ * @param event the <tt>ContactQueryEvent</tt> containing information
+ * about the received <tt>SourceContact</tt>
+ */
+ public void contactRemoved(ContactRemovedEvent event);
}
diff --git a/src/net/java/sip/communicator/service/contactsource/ContactRemovedEvent.java b/src/net/java/sip/communicator/service/contactsource/ContactRemovedEvent.java
new file mode 100644
index 0000000..10c4266
--- /dev/null
+++ b/src/net/java/sip/communicator/service/contactsource/ContactRemovedEvent.java
@@ -0,0 +1,61 @@
+/*
+ * 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.service.contactsource;
+
+import java.util.*;
+
+/**
+ * The <tt>ContactRemovedEvent</tt> indicates that a
+ * <tt>SourceContact</tt> has been removed from the result of a
+ * <tt>ContactQuery</tt>.
+ * @author Yana Stamcheva
+ */
+public class ContactRemovedEvent
+ extends EventObject
+{
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * The contact that has been removed.
+ */
+ private final SourceContact contact;
+
+ /**
+ * Creates a <tt>ContactRemovedEvent</tt> by specifying the contact search
+ * source and the removed <tt>searchContact</tt>.
+ * @param source the source that triggered this event
+ * @param contact the removed contact
+ */
+ public ContactRemovedEvent(ContactQuery source,
+ SourceContact contact)
+ {
+ super(source);
+
+ this.contact = contact;
+ }
+
+ /**
+ * Returns the <tt>ContactQuery</tt> that triggered this event.
+ * @return the <tt>ContactQuery</tt> that triggered this event
+ */
+ public ContactQuery getQuerySource()
+ {
+ return (ContactQuery) source;
+ }
+
+ /**
+ * Returns the removed contact.
+ * @return the removed contact
+ */
+ public SourceContact getContact()
+ {
+ return contact;
+ }
+}