Examples of TreeState


Examples of org.richfaces.component.state.TreeState

    return getFacets().values().iterator();
  }


  protected DataComponentState createComponentState() {
    return new TreeState(isStopInCollapsed());
  }
View Full Code Here

Examples of org.richfaces.component.state.TreeState

    // 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.component.state.TreeState

    if (rowKey == null) {
      return;
    }
   
    if (state instanceof TreeState) {
          TreeState currentState = (TreeState) getComponentState();
          currentState.mergeSubState(rowKey, (TreeState) state);
    }
  }
View Full Code Here

Examples of org.richfaces.component.state.TreeState

    TreeRowKey rowKey = (TreeRowKey) getRowKey();
    if (rowKey == null) {
      return;
    }
   
    TreeState state = (TreeState) getComponentState();
    state.clearSubState(rowKey);
  }
View Full Code Here

Examples of org.richfaces.component.state.TreeState

  public Object getParentRowKey(Object rowKey) {
    return ((AbstractTreeDataModel) getExtendedDataModel()).getParentRowKey(rowKey);
  }

  public void transferQueuedNode() {
    TreeState treeState = (TreeState) getComponentState();
    treeState.transferQueuedNodes((TreeRowKey) getRowKey());
  }
View Full Code Here

Examples of org.richfaces.component.state.TreeState

      isLastElement = false;
      navigator.resetLastElement();
    }

    public void processAdvisors(FacesContext context, TreeRowKey rowKey) throws IOException {
      TreeState state = (TreeState) tree.getComponentState();
      TreeStateAdvisor stateAdvisor = (TreeStateAdvisor)tree.getStateAdvisor();

      if (null == stateAdvisor) {
        if (null == methodBindingAdvisor) {
          methodBindingAdvisor = new TreeStateAdvisor() {
            public Boolean adviseNodeOpened(UITree tree) {
              MethodBinding adviseNodeOpened = tree.getAdviseNodeOpened();
              if (null != adviseNodeOpened) {
                return (Boolean) adviseNodeOpened.invoke(FacesContext.getCurrentInstance(), new Object[] {tree});
              }
              return null;
            }

            public Boolean adviseNodeSelected(UITree tree) {
              MethodBinding adviseNodeSelected = tree.getAdviseNodeSelected();
              if (null != adviseNodeSelected) {
                return (Boolean) adviseNodeSelected.invoke(FacesContext.getCurrentInstance(), new Object [] {tree});
              }
              return null;
            }
          };
        }
        stateAdvisor = methodBindingAdvisor;
      }

      Boolean adviseOpened = stateAdvisor.adviseNodeOpened(tree);
      if (null != adviseOpened) {
        if (adviseOpened.booleanValue()) {
          state.makeExpanded(rowKey);
        } else {
          state.makeCollapsed(rowKey);
        }
      }
     
      Boolean adviseSelected = stateAdvisor.adviseNodeSelected(tree);
      if (null != adviseSelected) {
        if (adviseSelected.booleanValue()) {
          if (!state.isSelected(rowKey)) {
            state.setSelected(rowKey);
          }
        }
        else {
          if (state.isSelected(rowKey)) {
            state.setSelected(null);
          }
        }
      }
    }
View Full Code Here

Examples of org.richfaces.component.state.TreeState

    }
  }

  protected String getSelectionValue(FacesContext context, UITree tree) {
    String result = "";
    TreeState treeState = (TreeState) tree.getComponentState();
    TreeRowKey selectedNodeKey = treeState.getSelectedNode();
    if (selectedNodeKey != null) {
      Object rowKey = tree.getRowKey();
      try {
        tree.setRowKey(selectedNodeKey);
        if (tree.isRowAvailable()) {
View Full Code Here

Examples of org.richfaces.component.state.TreeState

   * Returns whether current node is expanded
   *
   * @return <code>true</code> if node is expanded else <code>false</code>
   */
  public boolean isExpanded() {
    TreeState treeState = (TreeState) getComponentState();
    return treeState.isExpanded((TreeRowKey) this.getRowKey());
  }
View Full Code Here

Examples of org.richfaces.component.state.TreeState

   * Returns whether current node is selected
   *
   * @return <code>true</code> if node is selected else <code>false</code>
   */
  public boolean isSelected() {
    TreeState treeState = (TreeState) getComponentState();
    return treeState.isSelected((TreeRowKey) this.getRowKey());
  }
View Full Code Here

Examples of org.richfaces.component.state.TreeState

  /**
   * Sets current node as selected
   */
  public void setSelected() {
    TreeState treeState = (TreeState) getComponentState();
    treeState.setSelected((TreeRowKey) this.getRowKey());
  }
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.