Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.contactlist.contactsource
Class MetaUIContact

java.lang.Object
  extended by net.java.sip.communicator.impl.gui.main.contactlist.contactsource.MetaUIContact
All Implemented Interfaces:
UIContact

public class MetaUIContact
extends Object
implements UIContact

The MetaUIContact is the implementation of the UIContact interface for the MetaContactListService. This implementation is based on the MetaContact.

Author:
Yana Stamcheva

Field Summary
(package private)  boolean subscribed
          The subscription status of this meta contact.
 
Constructor Summary
MetaUIContact(MetaContact metaContact)
          Creates an instance of MetaUIContact by specifying the underlying MetaContact, on which it's based.
 
Method Summary
 ImageIcon getAvatar(boolean isSelected, int width, int height)
          Gets the avatar of a specific MetaContact in the form of an ImageIcon value.
 List<UIContactDetail> getContactDetailsForOperationSet(Class<? extends OperationSet> opSetClass)
          Returns a list of UIContactDetails supporting the given OperationSet class.
 ContactNode getContactNode()
          Returns the corresponding ContactNode in the contact list component data model.
 UIContactDetail getDefaultContactDetail(Class<? extends OperationSet> opSetClass)
          Returns the default ContactDetail to use for any operations depending to the given OperationSet class.
 Object getDescriptor()
          Returns the underlying MetaContact.
 String getDisplayDetails()
          Returns the display details for the underlying MetaContact.
 String getDisplayName()
          Returns the display name of this MetaUIContact.
 UIGroup getParentGroup()
          Returns the parent UIGroup.
 JPopupMenu getRightButtonMenu()
          Returns the right button menu component.
 Iterator<String> getSearchStrings()
          Returns an Iterator over a list of strings, which can be used to find this contact.
 int getSourceIndex()
          Returns the index of the underlying MetaContact in its MetaContactListService parent group.
 ImageIcon getStatusIcon()
          Returns the general status icon of the given MetaContact.
 ExtendedTooltip getToolTip()
          Returns the tool tip opened on mouse over.
 void setContactNode(ContactNode contactNode)
          Sets the corresponding ContactNode.
 void setParentGroup(UIGroup parentGroup)
          Sets the given parentGroup to be the parent UIGroup of this MetaUIContact.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subscribed

boolean subscribed
The subscription status of this meta contact. It will be turned to true when all the contact details are checked.

Constructor Detail

MetaUIContact

public MetaUIContact(MetaContact metaContact)
Creates an instance of MetaUIContact by specifying the underlying MetaContact, on which it's based.

Parameters:
metaContact - the MetaContact, on which this implementation is based
Method Detail

getDescriptor

public Object getDescriptor()
Returns the underlying MetaContact.

Specified by:
getDescriptor in interface UIContact
Returns:
the underlying MetaContact

getDisplayName

public String getDisplayName()
Returns the display name of this MetaUIContact.

Specified by:
getDisplayName in interface UIContact
Returns:
the display name of this MetaUIContact

getSourceIndex

public int getSourceIndex()
Returns the index of the underlying MetaContact in its MetaContactListService parent group.

Specified by:
getSourceIndex in interface UIContact
Returns:
the source index of the underlying MetaContact

getSearchStrings

public Iterator<String> getSearchStrings()
Returns an Iterator over a list of strings, which can be used to find this contact.

Specified by:
getSearchStrings in interface UIContact
Returns:
an Iterator over a list of search strings

getStatusIcon

public ImageIcon getStatusIcon()
Returns the general status icon of the given MetaContact. Detects the status using the priority status table. The priority is defined on the "availability" factor and here the most "available" status is returned.

Specified by:
getStatusIcon in interface UIContact
Returns:
PresenceStatus The most "available" status from all sub-contact statuses.

getParentGroup

public UIGroup getParentGroup()
Returns the parent UIGroup.

Specified by:
getParentGroup in interface UIContact
Returns:
the parent UIGroup

setParentGroup

public void setParentGroup(UIGroup parentGroup)
Sets the given parentGroup to be the parent UIGroup of this MetaUIContact.

Specified by:
setParentGroup in interface UIContact
Parameters:
parentGroup - the parent UIGroup to set

getDefaultContactDetail

public UIContactDetail getDefaultContactDetail(Class<? extends OperationSet> opSetClass)
Returns the default ContactDetail to use for any operations depending to the given OperationSet class.

Specified by:
getDefaultContactDetail in interface UIContact
Parameters:
opSetClass - the OperationSet class we're interested in
Returns:
the default ContactDetail to use for any operations depending to the given OperationSet class

getContactDetailsForOperationSet

public List<UIContactDetail> getContactDetailsForOperationSet(Class<? extends OperationSet> opSetClass)
Returns a list of UIContactDetails supporting the given OperationSet class.

Specified by:
getContactDetailsForOperationSet in interface UIContact
Parameters:
opSetClass - the OperationSet class we're interested in
Returns:
a list of UIContactDetails supporting the given OperationSet class

getAvatar

public ImageIcon getAvatar(boolean isSelected,
                           int width,
                           int height)
Gets the avatar of a specific MetaContact in the form of an ImageIcon value.

Specified by:
getAvatar in interface UIContact
Parameters:
isSelected - indicates if the contact is selected
width - the desired icon width
height - the desired icon height
Returns:
an ImageIcon which represents the avatar of the specified MetaContact

getDisplayDetails

public String getDisplayDetails()
Returns the display details for the underlying MetaContact.

Specified by:
getDisplayDetails in interface UIContact
Returns:
the display details for the underlying MetaContact

getToolTip

public ExtendedTooltip getToolTip()
Returns the tool tip opened on mouse over.

Specified by:
getToolTip in interface UIContact
Returns:
the tool tip opened on mouse over

getContactNode

public ContactNode getContactNode()
Returns the corresponding ContactNode in the contact list component data model.

Specified by:
getContactNode in interface UIContact
Returns:
the corresponding ContactNode

setContactNode

public void setContactNode(ContactNode contactNode)
Sets the corresponding ContactNode.

Specified by:
setContactNode in interface UIContact
Parameters:
contactNode - the corresponding ContactNode in the contact list component data model

getRightButtonMenu

public JPopupMenu getRightButtonMenu()
Returns the right button menu component.

Specified by:
getRightButtonMenu in interface UIContact
Returns:
the right button menu component

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.