Package org.richfaces.model

Examples of org.richfaces.model.TreeRowKey


  }

  private TreeDataModel treeDataModel;

  public boolean isLeaf() {
    TreeRowKey rowKey = (TreeRowKey) getRowKey();
    TreeNode treeNode = locateTreeNode(rowKey);
    if (treeNode != null && !treeNode.isLeaf()) {
      return false;
    }
     
View Full Code Here


      this.visitor = visitor;
    }

    public void process(FacesContext context, Object rowKey, Object argument)
        throws IOException {
      TreeRowKey treeRowKey = (TreeRowKey) rowKey;
      treeDataModel.setRowKey(treeRowKey);
      locateTreeNode(treeRowKey, true).setData(treeDataModel.getRowData());

      if (visitor != null) {
        visitor.process(context, rowKey, argument);
View Full Code Here

          if (ajaxKeys != null) {
            List sortedKeys = new ArrayList(ajaxKeys.size());
            sortedKeys.addAll(ajaxKeys);
            Collections.sort(sortedKeys, treeRowKeyComparator);
            Iterator ajaxKeysItr = sortedKeys.iterator();
            TreeRowKey lastKey = null;
            boolean nullRoot = false;

            while (!nullRoot && ajaxKeysItr.hasNext()) {
              TreeRowKey key = (TreeRowKey) ajaxKeysItr.next();

              if (lastKey == null) {
                lastKey = key;
              } else {
                if (!lastKey.isSubKey(key)) {
                  lastKey = key;
                } else {
                  //skip nodes that's parent nodes have been rendered
                  continue;
                }
              }

              if (key == null || key.depth() == 0) {
                nullRoot = true;
                key = null;
              }

              tree.setRowKey(context, key);
View Full Code Here

  }

  public String encodeSelectionStateInput(FacesContext context, UITree tree) throws IOException {
    String result = "";
    TreeState treeState = (TreeState) tree.getComponentState();
    TreeRowKey selectedNodeKey = treeState.getSelectedNode();
    if (selectedNodeKey != null) {
      Object rowKey = tree.getRowKey();
      try {
        tree.setRowKey(selectedNodeKey);
        result = tree.getNodeFacet().getClientId(context);
View Full Code Here

    // simple flag can be used here because
    // we cannot jump more than one level down until next node
    // when rendering
    Flag droppedDownToLevelFlag = new Flag();

    TreeRowKey rowKey = (TreeRowKey) key;

    //Object savedRowKey = input.getRowKey();
    try {
      input.captureOrigValue();
View Full Code Here

      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

    public void process(FacesContext context, Object rowKey, Object argument)
    throws IOException {
      tree.setRowKey(context, rowKey);
      if (tree.isRowAvailable()) {
        TreeRowKey nextKey = (TreeRowKey) rowKey;

        if (!tree.isLeaf() && nextKey != null) {
          if (key == null || nextKey.isSubKey(key)
              || nextKey.equals(key)) {
            if (tree.isImmediate()) {
              queuedExpandedNodes.add(nextKey);
            } else {
              expandedNodes.add(nextKey);
            }
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;
View Full Code Here

   
    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

 
  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

TOP

Related Classes of org.richfaces.model.TreeRowKey

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.