Examples of RowKeySet


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

        // Notify the specified disclosure listener method (if any)
    if (event instanceof RowDisclosureEvent)
    {
      RowDisclosureEvent dEvent = (RowDisclosureEvent) event;
      state.removeAll(dEvent.getRemovedSet());
      RowKeySet added = dEvent.getAddedSet();
      int size = 0;
      // only do an unbounded expandAll if the number of new nodes is not
      // too large:
      // FIXME: Wouldn't .size() do the work instead of looping 100 times...
      for(Object key : added)
View Full Code Here

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

  {
    boolean doExpand = XhtmlConstants.SHOW_EVENT.equals(eventParam);
    Object value = parameters.get(XhtmlConstants.VALUE_PARAM);
    if (value != null)
    {
      RowKeySet old = table.getDisclosedRowKeys();
      RowKeySet newset = old.clone();
      if ("all".equals(value))
      {
        if (doExpand)
          newset.addAll();
        else
          newset.removeAll();
        FacesEvent event = new RowDisclosureEvent(old, newset, table);
        event.queue();
      }
      else
      {
        int rowIndex = Integer.parseInt((String) value);
        int oldIndex = table.getRowIndex();
        table.setRowIndex(rowIndex);
        newset.setContained(doExpand);
        FacesEvent event = new RowDisclosureEvent(old, newset, table);
        event.queue();
        table.setRowIndex(oldIndex);
      }
    }
View Full Code Here

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

    final RenderingContext   arc,
    final TreeTableRenderingContext ttrc) throws IOException
  {
    final UIXTreeTable treeTableBase = ttrc.getUIXTreeTable();
    final ResponseWriter writer = context.getResponseWriter();
    final RowKeySet treeState = treeTableBase.getDisclosedRowKeys();
    final int specialColCount = _getSpecialColCount(ttrc);

    TableUtils.RowLoop loop = new TableUtils.RowLoop()
    {
      @Override
      protected void loop(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        Object focusPath = TreeUtils.getFocusRowKey(treeTableBase);
        treeTableBase.setRowKey(focusPath);
        processRow(context, treeTable);
      }

      @Override
      protected void processRowImpl(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
        renderSingleRow(context, arc, ttrc, treeTableBase);
        writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
//
  //        if (hasInvisibleNodes)
  //        {
  //          //context.addHiddenDataObject(treeTableBase.getRowData());
  //        }

        if (treeTableBase.isContainer())
        {
          if (treeState.isContained())
          {
            treeTableBase.enterContainer();
            int rows = treeTableBase.getRows();
            int rowCount = treeTableBase.getRowCount();
            boolean renderNavRow = (rows > 0) &&
View Full Code Here

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

    final String varName = "_adftree" +
            XhtmlUtils.getJSIdentifier(name);

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

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

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

    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

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

      {
        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

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

            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

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

      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 (!state.isContained())
        {
          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

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

      {
        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

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

            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
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.