private Treecell autoFirstCell() { Treecell cell = (Treecell) getFirstChild(); if (cell == null) { cell = new Treecell(); cell.applyProperties(); cell.setParent(this); } return cell; }
/** Returns the label of the {@link Treecell} it contains, or null * if no such cell. * @since 5.0.8 */ public String getLabel() { final Treecell cell = (Treecell) getFirstChild(); return cell != null ? cell.getLabel() : null; }
/** 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>"); } }
private void renderChildren(Renderer renderer, Treechildren parent, Object node) throws Throwable { final int initSize = initRodSize(); for (int i = 0, j = _model.getChildCount(node); i < j; i++) { Treeitem ti = newUnloadedItem(); ti.setParent(parent); Object childNode = _model.getChild(node, i); // Bug ZK-1696: must render all opened node to have correct page count TreeOpenableModel model = (TreeOpenableModel) _model; // render nodes when no ROD or within ROD range or opened node if (initSize < 0 || i < initSize || model.isPathOpened(_model.getPath(childNode))) { renderChildren0(renderer, parent, ti, childNode, i); } else { //render empty row ti.appendChild(new Treerow()); ti.getTreerow().appendChild(new Treecell()); } } }
/** Returns the image of the {@link Treecell} it contains, or null * if no such cell. * @since 5.0.8 */ public String getImage() { final Treecell cell = (Treecell) getFirstChild(); return cell != null ? cell.getImage() : null; }