Package org.zkoss.zul

Examples of org.zkoss.zul.Listbox


            Statement stmt = con.createStatement();
            String operation;
            operation="SELECT time,who,comment,filename FROM `revisionhistory` WHERE stack_level=0 ORDER BY stack_level DESC,filename LIMIT 0 , 30";
           // p("...in MainWindow: "+operation);
            ResultSet rs = stmt.executeQuery(operation);
            Listbox listbox=null;
            if(target.equals("open"))
              listbox = (Listbox)Path.getComponent("//p2/mainWin/fileOpenViewWin/flo_files");
            if(target.equals("delete"))
              listbox = (Listbox)Path.getComponent("//p2/mainWin/fileDeleteWin/fld_files");
            if(target.equals("export"))
              listbox = (Listbox)Path.getComponent("//p2/mainWin/fileExportWin/fle_files");
     
      List childList = listbox.getChildren();
      //remain the list head component
      while(childList.size()>1)
        listbox.removeChild((Component)childList.get(1));
     
            while(rs.next()){
              //System.out.println("in rs.next");
              Listitem newListItem = new Listitem();
              Date date = rs.getDate("time");
              SimpleDateFormat sdf=new SimpleDateFormat("M/dd h");
              newListItem.appendChild(new Listcell(rs.getString("filename")));
              newListItem.appendChild(new Listcell(rs.getString("who")));
              newListItem.appendChild(new Listcell(String.valueOf(sdf.format(date))));
              listbox.appendChild(newListItem);
            }
            //close the jdbc connection
            stmt.close();
            con.close();
           
            listbox.setSelectedIndex(0);
        }
        catch (SQLException ex)
        {
            System.out.println("exception: "+ex.getMessage());
            System.out.println("SQLState: "+ex.getSQLState());
View Full Code Here


    }
  }

  @SuppressWarnings("unchecked")
  private void showUOMPopup(Event event) {
    Listbox uomList=(Listbox)getFellow("uomList");
    List children=uomList.getChildren();
    children.clear();
    InputEvent inputEvent=(InputEvent)event;
    String searchKey=inputEvent.getValue();

    List<UnitOfMeasure> uoms=uomManager.searchByName(searchKey, 0L, 32);
    Iterator<UnitOfMeasure> uomIterator=uoms.iterator();
    while(uomIterator.hasNext()){
      UnitOfMeasure uom=uomIterator.next();
      Listitem item=new Listitem();
      Listcell nameCell=new Listcell(uom.getName());
      Listcell descCell=new Listcell(uom.getDescription().getShortDescription());
      item.appendChild(nameCell);
      item.appendChild(descCell);
      uomList.appendChild(item);
    }
    uomText.open();
  }
View Full Code Here

            listItem.setValue(unitType);

            Listcell listCell = new Listcell(unitType.getMeasure());
            listItem.appendChild(listCell);

            Listbox listbox = listItem.getListbox();
            Component parent = listbox.getParent();

            if (parent instanceof Row) {
                Object assigment = (Object) ((Row) parent).getValue();
                if (getModel().isCurrentUnitType(assigment, unitType)) {
                    listItem.getListbox().setSelectedItem(listItem);
View Full Code Here

    }

    public void onChangingText(Event event) {
        Bandbox bd = (Bandbox) event.getTarget();
        final String inputText = ((InputEvent) event).getValue();
        Listbox listbox = (Listbox) bd.getFirstChild().getFirstChild();
        listbox.setModel(getSubModel(inputText));
        listbox.invalidate();
        bd.open();
    }
View Full Code Here

        bd.open();
    }

    public void onCtrlKey(Event event) {
        Bandbox bd = (Bandbox) event.getTarget();
        Listbox listbox = (Listbox) bd.getFirstChild().getFirstChild();
        List<Listitem> items = listbox.getItems();
        if (!items.isEmpty()) {
            listbox.setSelectedIndex(0);
            items.get(0).setFocus(true);
        }
    }
View Full Code Here

    public void selectCriterionToHoursGroup(Listitem item, Bandbox bandbox,
            CriterionRequirementWrapper requirementWrapper) {

        bandbox.close();
        Listbox listbox = (Listbox) bandbox.getFirstChild().getFirstChild();
        listbox.setModel(new SimpleListModel(getCriterionWithItsTypes()));

        if (item != null) {

            Row row = (Row) bandbox.getParent().getParent();
            CriterionWithItsType criterionAndType = (CriterionWithItsType) item
View Full Code Here

            });
            return intbox;
        }

        private Listbox listboxPriority(final LimitingAllocationRow resourceAllocation) {
            Listbox result = bindToPriority(buildPriorityList(resourceAllocation.getPriority()), resourceAllocation);
            result.setDisabled(resourceAllocation.hasDayAssignments());
            return result;
        }
View Full Code Here

            result.setDisabled(resourceAllocation.hasDayAssignments());
            return result;
        }

        private Listbox buildPriorityList(int selectedValue) {
            Listbox result = listbox();
            for (int i = 1; i <= 10; i++) {
                Listitem item = new Listitem();
                Listcell cell = new Listcell(i + "");
                cell.setParent(item);
                if (i == selectedValue) {
View Full Code Here

            }
            return result;
        }

        private Listbox listbox() {
            Listbox result = new Listbox();
            result.setMold("select");
            return result;
        }
View Full Code Here

    }

    public void onChangingText(Event event) {
        Bandbox bd = (Bandbox) event.getTarget();
        final String inputText = ((InputEvent) event).getValue();
        Listbox listbox = (Listbox) bd.getFirstChild().getFirstChild();
        listbox.setModel(getSubModel(inputText));
        listbox.invalidate();
        bd.open();
    }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Listbox

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.