Examples of TreeRowKey


Examples of org.richfaces.model.TreeRowKey

public class TreeDemoStateAdvisor implements TreeStateAdvisor {

  public Boolean adviseNodeOpened(UITree tree) {
    //if (!PostbackPhaseListener.isPostback()) {
      Object key = tree.getRowKey();
      TreeRowKey treeRowKey = (TreeRowKey) key;
      if (treeRowKey == null || treeRowKey.depth() <= 2) {
        return Boolean.TRUE;
      }
    //}
   
    return null;
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

  }

  protected void doDecode(FacesContext context, UIComponent 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

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

public class TreeDemoStateAdvisor implements TreeStateAdvisor {

  public Boolean adviseNodeOpened(UITree tree) {
    if (!PostbackPhaseListener.isPostback()) {
      Object key = tree.getRowKey();
      TreeRowKey treeRowKey = (TreeRowKey) key;
      if (treeRowKey == null || treeRowKey.depth() <= 2) {
        return Boolean.TRUE;
      }
    }
   
    return null;
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

    public void dropListener(DropEvent dropEvent) {

  // 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;

  // 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;
  if (dropEvent.getDraggableSource() instanceof UIDragSupport && srcTree == null && draggedNode == null && dropEvent.getDragValue() instanceof TreeNode) {     
      srcTree = destTree;
      draggedNode = (TreeNode) dropEvent.getDragValue();
      dragNodeKey = srcTree.getTreeNodeRowKey(draggedNode) instanceof TreeRowKey ? (TreeRowKey) srcTree.getTreeNodeRowKey(draggedNode) : null;
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

    @SuppressWarnings("unchecked")
  public Boolean adviseNodeOpened(UITree tree) {
        if (!PostbackPhaseListener.isPostback()) {
            Object key = tree.getRowKey();
            TreeRowKey treeRowKey = (TreeRowKey) key;
            if (treeRowKey == null || treeRowKey.depth() <= 2) {
                return Boolean.TRUE;
            }
        }
       
        return null;
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

      tree.setPreserveModel("");
     
      TreeNode<String> newNode = new TreeNodeImpl<String>();
      newNode.setData("Sample node");     
      tree.addNode(facesContext, null, newNode, new Integer(111), null);
      TreeRowKey rowKey = (TreeRowKey)tree.getTreeNodeRowKey(newNode);
     
      TreeNode<String> newSubNode = new TreeNodeImpl<String>();
      newSubNode.setData("Sample sub node");
      tree.addNode(facesContext, rowKey, newSubNode, new Integer(1), null);
     
View Full Code Here

Examples of org.richfaces.model.TreeRowKey

  public void processDrop(DropEvent dropEvent) {
//    log.info("StorageBackingBean processDrop()");
      // 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;
       
        log.info("dropped key: " + dragNodeKey);
      
        //add to list of selected properties
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.