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); } }
public void render(Component comp, Writer out) throws IOException { final SmartWriter wh = new SmartWriter(out); final Listhead self = (Listhead)comp; wh.write("<tr id=\"").write(self.getUuid()).write("\" z.type=\"Lhrs\"") .write(self.getOuterAttrs()).write(self.getInnerAttrs()) .write(" align=\"left\">") .writeChildren(self) .writeln("</tr>"); }
@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 droppedOn = (Listheader) ev.getTarget(); int from = lHead.getChildren().indexOf(dragged); int to = lHead.getChildren().indexOf(droppedOn); lHead.insertBefore(dragged, droppedOn);
if(self.getListhead() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .write("<tr id=\"").write(self.getListhead().getUuid()).write("!hdfaker\" class=\"").write(zcls).write("-faker\">"); for (Iterator it = self.getListhead().getChildren().iterator(); it.hasNext();) { final Listheader child = (Listheader) it.next(); wh.write("<th id=\"").write(child.getUuid()).write("!hdfaker\"").write(child.getOuterAttrs()) .write("<tr id=\"").write(self.getListhead().getUuid()).write("!bdfaker\" class=\"").write(zcls).write("-faker\">"); for (Iterator it = self.getListhead().getChildren().iterator(); it.hasNext();) { final Listheader child = (Listheader) it.next(); wh.write("<th id=\"").write(child.getUuid()).write("!bdfaker\"").write(child.getOuterAttrs()) if(self.getListhead() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .write("<tr id=\"").write(self.getListhead().getUuid()).write("!ftfaker\" class=\"").write(zcls).write("-faker\">"); for (Iterator it = self.getListhead().getChildren().iterator(); it.hasNext();) { final Listheader child = (Listheader) it.next(); wh.write("<th id=\"").write(child.getUuid()).write("!ftfaker\"").write(child.getOuterAttrs())
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); } }
private void initHeaders() { Listhead lh = lbResults.getListhead(); if (lh == null) { lh = new Listhead(); lbResults.appendChild(lh); } Listheader lhr = null; for (ColumnControl ctrl : lookupParams.getColControl()) { lhr = new Listheader(ctrl.getLabel()); lhr.setParent(lh); lhr.setVisible(ctrl.isVisible()); lhr.setWidth(ctrl.getWidth() + "px"); lhr.setSort("auto"); } if (lhr != null) { lhr.setHflex("1"); } }
if(self.getListhead() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .write("<tr id=\"").write(self.getListhead().getUuid()).write("!hdfaker\" class=\"").write(zcls).write("-faker\">"); for (Iterator it = self.getListhead().getChildren().iterator(); it.hasNext();) { final Listheader child = (Listheader) it.next(); wh.write("<th id=\"").write(child.getUuid()).write("!hdfaker\"").write(child.getOuterAttrs()) .write("<tr id=\"").write(self.getListhead().getUuid()).write("!bdfaker\" class=\"").write(zcls).write("-faker\">"); for (Iterator it = self.getListhead().getChildren().iterator(); it.hasNext();) { final Listheader child = (Listheader) it.next(); wh.write("<th id=\"").write(child.getUuid()).write("!bdfaker\"").write(child.getOuterAttrs()) if(self.getListhead() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .write("<tr id=\"").write(self.getListhead().getUuid()).write("!ftfaker\" class=\"").write(zcls).write("-faker\">"); for (Iterator it = self.getListhead().getChildren().iterator(); it.hasNext();) { final Listheader child = (Listheader) it.next(); wh.write("<th id=\"").write(child.getUuid()).write("!ftfaker\"").write(child.getOuterAttrs())
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(); }
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); }
((Listheader) lbResults.getListhead().getChildren().get(sortCol)).sort(true, true);
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); }
/** * @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"); }
/** * 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");