Package org.richfaces.component

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


          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

        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) {
          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

  }

  protected void doDecode(FacesContext context, UIComponent component) {
    super.doDecode(context, component);

    UITreeNode node = (UITreeNode) component;
    UITree tree = node.getUITree();
    TreeRowKey key = (TreeRowKey) tree.getRowKey();
    Map 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

    boolean showLines = tree.isShowConnectingLines();
    String id = treeNode.getClientId(context);

    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

  }

  protected void doDecode(FacesContext context, UIComponent component) {
    super.doDecode(context, component);

    UITreeNode node = (UITreeNode) component;
    UITree tree = node.getUITree();
    TreeRowKey key = (TreeRowKey) tree.getRowKey();
    Map 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

          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

        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

      return index;
    }
 
  public void dropListener(DropEvent dropEvent) {
    // resolve drag source attributes
    UITreeNode srcNode = (dropEvent.getDraggableSource() instanceof UITreeNode) ? (UITreeNode) dropEvent.getDraggableSource() : null;
    UITree srcTree = srcNode != null ? srcNode.getUITree() : null;
    TreeRowKey dragNodeKey = (dropEvent.getDragValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent.getDragValue() : null;
    TreeNode draggedNode = dragNodeKey != null ? srcTree.getTreeNode(dragNodeKey) : null;

    // resolve drag destination attributes
    UITreeNode destNode = (dropEvent.getSource() instanceof UITreeNode) ? (UITreeNode) dropEvent.getSource() : null;
    UITree destTree = destNode != null ? destNode.getUITree() : null;
    TreeRowKey dropNodeKey = (dropEvent.getDropValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent.getDropValue() : null;
    TreeNode droppedInNode = dropNodeKey != null ? destTree.getTreeNode(dropNodeKey) : null;
   
    // Note: check if we dropped node on to itself or to item instead of folder here
    if (droppedInNode != null && (droppedInNode.equals(draggedNode) || droppedInNode.getParent().getParent() != null || draggedNode.getParent().getParent() == null)) {
View Full Code Here

          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

TOP

Related Classes of org.richfaces.component.UITreeNode

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.