Examples of RosterGroup


Examples of org.jivesoftware.smack.RosterGroup

    Section sec = sections.get(account);
    Control[] controls = ((Composite)sec.getClient()).getChildren();
    for(int i = 0 ; i < controls.length ; i++)
      if(controls[i] instanceof Section) controls[i].dispose();
    while(groups.hasNext()) {
      RosterGroup group = (RosterGroup)groups.next();
      Section groupSec = createGroupSection((Composite) sec.getClient(),group.getName());
      Iterator entries = group.getEntries();
      while(entries.hasNext()) {
        RosterEntry entry = (RosterEntry)entries.next();
        createRosterEntry(tk,account,roster, (Composite)groupSec.getClient(),entry,null);
      }
    }
View Full Code Here

Examples of org.jivesoftware.smack.RosterGroup

                  return null;
                }});
          dialog.setBlockOnOpen(true);
          int code = dialog.open();
          if(code != InputDialog.OK) return;
          RosterGroup group = activeAccount.xmpp.getRoster().createGroup(dialog.getValue());
          try {
            group.addEntry(selectedEntry);
          } catch (XMPPException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
          }
        }
View Full Code Here

Examples of org.jivesoftware.smack.RosterGroup

        removeFromGroupItem.setEnabled(true);
        addToRoster.setEnabled(false);
      }
      Iterator groups = activeAccount.xmpp.getRoster().getGroups();
      while(groups.hasNext()) {
        RosterGroup group = (RosterGroup)groups.next();
        if(!group.contains(selectedEntry)) {
          MenuItem item = new MenuItem(addToGroup,SWT.PUSH);
          item.setData("group",group);
          item.setText(group.getName());
          item.addListener(SWT.Selection,addToGroupListener);
        }
      }
     
      groups = selectedEntry.getGroups();
      if(!groups.hasNext()) {
        MenuItem item = new MenuItem(removeFromGroup, SWT.PUSH);
        item.setText("Not Listed in any Group");
        item.setEnabled(false);
      }
      while(groups.hasNext()) {
        RosterGroup group = (RosterGroup)groups.next();
        MenuItem item = new MenuItem(removeFromGroup,SWT.PUSH);
        item.setData("group",group);
        item.setText(group.getName());
        item.addListener(SWT.Selection,removeFromGroupListener);
      }
    }
View Full Code Here

Examples of org.jivesoftware.smack.RosterGroup

      cmbGroup.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false));
      cmbGroup.add("Default (No Group)");
      cmbGroup.select(0);
      Iterator i = account.xmpp.getRoster().getGroups();
      while(i.hasNext()) {
        RosterGroup group = (RosterGroup)i.next();
        cmbGroup.add(group.getName());
      }
    }
  }
View Full Code Here

Examples of org.jivesoftware.smack.RosterGroup

      return;

    List<String> displayedGroups = new ArrayList<String>(groupTreeItems.keySet());
    Iterator groups = roster.getGroups();
    while (groups.hasNext()) {
      RosterGroup group = (RosterGroup) groups.next();
      updateRosterGroup(account, roster, groupTreeItems, item, group, group
          .getName());
      displayedGroups.remove(group.getName());
    }
    updateRosterGroup(account, roster, groupTreeItems, item, null, NO_GROUP_NAME);
    displayedGroups.remove(NO_GROUP_NAME);
    updateRosterGroup(account, roster, groupTreeItems, item, null,
        NO_GROUP_COMPONENT);
View Full Code Here

Examples of org.jivesoftware.smack.RosterGroup

  protected void updateRosterEntry(GOIMAccount account,
      Map<String, TreeGroup> groupTreeItems, RosterEntry entry) {
    Iterator i = entry.getGroups();
    int count = 0;
    while (i.hasNext()) {
      RosterGroup group = (RosterGroup) i.next();
      insertRosterEntryIntoGroup(account, groupTreeItems, entry, group
          .getName());
      count++;
    }
    if (count == 0)
      if (entry.getUser().indexOf('@') > -1 && !entry.getUser().equals(GOIMAccount.STATSCONTACTJID))
View Full Code Here

Examples of org.jivesoftware.smack.RosterGroup

      LOG.info(s, e);
    }
  }

  private void changeUsersGroup(UserEvent.Updated event, final Roster roster, final RosterEntry userEntry) throws XMPPException {
    RosterGroup oldGroup = roster.getGroup((String) event.getOldValue());
    RosterGroup newGroup = roster.getGroup((String) event.getNewValue());
    if (oldGroup != null) {
      oldGroup.removeEntry(userEntry);
    }

    if (newGroup == null) {
      newGroup = roster.createGroup((String) event.getNewValue());
    }
    newGroup.addEntry(userEntry);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.