Examples of UITreeNode


Examples of org.apache.myfaces.tobago.component.UITreeNode

    return null;
  }

  @Override
  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
    UITreeNode node = (UITreeNode) component;
    boolean folder = node.isFolder();
    if (folder) {
      TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
      writer.endElement(HtmlElements.SELECT);
      ResponseWriterDivider divider = ResponseWriterDivider.getInstance(facesContext, TreeListboxRenderer.DIVIDER);
      divider.passivateBranch(facesContext);
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UITreeNode

  @Override
  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {

    final UITreeIndent indent = (UITreeIndent) component;
    final UITreeNode node = ComponentUtils.findAncestor(indent, UITreeNode.class);
    final AbstractUITree tree = ComponentUtils.findAncestor(indent, AbstractUITree.class);

    final boolean folder = node.isFolder();
    final int level = node.getLevel();
    final boolean hasNextSibling = node.isHasNextSibling();
    final List<Boolean> junctions = node.getJunctions();

    final boolean showRoot = ((UITree) tree).isShowRoot();
    final boolean showJunctions = indent.isShowJunctions();
    final boolean showRootJunction = ((UITree) tree).isShowRootJunction();
    final boolean expanded = folder && node.isExpanded() || !showRoot && level == 0;

    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    encodeIndent(facesContext, writer, node, showJunctions, !showRoot || !showRootJunction && showJunctions, junctions);
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UITreeNode

  private static final Logger LOG = LoggerFactory.getLogger(TreeCommandRenderer.class);

  @Override
  public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
    final UITreeCommand command = (UITreeCommand) component;
    final UITreeNode node = ComponentUtils.findAncestor(command, UITreeNode.class);
    if (node.isDisabled()) {
      command.setDisabled(true);
    }

    super.prepareRender(facesContext, component);
  }
View Full Code Here

Examples of org.richfaces.component.UITreeNode

    } else {
      script.append("fireExpansionEvent();");
    }
   
    if (UITree.SWITCH_AJAX.equals(tree.getSwitchType())) {
      UITreeNode nodeFacet = tree.getNodeFacet();
      JSFunction function = AjaxRendererUtils.buildAjaxFunction(nodeFacet,
          context);
      Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(context,
          nodeFacet);
      Map<Object, Object> parameters = (Map<Object, Object>) eventOptions.get("parameters");
View Full Code Here

Examples of org.richfaces.component.UITreeNode

  public String getExpandedValue(FacesContext context, UITreeNode node) {
    return Boolean.toString(node.getUITree().isExpanded());
  }

  protected void doDecode(FacesContext context, UIComponent component) {
    UITreeNode node = (UITreeNode) component;
    UITree tree = node.getUITree();
    TreeRowKey<?> key = (TreeRowKey<?>) tree.getRowKey();
    Map<String, String> requestMap = context.getExternalContext().getRequestParameterMap();
    String id = node.getClientId(context);
    TreeState componentState = (TreeState) tree.getComponentState();

    String nodeExpandedId = id + NODE_EXPANDED_INPUT_SUFFIX;
    Object nodeExpandedValue = requestMap.get(nodeExpandedId);
    if (nodeExpandedValue != null) {
View Full Code Here

Examples of org.richfaces.component.UITreeNode

        c.setHasChildren(false);
        navigator.openDiv(c);
        navigator.closeDiv();
      }

      UITreeNode nodeFacet = tree.getNodeFacet();
      Object oldAttrValue = nodeFacet.getAttributes().get("isLastElement");
      Object oldAjaxRootAttrValue = nodeFacet.getAttributes().get("isAjaxUpdateRoot");
      try {
        nodeFacet.getAttributes().put("isLastElement", new Boolean(isLastElement));
        nodeFacet.getAttributes().put("isAjaxUpdateRoot", new Boolean(floatingKey != null && floatingKey.equals(rowKey)));
        ResponseWriter writer = context.getResponseWriter();
        if (isLastElement && this.navigator.showLines) {
          writer.startElement("p", tree);
          writer.writeAttribute("class", "dr-tree-last-node-marker", null);
          writer.endElement("p");
        }

        renderChild(context, nodeFacet);


        c = new Context();
        c.setClientId(nodeFacet.getClientId(context) + NamingContainer.SEPARATOR_CHAR);
        c.setLast(this.isLastElement);
        c.setExpanded(tree.isExpanded());
        c.setRowKey(tree.getRowKey());
        flag.setContext(c);

        //writer.write("** after renderChild **");
        //navigator.openDiv();
      } finally {
        if (oldAttrValue != null) {
          nodeFacet.getAttributes().put("isLastElement", oldAttrValue);
        } else {
          nodeFacet.getAttributes().remove("isLastElement");
        }

        if (oldAjaxRootAttrValue != null) {
          nodeFacet.getAttributes().put("isAjaxUpdateRoot", oldAjaxRootAttrValue);
        } else {
          nodeFacet.getAttributes().remove("isAjaxUpdateRoot");
        }
      }
    }
View Full Code Here

Examples of org.richfaces.component.UITreeNode

          if (currentKey == null ? rowKey != null : !currentKey.equals(rowKey)) {
            //currentKey NE rowKey
            input.setRowKey(context, rowKey);
          }

          UITreeNode nodeFacet = input.getNodeFacet();
          if (!nodeFacet.isRendered()) {
            return false;
          }

          return stateRange.processNode(rowKey);
        }
