public class ContactListModel
extends javax.swing.AbstractListModel
Constructor and Description |
---|
ContactListModel(MetaContactListService contactList)
Initializes a new ContactListModel instance which is to
implement ListModel for a specific
MetaContactListService in order to display it in
ContactList as a list instead of a tree.
|
Modifier and Type | Method and Description |
---|---|
void |
closeGroup(MetaContactGroup group)
Closes the given group by hiding all containing contacts.
|
void |
contentAdded(int startIndex,
int endIndex)
Informs interested listeners that new cells are added from startIndex to
endIndex.
|
void |
contentChanged(int startIndex,
int endIndex)
Informs interested listeners that the content has changed of the cells
given by the range from startIndex to endIndex.
|
void |
contentRemoved(int startIndex,
int endIndex)
Informs interested listeners that a range of cells is removed.
|
int |
countChildContacts(MetaContactGroup group)
Counts group child contacts depending on the showOffline option.
|
int |
countContactsAndSubgroups(MetaContactGroup parentGroup)
Returns the number of all children of the given MetaContactGroup.
|
java.lang.Object |
getElementAt(int index)
Returns the object at the given index.
|
int |
getSize()
Returns the size of this list model.
|
int |
indexOf(java.lang.Object o)
If the given object is instance of MetaContact or MetaContactGroup
returns the index of this meta contact or group, otherwiser returns -1.
|
boolean |
isContactOnline(MetaContact contact)
Returns TRUE if the given meta contact is online, FALSE otherwise.
|
boolean |
isGroupClosed(MetaContactGroup group)
Checks whether the group is closed.
|
boolean |
isGroupEmpty(MetaContactGroup group)
Checks whether the group is closed.
|
boolean |
isShowOffline()
Returns true if offline contacts should be shown, false otherwise.
|
void |
openGroup(MetaContactGroup group)
Opens the given group by showing all containing contacts.
|
void |
setShowOffline(boolean showOffline)
Sets the showOffline variable to indicate whether or not offline contacts
should be shown.
|
public ContactListModel(MetaContactListService contactList)
contactList
- the MetaContactListService which contains the
contact list to be represented as a list by the new instancepublic void contentChanged(int startIndex, int endIndex)
startIndex
- The start index of the range .endIndex
- The end index of the range.public void contentAdded(int startIndex, int endIndex)
startIndex
- The start index of the range .endIndex
- The end index of the range.public void contentRemoved(int startIndex, int endIndex)
startIndex
- The start index of the range.endIndex
- The end index of the range.public int getSize()
public java.lang.Object getElementAt(int index)
index
- The index.public int indexOf(java.lang.Object o)
o
- the object, which index we searchpublic int countContactsAndSubgroups(MetaContactGroup parentGroup)
parentGroup
- The parent MetaContactGroup.public void closeGroup(MetaContactGroup group)
group
- The group to close.public void openGroup(MetaContactGroup group)
group
- The group to open.public boolean isGroupClosed(MetaContactGroup group)
group
- The group to check.public boolean isGroupEmpty(MetaContactGroup group)
group
- The group to check.public boolean isShowOffline()
public void setShowOffline(boolean showOffline)
showOffline
- true if offline contacts should be shown, false
otherwise.public boolean isContactOnline(MetaContact contact)
contact
- the meta contactpublic int countChildContacts(MetaContactGroup group)
group
- the parent group to count for
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.