Package org.xulfaces.component.tree

Examples of org.xulfaces.component.tree.TreeChildrenComponent


public class TreeChildrenRenderer extends XULRenderer {

  public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException {

    TreeComponent treeComponent = (TreeComponent) component.getParent();   
    TreeChildrenComponent treeChildrenComponent = (TreeChildrenComponent) component;
    ResponseWriter responseWriter = facesContext.getResponseWriter();   
    TreeModel treeModel = treeComponent.getTreeModel();
    DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) treeModel.getRoot();
    if (treeNode != null) {
      String var = (String) component.getParent().getAttributes().get("var");
      if (var != null) {
        Map sessionMap = facesContext.getExternalContext().getSessionMap();
        synchronized (sessionMap) {
          responseWriter.startElement("treechildren",component);
          treeChildrenComponent.setNodeId(component.getClientId(facesContext));
          responseWriter.writeAttribute("id",treeChildrenComponent.getNodeId(), "id");
          renderAttributes(facesContext,component,(List) component.getAttributes().get("annotatedAttributes"));
          for (int i = 0; i < treeNode.getChildCount(); i++) {
            encodeTreeNode(facesContext, component, (DefaultMutableTreeNode) treeNode.getChildAt(i), i,"" + i );
          }
          responseWriter.endElement("treechildren");
View Full Code Here

TOP

Related Classes of org.xulfaces.component.tree.TreeChildrenComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.