Package org.zkoss.zul

Examples of org.zkoss.zul.Checkbox


                        Iterator it3 = cell.getChildren().iterator();
                        while (it3.hasNext()) {
                            Object obj3 = it3.next();

                            if (obj3 instanceof Checkbox) {
                                Checkbox cb = (Checkbox) obj3;
                                if (cb.isChecked()) {
                                    sb.append(":");
                                    sb.append(cb.getValue());
                                }
                            }
                        }
                    }
                }
View Full Code Here


        List operationChoices = ParaCache.getInstance().getByCatalogue("pri.Fun.operations");
        Iterator it = operationChoices.iterator();
        while (it.hasNext()) {
            Para para = (Para) it.next();
            Checkbox checkbox = new Checkbox();
            checkbox.setId("checkbox_" + para.getParaName());
            checkbox.setValue(para.getParaName());
            checkbox.setLabel(para.getParaValue());

            checkbox.setParent(hbox);
        }

    }
View Full Code Here

            // if bootFlag is Yes, set the fun operations
            List operationsLists = ParaCache.getInstance().getByCatalogue("pri.Fun.operations");
            Iterator it = operationsLists.iterator();
            while (it.hasNext()) {
                Para para = (Para) it.next();
                Checkbox cb = (Checkbox) getFellow("checkbox_" + para.getParaName());
                cb.setChecked(false);

                StringTokenizer operList = new StringTokenizer(form.getOperations(), ":");
                boolean checked = false;
                while (operList.hasMoreTokens()) {
                    String token = operList.nextToken();
                    if (cb.getValue().equals(token)) {
                        checked = true;
                    }
                }
                if (checked) {
                    cb.setChecked(true);
                }
            }
        }
    }
View Full Code Here

        Iterator it = operationsLists.iterator();

        int firstCount = 0;
        while (it.hasNext()) {
            Para para = (Para) it.next();
            Checkbox cb = (Checkbox) getFellow("checkbox_" + para.getParaName());
            if (cb.isChecked()) {
                if (firstCount != 0) {
                    sb.append(":");
                }
                sb.append(cb.getValue());
            }
            firstCount++;
        }
        var.setOperations(sb.toString());
