Package org.apache.myfaces.trinidad.model

Examples of org.apache.myfaces.trinidad.model.RowKeySet


  @Override
public CollectionModel createCollectionModel(CollectionModel current, Object value)
  {
    TreeModel model = (TreeModel)super.createCollectionModel(current, value);
    RowKeySet treeState = getDisclosedRowKeys();
    treeState.setCollectionModel(model);
    return model;
  }
View Full Code Here


        // is not asked for which would create an infinite loop
        _retrievingDisclosedRows = true;

        try
        {
          RowKeySet rowKeys = (RowKeySet) value;
          // row key sets need the most recent collection model, but there is no one common entry
          // point to set this on the set besides when code asks for the value from the bean
          rowKeys.setCollectionModel(getCollectionModel());
        }
        finally
        {
          _retrievingDisclosedRows = false;
        }
View Full Code Here

    }

    @Override
    public Object saveState(FacesContext context)
    {
      RowKeySet rowKeys = (RowKeySet)super.getProperty(DISCLOSED_ROW_KEYS_KEY);
      if (rowKeys != null)
      {
        // make sure the set does not pin the model in memory
        rowKeys.setCollectionModel(null);
      }
      return super.saveState(context);
    }
View Full Code Here

    // recursively process any grandchild columns of the nodeStamp column:
    TableUtils.__processColumnFacets(context, this, nodeStamp, phaseId);

    Object oldPath = getRowKey();
    RowKeySet state = getDisclosedRowKeys();
    try
    {
      Object path = getFocusRowKey();
      setRowKey(path);
      if (path == null)
      {
        HierarchyUtils.__iterateOverTree(context,
                                         phaseId,
                                         this,
                                         state,
                                         true);       

      }
      else
      {
        TableUtils.__processStampedChildren(context, this, phaseId);
        processComponent(context, nodeStamp, phaseId); // bug 4688568
 
        if (state.isContained())
        {
          enterContainer();
          HierarchyUtils.__iterateOverTree(context,
                                           phaseId,
                                           this,
View Full Code Here

    // We'll just replace colons with underscores;  not perfect, but adequate
    final String varName = "_adftree" + XhtmlUtils.getJSIdentifier(id);

    boolean leftToRight = !rc.isRightToLeft();
    int rootSize = tree.getRowCount();
    RowKeySet state = getExpandedRowKeys(tree);
    Map<Object, Boolean> selectedPaths = getSelectedPaths(focusPath);

    // render each of the root nodes
    for (int i = 0; i < rootSize; i++)
    {
View Full Code Here

    String[] selectedBoxes =
      parameters.get(tableId+NamingContainer.SEPARATOR_CHAR+SELECTED_KEY);

    // must work with both table and hgrid:
    final RowKeySet selectionModel;
    if (table instanceof UIXTable)
      selectionModel = ((UIXTable) table).getSelectedRowKeys();
    else
      selectionModel = ((UIXTree) table).getSelectedRowKeys();


//    Object selectMode = tableMap.get(UIConstants.SELECT_MODE_KEY);
//    // select-all/none across all ranges (both visible and invisible)
//    // is disabled for EA6. This is because it is pretty bad if in the email
//    // demo the user does a select-all followed by delete and all of his/her
//    // messages (including the ones that are currently not visible) are deleted.
//    if (false && (selectMode != null))
//    {
//      if ("all".equals(selectMode))
//        selectionModel.addAll();
//      else if ("none".equals(selectMode))
//        selectionModel.clear();
//
//      // even if we do a select all/none we still need to run through the
//      // regular per row selection code below. this is because the user might
//      // have clicked select-all and then deselected some rows before submitting:
//    }

    RowKeySet selectedDelta = selectionModel.clone();
    selectedDelta.clear();
    RowKeySet unselectedDelta = selectedDelta.clone();

    _setDeltas(table, selectedBoxes, unselectedBoxes,
               selectionModel, selectedDelta, unselectedDelta);
    if ((selectedDelta.getSize() != 0) || (unselectedDelta.getSize() != 0))
    {
      FacesEvent event =
        new SelectionEvent(table, unselectedDelta, selectedDelta);
      event.queue();
    }
View Full Code Here

      {
        List<Object> focusPath =
          new ArrayList<Object>(tree.getAllAncestorContainerRowKeys(focusRowKey));
        focusPath.add(focusRowKey);
        int size = focusPath.size();
        RowKeySet disclosedRowKeys = tree.getDisclosedRowKeys();
        for ( int i = 0 ; i < size; i++)
        {
          Object subkey = focusPath.get(i);
          disclosedRowKeys.add(subkey);
        }    
      }
    }
  }
View Full Code Here

            return;
          }
          else
          {
            tree.setRowKey(focusRowKey);
            RowKeySet old = _getExpandedRowKeys(tree);
            RowKeySet newset = old.clone();
            if (expand)
              newset.addAll();
            else
              newset.removeAll();
            event = new RowDisclosureEvent(old, newset, tree);
          }
        }
        else  // expand/collapse event
        {
          _restorePathFromParam(parameters, tree);
          RowKeySet old = _getExpandedRowKeys(tree);
          RowKeySet newset = old.clone();
          newset.setContained(expand);
          event = new RowDisclosureEvent(old, newset, tree);
        }
        event.queue();
      }
    };
View Full Code Here

      String selection = parameters.get(selectionParam);

      if (selection != null)
      {
        final RowKeySet state;
        if (table instanceof UIXTable)
          state = ((UIXTable) table).getSelectedRowKeys();
        else
          state = ((UIXTree) table).getSelectedRowKeys();

        table.setClientRowKey(selection);
        // If the key is not already selected, or the state is more than one
        // (someone changed the table selection from multiple to single),
        // update the keys
        if (!state.isContained() || state.size() > 1)
        {
          RowKeySet unselected = state.clone();
          // TODO : do not mutate the selectedRowKeys here.
          // instead, mutate when event is broadcast:
          state.clear();
          state.add();
          // clone, so that subsequent mutations of "state" will
          // not affect the parameters of this event: bug 4733858:
          RowKeySet selected = state.clone();
          FacesEvent event = new SelectionEvent(table, unselected, selected);
          event.queue();
        }
      }
    }
View Full Code Here

    UIXTreeTable hGrid = ttrc.getUIXTreeTable();
    final boolean disclosed;
    final String onclick;
    if (hGrid.isContainer())
    {
      RowKeySet treeState = hGrid.getDisclosedRowKeys();
      String jsVarName = ttrc.getJSVarName();
      if (treeState.isContained())
      {
        disclosed = true;
        onclick = TreeUtils.callJSExpandNode(hGrid, jsVarName, false);
      }
      else
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.model.RowKeySet

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.