/** Returns the maximal length for this cell, which is decided by * the corresponding {@link #getTreecol}'s {@link Treecol#getMaxlength}. */ public int getMaxlength() { final Tree tree = getTree(); if (tree == null) return 0; final Treecol lc = getTreecol(); return lc != null ? lc.getMaxlength() : 0; }
/** Returns the tree column associated with this cell, or null if not available. */ public Treecol getTreecol() { final Tree tree = getTree(); if (tree != null) { final Treecols lcs = tree.getTreecols(); if (lcs != null) { final int j = getColumnIndex(); final List lcschs = lcs.getChildren(); if (j < lcschs.size()) return (Treecol) lcschs.get(j); } } return null; }
public void render(Component comp, Writer out) throws IOException { final SmartWriter wh = new SmartWriter(out); final Treecell self = (Treecell) comp; wh.write("<td z.type=\"Lic\" id=\"").write(self.getUuid()).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.getTree().isFixedLayout()) wh.write(" z-overflow-hidden"); wh.write("\">").write(self.getColumnHtmlPrefix()).write(self.getImgTag()); new Out(self.getLabel()).setMaxlength(self.getMaxlength()).render(out); wh.writeChildren(self) .write(self.getColumnHtmlPostfix()) .writeln("</div></td>"); } }