}
private void updatePermissions(TreeItem[] treeItems) {
if (!groupText.getText().equals("")) {
try {
Group group = (Group) system.query(new GetGroup(groupText.getText()));
for (TreeItem item : treeItems) {
TreeItem[] childrenItems = item.getItems();
if (childrenItems.length > 0) {
updatePermissions(childrenItems);
}
for (String permission : group.getPermissions()) {
if (permission.equals(item.getText())) {
item.setChecked(true);
break;
}
}