Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.chat.conference
Class ChatContactListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by net.java.sip.communicator.impl.gui.main.chat.conference.ChatContactListModel
All Implemented Interfaces:
Serializable, ListModel

public class ChatContactListModel
extends AbstractListModel

Implements an AbstractListModel which represents a member list of ChatContacts. The primary purpose of the implementation is to sort the ChatContacts according to their member roles and in alphabetical order according to their names.

Author:
Lubomir Marinov
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
ChatContactListModel(ChatSession chatSession)
          Creates the model.
 
Method Summary
 void addElement(ChatContact<?> chatContact)
          Adds a specific ChatContact to this AbstractListModel implementation and preserves the sorting it applies.
 Object getElementAt(int index)
           
 int getSize()
           
 void removeAllElements()
          Removes all the elements from this model.
 void removeElement(ChatContact<?> chatContact)
          Removes a specific ChatContact from this AbstractListModel implementation.
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatContactListModel

public ChatContactListModel(ChatSession chatSession)
Creates the model.

Parameters:
chatSession - The current model chat session.
Method Detail

addElement

public void addElement(ChatContact<?> chatContact)
Adds a specific ChatContact to this AbstractListModel implementation and preserves the sorting it applies.

Parameters:
chatContact - a ChatContact to be added to this AbstractListModel

getElementAt

public Object getElementAt(int index)

getSize

public int getSize()

removeElement

public void removeElement(ChatContact<?> chatContact)
Removes a specific ChatContact from this AbstractListModel implementation.

Parameters:
chatContact - a ChatContact to be removed from this AbstractListModel if it's already contained

removeAllElements

public void removeAllElements()
Removes all the elements from this model.


Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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