View Full Code Here

    List<Listitem> li = this.listBoxSecRoles.getItems();

    for (Listitem listitem : li) {

      Listcell lc = (Listcell) listitem.getFirstChild();
      Checkbox cb = (Checkbox) lc.getFirstChild();

      if (cb != null) {

        if (cb.isChecked() == true) {

          // Get the role object by casting
          SecRole aRole = (SecRole) listitem.getAttribute("data");
          // get the user
          SecUser anUser = getSelectedUser();

          // check if the item is newly checked. If so we cannot
          // found it in the SecUserrole-table
          SecUserrole anUserRole = getSecurityService().getUserroleByUserAndRole(anUser, aRole);

          // if new, we make a newly Object
          if (anUserRole == null) {
            anUserRole = getSecurityService().getNewSecUserrole();
            anUserRole.setSecUser(anUser);
            anUserRole.setSecRole(aRole);
          }

          try {
            // save to DB
            getSecurityService().saveOrUpdate(anUserRole);
          } catch (DataAccessException e) {
            ZksampleMessageUtils.showErrorMessage(e.getMostSpecificCause().toString());
          }

        } else if (cb.isChecked() == false) {

          // Get the role object by casting
          SecRole aRole = (SecRole) listitem.getAttribute("data");
          // get the user
          SecUser anUser = getSelectedUser();
View Full Code Here

  public void render(Listitem item, Object data) throws Exception {

    final SecRole role = (SecRole) data;

    Listcell lc = new Listcell();
    final Checkbox cb = new Checkbox();

    // get the role for which we pull the data
    final SecUser user = this.parentController.getSelected();

    if (user != null) {
      if (getSecurityService().isUserInRole(user, role)) {
        cb.setChecked(true);
      } else {
        cb.setChecked(false);
      }
    } else {
      cb.setChecked(false);
    }

    lc.appendChild(cb);
    lc.setParent(item);
View Full Code Here

    List<Listitem> li = this.listBoxSecRolegroup.getItems();

    for (Listitem listitem : li) {

      Listcell lc = (Listcell) listitem.getFirstChild();
      Checkbox cb = (Checkbox) lc.getFirstChild();

      if (cb != null) {

        if (cb.isChecked() == true) {

          // Get the group object by casting
          SecGroup aGroup = (SecGroup) listitem.getAttribute("data");
          // get the role
          SecRole aRole = getSelectedRole();

          // check if the item is newly checked. If so we cannot found
          // it in the SecGroupRight-table
          SecRolegroup aRoleGroup = getSecurityService().getRolegroupByRoleAndGroup(aRole, aGroup);

          // if new, we make a newly Object
          if (aRoleGroup == null) {
            aRoleGroup = getSecurityService().getNewSecRolegroup();
            aRoleGroup.setSecGroup(aGroup);
            aRoleGroup.setSecRole(aRole);
          }

          try {
            // save to DB
            getSecurityService().saveOrUpdate(aRoleGroup);
          } catch (DataAccessException e) {
            ZksampleMessageUtils.showErrorMessage(e.getMostSpecificCause().toString());
          }

        } else if (cb.isChecked() == false) {

          // Get the group object by casting
          SecGroup aGroup = (SecGroup) listitem.getAttribute("data");
          // get the role
          SecRole aRole = getSelectedRole();
View Full Code Here

    }

    for (Listitem listitem : li) {

      Listcell lc = (Listcell) listitem.getFirstChild();
      Checkbox cb = (Checkbox) lc.getFirstChild();

      if (cb != null) {

        if (cb.isChecked() == true) {

          // Get the object by casting
          SecRight right = (SecRight) listitem.getAttribute("data");
          // get the group
          SecGroup group = getSelectedGroup();

          // check if the item is newly checked. If so we cannot found
          // it in the SecGroupRight-table
          SecGroupright groupRight = getSecurityService().getGroupRightByGroupAndRight(group, right);

          // if new, we make a newly Object
          if (groupRight == null) {
            groupRight = getSecurityService().getNewSecGroupright();
            groupRight.setSecGroup(group);
            groupRight.setSecRight(right);
          }

          // save to DB
          try {
            getSecurityService().saveOrUpdate(groupRight);
          } catch (DataAccessException e) {
            ZksampleMessageUtils.showErrorMessage(e.getMostSpecificCause().toString());
          }

        } else if (cb.isChecked() == false) {

          // Get the object by casting
          SecRight right = (SecRight) listitem.getAttribute("data");
          // get the group
          SecGroup group = getSelectedGroup();
View Full Code Here

  public void render(Listitem item, Object data) throws Exception {

    final SecGroup group = (SecGroup) data;

    Listcell lc = new Listcell();
    final Checkbox cb = new Checkbox();

    // get the role for which we pull the data
    final SecRole role = this.parentController.getSelected();

    //
    if (role != null) {
      if (getSecurityService().isGroupInRole(group, role)) {
        cb.setChecked(true);
      } else {
        cb.setChecked(false);
      }
    } else {
      cb.setChecked(false);
    }

    lc.appendChild(cb);
    lc.setParent(item);
View Full Code Here

    lc.setParent(item);
    lc = new Listcell(user.getUsrEmail());
    lc.setParent(item);

    lc = new Listcell();
    Checkbox cb = new Checkbox();
    cb.setChecked(user.isUsrEnabled());
    cb.setDisabled(true);
    lc.appendChild(cb);
    lc.setParent(item);

    lc = new Listcell();
    cb = new Checkbox();
    cb.setChecked(user.isUsrAccountnonexpired());
    cb.setDisabled(true);
    lc.appendChild(cb);
    lc.setParent(item);

    lc = new Listcell();
    cb = new Checkbox();
    cb.setChecked(user.isUsrCredentialsnonexpired());
    cb.setDisabled(true);
    lc.appendChild(cb);
    lc.setParent(item);

    lc = new Listcell();
    cb = new Checkbox();
    cb.setChecked(user.isUsrAccountnonlocked());
    cb.setDisabled(true);
    lc.appendChild(cb);
    lc.setParent(item);

    // lc = new Listcell();
    // Image img = new Image();
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Checkbox

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.