Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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

public class SourceUIContact
extends Object
implements UIContact

The SourceUIContact is the implementation of the UIContact for the ExternalContactSource.

Author:
Yana Stamcheva

Constructor Summary
SourceUIContact(SourceContact contact, UIGroup parentGroup)
          Creates an instance of SourceUIContact by specifying the SourceContact, on which this abstraction is based and the parent UIGroup.
 
Method Summary
 ImageIcon getAvatar(boolean isSelected, int width, int height)
          Returns the image corresponding to the underlying SourceContact.
 List<UIContactDetail> getContactDetailsForOperationSet(Class<? extends OperationSet> opSetClass)
          Returns a list of UIContactDetails supporting the given OperationSet class.
 ContactNode getContactNode()
          Returns the corresponding ContactNode from the contact list component.
 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 SourceContact this abstraction is about.
 String getDisplayDetails()
          Returns the display details for the underlying SourceContact.
 String getDisplayName()
          Returns the display name of the underlying SourceContact.
 UIGroup getParentGroup()
          Returns the parent UIGroup.
 JPopupMenu getRightButtonMenu()
          Returns the JPopupMenu opened on a right button click over this SourceUIContact.
 Iterator<String> getSearchStrings()
          Returns an Iterator over a list of strings, which can be used to find this contact.
 int getSourceIndex()
          Returns -1 to indicate that the source index of the underlying SourceContact is unknown.
 ImageIcon getStatusIcon()
          Returns null to indicate unknown status of the underlying SourceContact.
 ExtendedTooltip getToolTip()
          Returns the tool tip opened on mouse over.
 void setContactNode(ContactNode contactNode)
          Sets the corresponding ContactNode.
 void setParentGroup(UIGroup parentGroup)
          The parent group of source contacts could not be changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceUIContact

public SourceUIContact(SourceContact contact,
                       UIGroup parentGroup)
Creates an instance of SourceUIContact by specifying the SourceContact, on which this abstraction is based and the parent UIGroup.

Parameters:
contact - the SourceContact, on which this abstraction is based
parentGroup - the parent UIGroup
Method Detail

getDisplayName

public String getDisplayName()
Returns the display name of the underlying SourceContact.

Specified by:
getDisplayName in interface UIContact
Returns:
the display name

getParentGroup

public UIGroup getParentGroup()
Returns the parent UIGroup.

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

setParentGroup

public void setParentGroup(UIGroup parentGroup)
The parent group of source contacts could not be changed.

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

getSourceIndex

public int getSourceIndex()
Returns -1 to indicate that the source index of the underlying SourceContact is unknown.

Specified by:
getSourceIndex in interface UIContact
Returns:
-1

getStatusIcon

public ImageIcon getStatusIcon()
Returns null to indicate unknown status of the underlying SourceContact.

Specified by:
getStatusIcon in interface UIContact
Returns:
null

getAvatar

public ImageIcon getAvatar(boolean isSelected,
                           int width,
                           int height)
Returns the image corresponding to the underlying SourceContact.

Specified by:
getAvatar in interface UIContact
Parameters:
isSelected - indicates if the contact is currently selected in the contact list component
width - the desired image width
height - the desired image height
Returns:
the image

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

getDescriptor

public Object getDescriptor()
Returns the underlying SourceContact this abstraction is about.

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

getDisplayDetails

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

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

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

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

getContactNode

public ContactNode getContactNode()
Returns the corresponding ContactNode from the contact list component.

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

getRightButtonMenu

public JPopupMenu getRightButtonMenu()
Returns the JPopupMenu opened on a right button click over this SourceUIContact.

Specified by:
getRightButtonMenu in interface UIContact
Returns:
the JPopupMenu opened on a right button click over this SourceUIContact

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

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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