public void onPaging$pgVitals() { int maxCols = sldVitals.getCurpos() + 1; int cols = hdrVitals.getChildren().size() - 1; int col1 = pgVitals.getActivePage() * maxCols; int col2 = col1 + maxCols; for (int col = 1; col < cols; col++) { ((Listheader) hdrVitals.getChildren().get(col)).setVisible(col > col1 && col <= col2); } }
private void fixDirection(Listbox listbox, boolean ascending) { _ignoreSort = true; //maintain for (Iterator it = listbox.getListhead().getChildren().iterator(); it.hasNext();) { final Listheader hd = (Listheader) it.next(); hd.setSortDirection(hd != this ? "natural" : ascending ? "ascending" : "descending"); } _ignoreSort = false; }
@SuppressWarnings("unchecked") private void sortGroupsModel(Listbox box, GroupsSortableModel model, Comparator cmpr, boolean ascending) { model.sort(cmpr, ascending, box.getListhead().getChildren().indexOf(this)); }
private static boolean doSort(Listbox listbox) { Listhead hds = listbox.getListhead(); if (!listbox.isAutosort() || hds == null) return false; for (Iterator<Component> it = hds.getChildren().iterator(); it.hasNext();) { final Listheader hd = (Listheader) it.next(); String dir = hd.getSortDirection(); if (!"natural".equals(dir)) { return hd.doSort("ascending".equals(dir)); } } return false; }
/** Returns the list header that is in the same column as * this cell, or null if not available. */ public Listheader getListheader() { final Listbox listbox = getListbox(); if (listbox != null) { final Listhead lcs = listbox.getListhead(); if (lcs != null) { final int j = getColumnIndex(); final List lcschs = lcs.getChildren(); if (j < lcschs.size()) return (Listheader) lcschs.get(j); } } return null; }
/** Returns the list header that is in the same column as * this footer, or null if not available. */ public Listheader getListheader() { final Listbox listbox = getListbox(); if (listbox != null) { final Listhead lcs = listbox.getListhead(); if (lcs != null) { final int j = getColumnIndex(); final List<Listheader> lcschs = lcs.getChildren(); if (j < lcschs.size()) return lcschs.get(j); } } return null; }
private void updatePaging() { int colcount = hdrVitals.getChildren().size() - 2; int maxcols = sldVitals.getCurpos() + 1; sldVitals.setTooltiptext(Integer.toString(maxcols)); pgVitals.setActivePage(0); pgVitals.setPageSize(Math.min(maxcols, colcount)); onPaging$pgVitals(); }
Listheader droppedOn = (Listheader) ev.getTarget(); int from = lHead.getChildren().indexOf(dragged); int to = lHead.getChildren().indexOf(droppedOn);
private void refreshList() { lbTests.setModel((ListModelList<?>) null); ListModelList<TestItem> model = new ListModelList<TestItem>(skinTestList); if (colSort == null) { colSort = (Listheader) lbTests.getListhead().getChildren().get(0); } lbTests.setModel(model); sortTests(); updateControls(); Events.echoEvent("onResize", lbTests, null); }
@Wire private Window menu; @Wire private Listbox box; private Listhead lHead; @Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); // get the Listboxhead in which we like to change the the col order lHead = (Listhead) menu.getParent().query("#lbox > #lHead"); // set the model for Listbox box in the pop up box.setModel(new ListModelList<>(lHead.getChildren())); } @Listen("onDrop = listitem") public void onDropInMenu(DropEvent ev) { // get the draged and dropped again Listitem dragged = (Listitem) ev.getDragged(); Listitem droppedOn = (Listitem) ev.getTarget(); // then get their indexes. int from = box.getItems().indexOf(dragged); int to = box.getItems().indexOf(droppedOn); // swap the positions lHead.insertBefore(lHead.getChildren().get(from), lHead.getChildren().get(to)); // swap related Listcell in all Listitem instances for (Listitem item : lHead.getListbox().getItems()) { item.insertBefore(item.getChildren().get(from), item.getChildren().get(to)); } // swap the items in pop up Lisbox as well box.insertBefore(dragged, droppedOn); }
((Listheader) lbResults.getListhead().getChildren().get(sortCol)).sort(true, true);
/** * @see org.carewebframework.ui.FrameworkController#doAfterCompose(org.zkoss.zk.ui.Component) */ @Override public void doAfterCompose(final Component comp) throws Exception { super.doAfterCompose(comp); bgoSecurity = BgoUtil.initSecurity("BGO DISABLE SK EDITING", null); lbTests.setItemRenderer(skinTestRenderer); RowComparator.autowireColumnComparators(lbTests.getListhead().getChildren()); getAppFramework().registerObject(patientContextEventHandler); getAppFramework().registerObject(encounterContextEventHandler); patientContextEventHandler.committed(); log.trace("Controller composed"); }
private void refreshList() { ProblemFilter filter = getFilter(); boolean bHasPriority = false; lbProblems.setModel((ListModelList<?>) null); ListModelList<Problem> model = new ListModelList<Problem>(); for (Problem problem : problemList) { if (filter.include(problem)) { model.add(problem); bHasPriority |= problem.getPriority().length() > 0; } } if (colSort == null) { colSort = (Listheader) lbProblems.getListhead().getChildren().get(bHasPriority ? 4 : 0); } lbProblems.setModel(model); sortProblems(); updateControls(); Events.echoEvent("onResize", lbProblems, null); }
/** * Initializes the controller. Loads user preferences and properties. */ @Override protected void initializeController() { setMeshElement(listBox, "list"); super.initializeController(); listBox.setItemRenderer(itemRenderer); setMultiple(listBox.isMultiple()); if (listBox.getListhead() != null) { RowComparator.autowireColumnComparators(listBox.getListhead().getChildren()); } }
for (Iterator it = box.getListhead().getChildren().iterator(); it.hasNext();) { final Listheader hd = (Listheader) it.next(); hd.setSortDirection(hd != this ? "natural" : ascending ? "ascending" : "descending");
/** * @see org.carewebframework.ui.FrameworkController#doAfterCompose(org.zkoss.zk.ui.Component) */ @Override public void doAfterCompose(final Component comp) throws Exception { super.doAfterCompose(comp); bgoSecurity = BgoUtil.initSecurity("BGO DISABLE PROB LIST EDITING", "BGOZ PROBLEM LIST EDIT"); lbProblems.setItemRenderer(problemRenderer); RowComparator.autowireColumnComparators(lbProblems.getListhead().getChildren()); m_bPersHistAndAct = SecurityUtil.isGranted("BGO PL INCLUDE PERS HIST W ACT"); for (Object item : cboFilter.getItems()) { Comboitem ci = (Comboitem) item; ProblemFilter filter = ProblemFilter.valueOf(ci.getValue().toString()); ci.setValue(m_bPersHistAndAct && filter == ProblemFilter.ACTIVE ? ProblemFilter.ACTIVE_PERSONAL : filter); } setFilter(getDefaultFilter()); getAppFramework().registerObject(patientContextEventHandler); getAppFramework().registerObject(encounterContextEventHandler); patientContextEventHandler.committed(); log.trace("Controller composed"); }
private void initGrid(int colcount, int rowcount) { lstVitals.getItems().clear(); hdrVitals.getChildren().clear(); if (colcount > 2 && rowcount > 0) { tbarPaging.setVisible(true); sldVitals.setMaxpos(colcount - 2); sldVitals.setCurpos(maxCols); pgVitals.setActivePage(0); pgVitals.setTotalSize(colcount - 2); pgVitals.setPageSize(maxCols + 1); getCell(colcount - 1, rowcount - 1); for (int i = 1; i <= colcount; i++) { Listheader lh = new Listheader(); lh.setVisible(i <= maxCols || i == colcount); lh.setAlign(i == 1 ? "right" : i == colcount ? "left" : "center"); lh.setHflex("1"); hdrVitals.appendChild(lh); } } else { hdrVitals.appendChild(new Listheader()); tbarPaging.setVisible(false); } }
/** * Set up display. */ @Override public void init() { super.init(); getContainer().registerProperties(this, "showAll", "alertDuration", "alertThreshold"); rgFilter.setSelectedItem(showAll ? radAll : radPatient); processingController = ProcessingController.create(this); lstNotification.setItemRenderer(renderer); RowComparator.autowireColumnComparators(lstNotification.getListhead().getChildren()); model.setMultiple(true); updatePatient(true); subscribe(true); }
boolean useAge = chkAge.isVisible() && chkAge.isChecked(); chart.clear(); int colcount = hdrVitals.getChildren().size() - 1; Listheader hdr = (Listheader) hdrVitals.getChildren().get(col); FMDate date = (FMDate) hdr.getValue();
List<Listheader> headers = cast(_listhead.getChildren()); boolean found = false; for (Listheader col : headers) {