/** 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; }
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>"); }