Package org.zkoss.zul

Examples of org.zkoss.zul.ListitemRenderer


    ActionListener dropListener = new ActionListener() {
      public void actionPerformed(Event event) {
        dropPerformed((DropEvent) event);
      }
    };
    ListitemRenderer treeTableRenderer = new ContainerTableRenderer(
        getListbox().getItemRenderer(), dropListener);
    getListbox().setItemRenderer(treeTableRenderer);
  }
View Full Code Here


      }
    });
  }

  public void setItemRenderer(final ItemRenderer renderer) {
    setItemRenderer(new ListitemRenderer() {
      public void render(Listitem item, Object data) throws Exception {
        item.setValue(data);
        item.setLabel(renderer.render(data));
        item.setDraggable(Sortbox.this.toString());
        item.setDroppable(Sortbox.this.toString());
View Full Code Here

        if(CLEAR.equals(aname)) return -1;
        if(CLEAR.equals(bname)) return 1;
        return aname.compareTo(bname);
      }
    });
    zulListbox.setItemRenderer(new ListitemRenderer(){
      public void render(Listitem listitem, Object data) {
        final File f = (File) data;
        final String fname = f.getName();
        listitem.setLabel(fname.substring(0, fname.length()-4));
        listitem.addEventListener("onClick", new EventListener(){
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

          item.appendChild(new Listcell(df.format(b.getDate())));
        }
      };
    }
    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

          item.appendChild(new Listcell(ary[2]));
        }
      };
    }
    public static ListitemRenderer getGroupBeanItemRenderer() {
      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(
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;
View Full Code Here

      if (min < 0)
        if (max < 0) min = 0;
        else min = max - cnt + 1;
      if (min > oldsz) min = oldsz;

      ListitemRenderer renderer = null;
      final Component next =
        min < oldsz ? _listbox.getItemAtIndex(min): null;
      while (--cnt >= 0) {
        if (renderer == null)
          renderer = (ListitemRenderer) getRealRenderer();
View Full Code Here

    }
    cell.setParent(item);
    return cell;
  }
  public Object getRealRenderer() {
    final ListitemRenderer renderer = _listbox.getItemRenderer();
    return renderer != null ? renderer : _defRend;
  }
View Full Code Here

    final Paginal _pgi = _listbox.getPaginal();
    final boolean inPaging = inPagingMold();

    int newcnt = newsz - oldsz;
    int atg = _pgi != null ? _listbox.getActivePage(): 0;
    ListitemRenderer renderer = null;
    Component next = null;   
    if (oldsz > 0) {
      if (min < 0) min = 0;
      else if (min > oldsz - 1) min = oldsz - 1;
      if (max < 0) max = oldsz - 1;
View Full Code Here

TOP

Related Classes of org.zkoss.zul.ListitemRenderer

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.