Examples of TreeRowKey


Examples of org.richfaces.model.TreeRowKey

   
    tree.setRowKey(rowKey);
   
    if (tree.isRowAvailable()) {
      if (!tree.isLeaf()) {
        TreeRowKey key = rowKey;
       
        while (key != null && key.depth() != 0) {
          addQueuedState(key, NodeState.EXPANDED);
          key = (TreeRowKey) tree.getParentRowKey(key);
        };
       
      } else {
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

 
  public void transferQueuedNodes(TreeRowKey rootKey) {
    Iterator<Entry<TreeRowKey, NodeState>> itr = queuedNodeStates.entrySet().iterator();
    while (itr.hasNext()) {
      Entry<TreeRowKey, NodeState> entry = itr.next();
      TreeRowKey rowKey = entry.getKey();
     
      if (rootKey == null || rootKey.depth() == 0 || rootKey.isSubKey(rowKey)) {
        transferState(rowKey, entry.getValue());
     
        itr.remove();
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

    subTreeState._transient = _transient;
   
    int subKeyDepth = rowKey.depth() - 1;

    for (Iterator<TreeRowKey> iter = this.expandedNodes.iterator(); iter.hasNext(); ) {
      TreeRowKey nextKey = iter.next();
      if (nextKey != null && rowKey.isSubKey(nextKey)) {
        subTreeState.expandedNodes.add(nextKey.getSubKey(subKeyDepth));
      }
    }
   
    for (Iterator<Entry<TreeRowKey, NodeState>> iter = this.queuedNodeStates.entrySet().iterator();
      iter.hasNext(); ) {
   
      Entry<TreeRowKey, NodeState> entry = iter.next();

      TreeRowKey nextKey = entry.getKey();
     
      if (nextKey != null && rowKey.isSubKey(nextKey)) {
        subTreeState.queuedNodeStates.put(nextKey.getSubKey(subKeyDepth),
          entry.getValue());
      }
    }
   
    return subTreeState;
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

      this.expandedNodes.clear();
      this.queuedNodeStates = new HashMap<TreeRowKey, NodeState>();
    } else {
      // collect nodes to clean up
      for (Iterator<TreeRowKey> itr = this.expandedNodes.iterator(); itr.hasNext(); ) {
        TreeRowKey nextKey = itr.next();
        if (nextKey != null && rowKey.isSubKey(nextKey)) {
          itr.remove();
        }
      }
     
      for (Iterator<Entry<TreeRowKey, NodeState>> itr =
        this.queuedNodeStates.entrySet().iterator(); itr.hasNext(); ) {

        TreeRowKey nextKey = itr.next().getKey();
        if (nextKey != null && rowKey.isSubKey(nextKey)) {
          itr.remove();
        }
      }
    }
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

  }
 
  public void mergeSubState(TreeRowKey rowKey, TreeState subState) {
    Iterator<TreeRowKey> iter = subState.expandedNodes.iterator();
    while (iter != null && iter.hasNext()) {
      TreeRowKey key = iter.next().getSubKey(1);
      if (key.depth() > 0) {
          expandedNodes.add(new ListRowKey((ListRowKey)rowKey, (ListRowKey)key));
      } else if (!expandedNodes.contains(rowKey)) {
          expandedNodes.add(rowKey);
      }
    }

    Iterator<Entry<TreeRowKey, NodeState>> sItr = subState.queuedNodeStates.entrySet().iterator();
    while (sItr.hasNext()) {
      Entry<TreeRowKey, NodeState> entry = sItr.next();
      TreeRowKey key = entry.getKey().getSubKey(1);
     
      TreeRowKey newKey;
     
      if (key.depth() > 0) {
        newKey = new ListRowKey((ListRowKey)rowKey, (ListRowKey)key);
      } else {
        newKey = rowKey;
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

   * @param transferQueuedNodes whether to collect queued expanded nodes states or not
   * @return tree node state
   */
  public Object getTreeNodeState() {
    // Check for node were choosed
    TreeRowKey rowKey = (TreeRowKey) getRowKey();
    if (rowKey == null) {
      return null;
    }
    TreeState state = (TreeState) getComponentState();
    return state.getSubState(rowKey);
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

   *
   * @param state node state to apply.
   */
  public void setTreeNodeState(Object state) {
    // Check for node were choosed
        TreeRowKey rowKey = (TreeRowKey) getRowKey();
    if (rowKey == null) {
      return;
    }
   
    if (state instanceof TreeState) {
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

 
  /**
   * Cleanup current tree node state information.
   */
  public void clearTreeNodeState() {
    TreeRowKey rowKey = (TreeRowKey) getRowKey();
    if (rowKey == null) {
      return;
    }
   
    TreeState state = (TreeState) getComponentState();
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

      if (!context.isExpanded() || !context.isHasChildren()) {
        getUtils().writeAttribute(writer, "style", "display: none;");
      } else {
        if (tree.isShowConnectingLines()) {
          TreeRowKey floatingKey = getFloatingKey();
          //need the expression only for AJAX update root
          if (floatingKey != null && floatingKey.equals(context.getRowKey())) {
            String expression = "background-image:expression(this.nextSibling ? '' : 'none')";
            getUtils().writeAttribute(writer, "style", expression);
          }
        }
      }
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

          }

          Iterator<RowKeyHolder> ajaxKeysItr = holders.iterator();
          while (ajaxKeysItr.hasNext()) {
            RowKeyHolder keyHolder = ajaxKeysItr.next();
            TreeRowKey key = keyHolder.getRowKey();

            if (key != null && key.depth() == 0) {
              key = null;
            }

            tree.setRowKey(context, key);
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.