Examples of TreeItemComponent


Examples of org.xulfaces.component.tree.TreeItemComponent

    String var = (String) component.getParent().getAttributes().get("var");
    Object userObject = treeNode.getUserObject();
    facesContext.getExternalContext().getSessionMap().put(var, userObject);
   
   
    TreeItemComponent treeItemComponent = (TreeItemComponent) component.getChildren().get(0);
    treeItemComponent.setPath(idPath);
   
    treeItemComponent.setCurrentTreeNode(treeNode);

    if (treeItemComponent.isRendered()) {

      treeItemComponent.encodeBegin(facesContext);
      treeItemComponent.encodeChildren(facesContext);     
      if (treeNode.getChildCount() > 0) {        
        responseWriter.startElement("treechildren",null);
        for (int i = 0; i < treeNode.getChildCount(); i++) {
          DefaultMutableTreeNode childNode = (DefaultMutableTreeNode) treeNode.getChildAt(i);
          StringBuffer pathBuffer = new StringBuffer(idPath);
          pathBuffer.append("_");
          pathBuffer.append(i);
          encodeTreeNode(facesContext, component, childNode, i,pathBuffer.toString());
        }
        responseWriter.endElement("treechildren");
      }
      treeItemComponent.encodeEnd(facesContext);
    }
  }
View Full Code Here

Examples of org.xulfaces.component.tree.TreeItemComponent

  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
   
    ResponseWriter responseWriter = facesContext.getResponseWriter();   
    responseWriter.startElement("treerow",component);
    TreeRowComponent treeRowComponent = (TreeRowComponent) component;
    TreeItemComponent treeItemComponent = (TreeItemComponent) treeRowComponent.getParent();
    StringBuffer stringBuffer = new StringBuffer(treeItemComponent.getNodeId());
    stringBuffer.append(":tr");
    treeRowComponent.setNodeId(stringBuffer.toString());
    responseWriter.writeAttribute("id",treeRowComponent.getNodeId(), "id");
    if(!isParentSmoothlyUpdateable(component)){
      if (component instanceof SmoothlyUpdateable) {
View Full Code Here

Examples of org.xulfaces.component.tree.TreeItemComponent

     
  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
   
    ResponseWriter responseWriter = facesContext.getResponseWriter();
        responseWriter.startElement("treeitem",component);
        TreeItemComponent treeItemComponent = (TreeItemComponent) component;
       
        DefaultMutableTreeNode treeNode =  treeItemComponent.getCurrentTreeNode();       
       
        String nodeId = computeId(facesContext,treeItemComponent);             
        treeItemComponent.setNodeId(nodeId);
                    
        if(!isParentSmoothlyUpdateable(component)){
          if (treeItemComponent instanceof SmoothlyUpdateable) {
          SmoothlyUpdateable smoothlyUpdateable = (SmoothlyUpdateable) treeItemComponent;
          if (smoothlyUpdateable.needsUpdate()) {
            Bridge bridge = XulUtils.getBridge();
            Zone zone = new Zone(nodeId);
            bridge.addCommand(new UpdateZoneCommand(zone,buildTargetName(component)));
          }
        } 
        }
   
       
        responseWriter.writeAttribute("id",nodeId, "id");
       
        if(treeNode.getChildCount() > 0){
          responseWriter.writeAttribute("container","true","container");       
        }
       
        renderAttributes(facesContext,component,(List) component.getAttributes().get("annotatedAttributes"));

        // Render open attribute
        Map paramMap = facesContext.getExternalContext().getRequestParameterMap();   
    if (paramMap.containsKey(nodeId)) {
      String value = (String) paramMap.get(nodeId);
      Boolean booleanValue = treeItemComponent.getOpen();
      if(booleanValue != null){
        if(booleanValue.toString(booleanValue.booleanValue()).equals(value)){
          renderAttribute(facesContext,component,"open");
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.