aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/phonenumbercontactsource/PhoneNumberSourceContact.java
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2012-09-17 11:10:29 +0000
committerYana Stamcheva <yana@jitsi.org>2012-09-17 11:10:29 +0000
commitee908cba050cbde15384d3b0cb13357fcb0c5b41 (patch)
tree2d894ff083076e4a4306fe58aaeabfa8f2ad8810 /src/net/java/sip/communicator/plugin/phonenumbercontactsource/PhoneNumberSourceContact.java
parent4f194782e3b22e1e9f3e7b710b5d5b2b36cc6ff7 (diff)
downloadjitsi-ee908cba050cbde15384d3b0cb13357fcb0c5b41.zip
jitsi-ee908cba050cbde15384d3b0cb13357fcb0c5b41.tar.gz
jitsi-ee908cba050cbde15384d3b0cb13357fcb0c5b41.tar.bz2
Adds phonenumbers and search to transfer and conference invite dialogs. Improves the chat invite dialog by adding a search field on the top of the source contact list.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/phonenumbercontactsource/PhoneNumberSourceContact.java')
-rw-r--r--src/net/java/sip/communicator/plugin/phonenumbercontactsource/PhoneNumberSourceContact.java85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/plugin/phonenumbercontactsource/PhoneNumberSourceContact.java b/src/net/java/sip/communicator/plugin/phonenumbercontactsource/PhoneNumberSourceContact.java
new file mode 100644
index 0000000..00943f3
--- /dev/null
+++ b/src/net/java/sip/communicator/plugin/phonenumbercontactsource/PhoneNumberSourceContact.java
@@ -0,0 +1,85 @@
+/*
+ * 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.plugin.phonenumbercontactsource;
+
+import net.java.sip.communicator.service.contactsource.*;
+import net.java.sip.communicator.service.protocol.*;
+
+import java.util.*;
+
+/**
+ * The <tt>PhoneNumberSourceContact</tt> extends the
+ * <tt>GenericSourceContact</tt> and represents a contact in the
+ * <tt>PhoneNumberContactSource</tt>.
+ *
+ * @author Yana Stamcheva
+ */
+public class PhoneNumberSourceContact
+ extends GenericSourceContact
+{
+ /**
+ * The display details of this contact.
+ */
+ private String displayDetails;
+
+ /**
+ * Creates an instance of <tt>PhoneNumberSourceContact</tt>.
+ *
+ * @param contactSource the parent contact source
+ * @param contact the protocol contact corresponding to this source contact
+ * information about the phone number corresponding to this source contact
+ * @param detailDisplayName the display name of the phone number detail
+ */
+ public PhoneNumberSourceContact(PhoneNumberContactSource contactSource,
+ Contact contact,
+ List<ContactDetail> contactDetails,
+ String detailDisplayName)
+ {
+ super( contactSource,
+ contact.getDisplayName(),
+ contactDetails);
+
+ displayDetails = detailDisplayName;
+ }
+
+ /**
+ * Returns the display details of this search contact. This could be any
+ * important information that should be shown to the user.
+ *
+ * @return the display details of the search contact
+ */
+ public String getDisplayDetails()
+ {
+ return displayDetails;
+ }
+
+ /**
+ * Compares object display names.
+ */
+ @Override
+ public boolean equals(Object o)
+ {
+ if(this == o)
+ return true;
+
+ if(o == null)
+ return false;
+
+ if(o == null || getClass() != o.getClass())
+ return false;
+
+ PhoneNumberSourceContact that = (PhoneNumberSourceContact) o;
+
+ String displayName = getDisplayName();
+ if(displayName != null ?
+ !displayName.equals(that.getDisplayName())
+ : that.getDisplayName() != null)
+ return false;
+
+ return true;
+ }
+}