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; }
/** * 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()); } }
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);
/** * @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); }
for (Iterator it = box.getListhead().getChildren().iterator(); it.hasNext();) { final Listheader hd = (Listheader) it.next(); hd.setSortDirection(hd != this ? "natural" : ascending ? "ascending" : "descending");
try { final ListModel model = listbox.getModel(); int index = listbox.getListhead().getChildren().indexOf(this); if (model != null) { //live data if (!(model instanceof GroupsSortableModel))
/** * @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"); }
/** * 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); }
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"); } }
wh.write("<div id=\"").write(uuid).write("\" z.type=\"zul.sel.Libox\"") .write(self.getOuterAttrs()).write(self.getInnerAttrs()).write(">"); if(self.getListhead() != null){ wh.write("<div id=\"").write(uuid).write("!head\" class=\"").write(zcls).write("-header\">") .write("<table width=\"").write(self.getInnerWidth()).write("\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed\">"); 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()) if(self.getListhead() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .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()) wh.write("<div id=\"").write(uuid).write("!foot\" class=\"").write(zcls).write("-footer\">") .write("<table width=\"").write(self.getInnerWidth()).write("\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed\">"); 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();
if(self.getListhead() != null){ wh.write("<div id=\"").write(uuid).write("!head\" class=\"").write(zcls).write("-header\">") .write("<table width=\"").write(self.getInnerWidth()).write("\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed\">"); 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()) if(self.getListhead() != null) { wh.write("<tbody style=\"visibility:hidden;height:0px\">") .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()) wh.write("<div id=\"").write(uuid).write("!foot\" class=\"").write(zcls).write("-footer\">") .write("<table width=\"").write(self.getInnerWidth()).write("\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed\">"); 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())