Package org.zkoss.zul

Examples of org.zkoss.zul.Listcell


  public void render(final Listitem listitem, Object obj) throws Exception {
    listitem.setValue(obj);
    for (int i = 0; i < model.getColumns().length; i++) {
      Object cellObj = model.getCheckedValue(obj, i);
      if (cellObj instanceof View) {
        Listcell cell = new Listcell();
        cell.appendChild(((View) cellObj).getComponent());
        listitem.appendChild(cell);
      } else if (cellObj instanceof Component) {
        Listcell cell = new Listcell();
        cell.appendChild((Component) cellObj);
        listitem.appendChild(cell);
      } else {
        Label label = new Label((String.valueOf(ObjectConverter
            .convert(cellObj))));
        label.setMultiline(true);
        Listcell cell = new Listcell();
        cell.appendChild(label);
        listitem.appendChild(cell);
      }
    }
  }
View Full Code Here


  static class FileitemRenderer implements ListitemRenderer {
    SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd mm:ss");
   
    public void render(Listitem item, Object data) throws Exception {
      File file = (File)data;
      new Listcell(file.getName()).setParent(item);
      new Listcell(format.format(new Date(file.lastModified()))).setParent(item);
    }
View Full Code Here

  public static class ListboxRendererFactory {
    public static ListitemRenderer getBeanItemRenderer() {
      return new ListitemRenderer() {
        public void render(Listitem item, Object data) throws Exception {
          SampleBean b = (SampleBean) data;
          item.appendChild(new Listcell(b.getName()));
          item.appendChild(new Listcell(b.getNumber()+""));
          item.appendChild(new Listcell(df.format(b.getDate())));
        }
      };
    }
View Full Code Here

    }
    public static ListitemRenderer getArrayItemRenderer() {
      return new ListitemRenderer() {
        public void render(Listitem item, Object data) throws Exception {
          String[] ary = (String[]) data;
          item.appendChild(new Listcell(ary[0]));
          item.appendChild(new Listcell(ary[1]));
          item.appendChild(new Listcell(ary[2]));
        }
      };
    }
View Full Code Here

      return new ListitemRenderer() {
        public void render(Listitem item, Object data) throws Exception {
          if (item instanceof Listgroup) {
            Object[] obj = (Object[]) data; // prepared by
            // createGroupHead()
            item.appendChild(new Listcell(
                getGroupHead(item, (SampleBean) obj[0], ((Integer) obj[1]).intValue())));
          } else {
            SampleBean b = (SampleBean) data;
            item.appendChild(new Listcell(b.getName()));
            item.appendChild(new Listcell(b.getNumber()+""));
            item.appendChild(new Listcell(df.format(b.getDate())));
          }
        }
        private String getGroupHead(Listitem item, SampleBean bean, int index) {
          Listheader hd =
            (Listheader) item.getListbox().getListhead().getChildren().get(index);
View Full Code Here

    }
    public static ListitemRenderer getGroupArrayItemRenderer() {
      return new ListitemRenderer() {
        public void render(Listitem item, Object obj) throws Exception {
          if (item instanceof Listgroup) {
            item.appendChild(new Listcell(obj.toString()));
          } else {
            Object[] data = (Object[]) obj;
            item.appendChild(new Listcell(data[0].toString()));
            item.appendChild(new Listcell(data[1].toString()));
            item.appendChild(new Listcell(data[2].toString()));
          }
        }
      };
    }
View Full Code Here

  static class FileitemRenderer implements ListitemRenderer {
    SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd mm:ss");

    public void render(Listitem item, Object data) throws Exception {
      File file = (File) data;
      new Listcell(file.getName()).setParent(item);
      new Listcell(format.format(new Date(file.lastModified())))
          .setParent(item);
    }
View Full Code Here

      groupfoot.applyProperties();
    }
    return groupfoot;
  }
  private Listcell newUnloadedCell(ListitemRenderer renderer, Listitem item) {
    Listcell cell = null;
    if (renderer instanceof ListitemRendererExt)
      cell = ((ListitemRendererExt)renderer).newListcell(item);

    if (cell == null) {
      cell = new Listcell();
      cell.applyProperties();
    }
    cell.setParent(item);
    return cell;
  }
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) {
View Full Code Here

  @Override
  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);

    lc = new Listcell(role.getRolShortdescription());
    lc.setParent(item);

    // lc = new Listcell();
    // Image img = new Image();
    // img.setSrc("/images/icons/page_detail.gif");
    // lc.appendChild(img);
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Listcell

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.