View Full Code Here

Examples of org.richfaces.component.UITreeNode

          if (currentKey == null ? rowKey != null : !currentKey.equals(rowKey)) {
            //currentKey NE rowKey
            input.setRowKey(context, rowKey);
          }

          UITreeNode nodeFacet = input.getNodeFacet();
          if (!nodeFacet.isRendered()) {
            return false;
          }

          return stateRange.processNode(rowKey);
        }
View Full Code Here

Examples of org.richfaces.component.UITreeNode

        c.setHasChildren(false);
        navigator.openDiv(c);
        navigator.closeDiv();
      }

      UITreeNode nodeFacet = tree.getNodeFacet();
      Object oldAttrValue = nodeFacet.getAttributes().get("isLastElement");
      Object oldAjaxRootAttrValue = nodeFacet.getAttributes().get("isAjaxUpdateRoot");
      try {
        nodeFacet.getAttributes().put("isLastElement", new Boolean(isLastElement));
        nodeFacet.getAttributes().put("isAjaxUpdateRoot", new Boolean(floatingKey != null && floatingKey.equals(rowKey)));
        ResponseWriter writer = context.getResponseWriter();
        if (isLastElement && this.navigator.showLines) {
          writer.startElement("p", tree);
          writer.writeAttribute("class", "dr-tree-last-node-marker", null);
          writer.endElement("p");
        }

        renderChild(context, nodeFacet);


        c = new Context();
        c.setClientId(nodeFacet.getClientId(context) + NamingContainer.SEPARATOR_CHAR);
        c.setLast(this.isLastElement);
        c.setExpanded(tree.isExpanded());
        c.setRowKey(tree.getRowKey());
        flag.setContext(c);

        //writer.write("** after renderChild **");
        //navigator.openDiv();
      } finally {
        if (oldAttrValue != null) {
          nodeFacet.getAttributes().put("isLastElement", oldAttrValue);
        } else {
          nodeFacet.getAttributes().remove("isLastElement");
        }

        if (oldAjaxRootAttrValue != null) {
          nodeFacet.getAttributes().put("isAjaxUpdateRoot", oldAjaxRootAttrValue);
        } else {
          nodeFacet.getAttributes().remove("isAjaxUpdateRoot");
        }
      }
    }
View Full Code Here

Examples of org.richfaces.component.UITreeNode

    } else {
      script.append("fireExpansionEvent(this);");
    }
   
    if (UITree.SWITCH_AJAX.equals(tree.getSwitchType())) {
      UITreeNode nodeFacet = tree.getNodeFacet();
      JSFunction function = AjaxRendererUtils.buildAjaxFunction(nodeFacet,
          context);
      Map eventOptions = AjaxRendererUtils.buildEventOptions(context,
          nodeFacet);
      Map parameters = (Map) eventOptions.get("parameters");
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.