diff options
author | Yana Stamcheva <yana@jitsi.org> | 2010-02-04 11:31:53 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2010-02-04 11:31:53 +0000 |
commit | b1b3e4992e18b8002f237cdba1966d87f8fce524 (patch) | |
tree | 3af704f0886cc50bd9e4a3c1e7e0ac818f9895f4 /src/net/java/sip/communicator/impl/gui/main/contactlist/ContactNode.java | |
parent | d855fdda93722ac2d7b4c61fe2834c6e305787ea (diff) | |
download | jitsi-b1b3e4992e18b8002f237cdba1966d87f8fce524.zip jitsi-b1b3e4992e18b8002f237cdba1966d87f8fce524.tar.gz jitsi-b1b3e4992e18b8002f237cdba1966d87f8fce524.tar.bz2 |
First version of the modified contact list interface. Modifications include a new search box allowing to filter the contact list, contact expansion on select, different approach for calling contacts and more.
Diffstat (limited to 'src/net/java/sip/communicator/impl/gui/main/contactlist/ContactNode.java')
-rw-r--r-- | src/net/java/sip/communicator/impl/gui/main/contactlist/ContactNode.java | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactNode.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactNode.java new file mode 100644 index 0000000..888ca65 --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactNode.java @@ -0,0 +1,83 @@ +/* + * SIP Communicator, 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.gui.main.contactlist; + +import javax.swing.tree.*; + +import net.java.sip.communicator.service.contactlist.*; + +/** + * The <tt>ContactNode</tt> is a <tt>ContactListNode</tt> corresponding to a + * given <tt>MetaContact</tt>. + * + * @author Yana Stamcheva + */ +public class ContactNode + extends DefaultMutableTreeNode + implements ContactListNode +{ + /** + * The <tt>MetaContact</tt> corresponding to this contact node. + */ + private MetaContact metaContact; + + /** + * Indicates if this node is currently active. Has unread messages waiting. + */ + private boolean isActive; + + /** + * Creates a <tt>ContactNode</tt> by specifying the corresponding + * <tt>metaContact</tt>. + * @param metaContact the <tt>MetaContact</tt> corresponding to this node + */ + public ContactNode(MetaContact metaContact) + { + super(metaContact); + this.metaContact = metaContact; + } + + /** + * Returns the corresponding <tt>MetaContact</tt>. + * @return the corresponding <tt>MetaContact</tt> + */ + public MetaContact getMetaContact() + { + return (MetaContact) getUserObject(); + } + + /** + * Returns the index of this contact node in its parent group in + * the <tt>MetaContactListService</tt>. + * @return the index in the <tt>MetaContactListService</tt> + */ + public int getMetaContactListIndex() + { + return metaContact.getParentMetaContactGroup().indexOf(metaContact); + } + + /** + * Returns <tt>true</tt> if this contact node has unread received messages + * waiting, otherwise returns <tt>false</tt>. + * @return <tt>true</tt> if this contact node has unread received messages + * waiting, otherwise returns <tt>false</tt> + */ + public boolean isActive() + { + return isActive; + } + + /** + * Sets this contact node as active, which indicates it has unread received + * messages waiting. + * @param isActive indicates if this contact is active + */ + public void setActive(boolean isActive) + { + this.isActive = isActive; + } +} |