private Listcell autoFirstCell() { Listcell cell = (Listcell) getFirstChild(); if (cell == null) { cell = new Listcell(); cell.applyProperties(); cell.setParent(this); } return cell; }
yourListBox.setModel(new ListModelList<BeanClass>(beanDao.findAll())); yourListBox.setItemRenderer(new ListItemRenderer<BeanClass>) { @Override public void render(Listitem item, BeanClass data, int index) throws Exception { Listcell cell = new Listcell(); cell.appendChild(new Label(data.getFoo())); item.appendChild(cell); } });
/** Returns the label of the {@link Listcell} it contains, or null * if no such cell. */ public String getLabel() { final Listcell cell = (Listcell) getFirstChild(); return cell != null ? cell.getLabel() : null; }
private Listcell addCell(Listitem item, Object object) { Listcell cell = new Listcell(object.toString()); cell.setTooltiptext(object.toString()); item.appendChild(cell); return cell; }
public void render(Component comp, Writer out) throws IOException { final SmartWriter wh = new SmartWriter(out); final Listcell self = (Listcell)comp; final String uuid = self.getUuid(); wh.write("<td z.type=\"Lic\" id=\"").write(uuid).write("\"") .write(self.getOuterAttrs()).write(self.getInnerAttrs()) .write("><div id=\"").write(self.getUuid()).write("!cave\"") .write(self.getLabelAttrs()).write(" class=\"").write(self.getZclass()).write("-cnt"); if (self.getListbox().isFixedLayout()) wh.write(" z-overflow-hidden"); wh.write("\">"); wh.write(self.getColumnHtmlPrefix()).write(self.getImgTag()); new Out(self.getLabel()).setMaxlength(self.getMaxlength()).render(out); wh.writeChildren(self); wh.write(self.getColumnHtmlPostfix()).writeln("</div></td>"); }
private Listcell getCell(int col, int row) { Listitem item; while (row >= lstVitals.getItemCount()) { item = new Listitem(); item.setVisible(false); item.setParent(lstVitals); } item = lstVitals.getItemAtIndex(row); while (col >= item.getChildren().size()) { Listcell cell = new Listcell(""); cell.setParent(item); } return (Listcell) item.getChildren().get(col); }
j_domain.appendChild(li); IdentifierDt abbr = FhirUtil.getIdentifier(organization.getIdentifier(), "ABBREVIATION"); li.appendChild(new Listcell(abbr == null ? organization.getName().getValue() : abbr.getValue().getValue()));
private void renderNote(ProblemNote pn) { Listitem item = new Listitem(); lstNotes.appendChild(item); Listcell cell = addCell(item, ""); cell.setSclass("bgo-problem-icon-cell"); Toolbarbutton btn = new Toolbarbutton("", DELETE_ICON); btn.setTooltiptext("Delete this note."); btn.addForward(Events.ON_CLICK, lstNotes, "onDeleteNote"); cell.appendChild(btn); addCell(item, pn.getNumber()); // Note # addCell(item, pn.getNarrative()).setHflex("1"); // Narrative addCell(item, DateUtil.formatDate(pn.getDateAdded())); // Date added addCell(item, pn.getAuthor()); // Author item.setValue(pn); }
Listgroup group; Listcell cell = cells.get(index); if (cell.getLabel() != null) { group = new Listgroup(cell.getLabel()); } else { Component cc = cell.getFirstChild(); if (cc instanceof Label) { String val = ((Label) cc).getValue();
/** 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 maximal length for this cell. * If listbox's mold is "select", it is the same as * {@link Listbox#getMaxlength} * If not, it is the same as the correponding {@link #getListheader}'s * {@link Listheader#getMaxlength}. * * <p>Note: {@link Listitem#getMaxlength} is the same as {@link Listbox#getMaxlength}. */ public int getMaxlength() { final Listbox listbox = getListbox(); if (listbox == null) return 0; if (listbox.inSelectMold()) return listbox.getMaxlength(); final Listheader lc = getListheader(); return lc != null ? lc.getMaxlength() : 0; }
/** Returns the list box that it belongs to. */ public Listbox getListbox() { final Component comp = getParent(); return comp != null ? (Listbox) comp.getParent() : null; }
private Object getObject(int col, int row) { return getCell(col, row).getValue(); }
li.setValue(securityDomain); lstDomain.appendChild(li); li.appendChild(new Listcell(securityDomain.getName()));
/** Returns the column index of this cell, starting from 0. */ public int getColumnIndex() { int j = 0; for (Iterator it = getParent().getChildren().iterator(); it.hasNext(); ++j) if (it.next() == this) break; return j; }
private Listcell newUnloadedCell(ListitemRenderer renderer, Listitem item) { Listcell cell = null; if (renderer instanceof ListitemRendererExt) cell = ((ListitemRendererExt) renderer).newListcell(item); if (cell == null) { cell = new Listcell(); cell.applyProperties(); } cell.setParent(item); return cell; }