groups list get directly from the MetaContactListService

cusax-fix
Yana Stamcheva 20 years ago
parent f1a9979b75
commit 599df42013

@ -44,8 +44,6 @@ public class ContactList extends JList
private MetaContact currentlySelectedContact;
private ArrayList groupsList = new ArrayList();
/**
* Creates an instance of the <tt>ContactList</tt>.
*
@ -151,8 +149,6 @@ public void metaContactGroupAdded(MetaContactGroupEvent evt) {
//this.ensureIndexIsVisible(0);
this.revalidate();
this.groupsList.add(sourceGroup);
}
/**
@ -270,8 +266,8 @@ public int getNextMatch(String prefix, int startIndex, Position.Bias bias) {
* Returns the list of all groups.
* @return The list of all groups.
*/
public Iterator getAllGroups() {
return groupsList.iterator();
public Iterator getAllGroups() {
return contactList.getRoot().getSubgroups();
}
/**
@ -280,9 +276,10 @@ public Iterator getAllGroups() {
* @param metaUID An identifier of a group.
* @return The Meta Contact Group corresponding to the given MetaUID.
*/
public MetaContactGroup getGroupByID(String metaUID) {
for(int i = 0; i < groupsList.size(); i ++) {
MetaContactGroup group = (MetaContactGroup)groupsList.get(i);
public MetaContactGroup getGroupByID(String metaUID) {
Iterator i = contactList.getRoot().getSubgroups();
while(i.hasNext()){
MetaContactGroup group = (MetaContactGroup)i.next();
if(group.getMetaUID().equals(metaUID)) {
return group;

@ -125,7 +125,9 @@ private void initGroupsTable(){
}
public void addCheckBoxCellListener(CellEditorListener l) {
groupsTable.getCellEditor(0, 0).addCellEditorListener(l);
if(groupsTable.getModel().getRowCount() != 0) {
groupsTable.getCellEditor(0, 0).addCellEditorListener(l);
}
}
/**

Loading…
Cancel
Save