Package com.tensegrity.palo.gwt.core.client.models.admin

Examples of com.tensegrity.palo.gwt.core.client.models.admin.XGroup


        new GroupRolesTab(this) };
  }

  public String getTitle(XObject input) {
    if (input instanceof XGroup) {
      XGroup group = (XGroup) input;
      String name = group.getName();
      if (name != null && !name.equals(""))
        return messages.group(name);
    }
    return constants.newGroup();
  }
View Full Code Here


    add(createPropertiesContent());
  }

  public final boolean save(XObject input) {
    if (input instanceof XGroup) {
      XGroup group = (XGroup) input;
      group.setName(name.getValue());
      group.setDescription(description.getValue());
    }
    return true;
  }
View Full Code Here

    return s;
  }
 
  public void set(XObject input) {
    if (input instanceof XGroup) {
      XGroup group = (XGroup) input;
      name.setValue(group.getName());
      description.setValue(translateDescription(group.getDescription()));
      if (group != null && group.getName() != null && (group.getName().equals("admin") ||
          group.getName().equals("editor") ||
          group.getName().equals("creator") ||
          group.getName().equals("viewer") ||
          group.getName().equals("poweruser") ||
          group.getName().equals("publisher"))) {
          name.setEnabled(false);
          description.setEnabled(false);
        } else {
          name.setEnabled(true);
          description.setEnabled(true);
View Full Code Here

    add(membersTable);
  }

  public final boolean save(XObject input) {
    if (input instanceof XGroup) {
      XGroup group = (XGroup) input;
      group.clearUsers();
      if (group.getId() == null) {
        ((GroupEditor) editor).needsUpdate = true;
        return true;
     
      for(XUser user : getAllUsers()) {
        if (isSelected(user)) {
          group.addUserID(user.getId());
          user.addGroupID(group.getId());
        } else {
          group.removeUserID(user.getId());
          user.removeGroupID(group.getId());
        }
        ((GroupEditor) editor).adminController.updateUser(user);
      }
    }
    return true;
View Full Code Here

  public void saveAs(String name, XObject input) {   
  }

  public void set(XObject input) {
    if (input instanceof XGroup) {
      XGroup group = (XGroup) input;
      membersTable.removeAll();
      List<String> userIDs = Arrays.asList(group.getUserIDs());
      setUsers(userIDs);
    }
  }
View Full Code Here

    add(rolesTable);
  }

  public final boolean save(XObject input) {
    if (input instanceof XGroup) {
      XGroup group = (XGroup) input;
      group.clearRoles();
      for(XRole role : getSelectedRoles())
        group.addRoleID(role.getId());
    }
    return true;
  }
View Full Code Here

  public void saveAs(String name, XObject input) {   
  }

  public void set(XObject input) {
    if (input instanceof XGroup) {
      XGroup group = (XGroup) input;
      rolesTable.removeAll();
      boolean isAdm = group != null && group.getName() != null && group.getName().equals("admin");
      ((CheckBoxTableColumn) rolesTable.getColumnModel().getColumn(0)).setEnabled(!isAdm);   
      List<String> roleIDs = Arrays.asList(group.getRoleIDs());
      setRoles(roleIDs);     
    }
  }
View Full Code Here

    try {
    Object input = null;
    IEditor editor = null;
    switch(eventType) {
    case ADD_GROUP_ITEM:
      input = new TreeNode(null, new XGroup());
      editor = grpEditor;
      break;
    case ADD_ROLE_ITEM:
      input = new TreeNode(null, new XRole());
      editor = roleEditor;
View Full Code Here

    return groups.toArray(new XGroup[0]);
  }
 
  private final boolean isSelected(XGroup group) {
    for(TableItem item : groupTable.getItems()) {
      XGroup xg = (XGroup) item.getData(MEMBER_DATA);
      if (xg.equals(group)) {
        boolean selected = false;
        Object colVal = item.getValue(0);
        if(colVal instanceof CheckBox)
          selected = ((CheckBox)colVal).getValue();
        else if(colVal instanceof Boolean)
View Full Code Here

            impossibleMsg = messages.impossibleToDeleteUser(user.getLogin());
          } else {
            confirmMsg = messages.deleteUser(user.getLogin());
          }
        } else if (type.equals(XGroup.TYPE)) {
          XGroup group = (XGroup) node.getXObject();
          if (group != null && group.getName() != null &&
              group.getName().equalsIgnoreCase("admin")) {
            impossibleMsg = messages.impossibleToDeleteGroup(group.getName());
          } else {
            confirmMsg = messages.deleteGroup(group.getName());
          }
        } else if (type.equals(XRole.TYPE)) {
          XRole role = (XRole) node.getXObject();
          if (role != null && role.getName() != null && (role.getName().equals("ADMIN") ||
            role.getName().equals("EDITOR") ||
View Full Code Here

TOP

Related Classes of com.tensegrity.palo.gwt.core.client.models.admin.XGroup

Copyright © 2018 www.massapicom. 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.