Examples of SequenceRange


Examples of org.ajax4jsf.model.SequenceRange

   * @see org.ajax4jsf.model.ExtendedDataModel#walk(javax.faces.context.FacesContext, org.ajax4jsf.model.DataVisitor, org.ajax4jsf.model.Range, java.lang.Object)
   */
  @Override
  public void walk(FacesContext context, DataVisitor visitor, Range range,
      Object argument) throws IOException {
    final SequenceRange seqRange = (SequenceRange) range;
    int rows = seqRange.getRows();
    int rowCount = list !=null ? list.size() : -1;
    int currentRow = seqRange.getFirstRow();
    if(rows > 0){
      rows += currentRow;
      rows = Math.min(rows, rowCount);
    } else {
      rows = rowCount;
View Full Code Here

Examples of org.ajax4jsf.model.SequenceRange

  }

  @Override
  public void walk(FacesContext context, DataVisitor visitor, Range range,
      Object argument) throws IOException {
    final SequenceRange seqRange = (SequenceRange) range;
    int rows = seqRange.getRows();
    int rowCount = getRowCount();
    int currentRow = seqRange.getFirstRow();
    if(rows > 0){
      rows += currentRow;
      rows = Math.min(rows, rowCount);
    } else {
      rows = rowCount;
View Full Code Here

Examples of org.ajax4jsf.model.SequenceRange

  }

  @Override
  public void walk(FacesContext context, DataVisitor visitor, Range range,
      Object argument) throws IOException {
    final SequenceRange seqRange = (SequenceRange) range;
    int rows = seqRange.getRows();
    int rowCount = getRowCount();
    int currentRow = seqRange.getFirstRow();
    if(rows > 0){
      rows += currentRow;
      rows = Math.min(rows, rowCount);
    } else {
      rows = rowCount;
View Full Code Here

Examples of org.ajax4jsf.model.SequenceRange

          originalModel.setRowKey(rowKey);
          if (originalModel.isRowAvailable()) {
            rowKeys.add(rowKey);
          }
        }
      }, new SequenceRange(0, -1),
      null);
    } catch (IOException e) {
      log.error(e.getMessage(), e);
    }
       
View Full Code Here

Examples of org.ajax4jsf.model.SequenceRange

  @SuppressWarnings("unchecked")
  @Override
  public void walk(FacesContext facesContext, DataVisitor visitor, Range range,
      Object argument) throws IOException {

    SequenceRange sequenceRange = (SequenceRange) range;
   
    if (this.cachedItems == null || !areEqualRanges(this.cachedRange, sequenceRange)) {
      Criteria criteria = createCriteria();
      appendFilters(facesContext, criteria);
      appendSorts(facesContext, criteria);

      if (sequenceRange != null) {
        int first = sequenceRange.getFirstRow();
        int rows = sequenceRange.getRows();
       
        criteria.setFirstResult(first);
        if (rows > 0) {
          criteria.setMaxResults(rows);
        }
View Full Code Here

Examples of org.ajax4jsf.model.SequenceRange

            public DataVisitResult process(FacesContext context, Object rowKey, Object argument) {
                table.setRowKey(rowKey);
                builder.append(table.getRowData());
                return DataVisitResult.CONTINUE;
            }
        }, new SequenceRange(2, 5), null);
        assertEquals("23456", builder.toString());
    }
View Full Code Here

Examples of org.ajax4jsf.model.SequenceRange

                    rowKeys.add(rowKey);
                }
                return DataVisitResult.CONTINUE;
            }
        };
        arrangeableModel.walk(facesContext, visitor, new SequenceRange(0, -1), null);
        Assert.assertEquals(FILTERD_AND_SORTED_ROW_KEYS, rowKeys);
        rowKeys.clear();
        arrangeableModel.walk(facesContext, visitor, new SequenceRange(0, ROWS), null);
        Assert.assertEquals(FILTERD_AND_SORTED_ROW_KEYS.subList(0, ROWS), rowKeys);
    }
View Full Code Here

Examples of org.ajax4jsf.model.SequenceRange

        writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.INPUT_TYPE_HIDDEN, null);
        UIDataTableBase table = (UIDataTableBase) component;
        StringBuilder builder = new StringBuilder("|");
        Object key = table.getRowKey();
        table.captureOrigValue(context);
        SequenceRange range = (SequenceRange) table.getComponentState().getRange();
        int first = range.getFirstRow();
        int last = first + range.getRows() - 1;
        Map<String, Object> attributes = component.getAttributes();
        table.setRowKey(attributes.get("activeRowKey"));
        int activeIndex = table.getRowIndex();
        if (activeIndex > 0) {
            if (activeIndex < first) {
View Full Code Here

Examples of org.ajax4jsf.model.SequenceRange

    private void encodeSelectionOutsideCurrentRange(FacesContext context, AbstractExtendedDataTable table, String selectionFlag) { // TODO
                                                                                                                                   // Rename
                                                                                                                                   // method
        Object key = table.getRowKey();
        table.captureOrigValue(context);
        SequenceRange range = (SequenceRange) table.getComponentState().getRange();
        SequenceRange newRange = null;
        Map<String, Object> attributes = table.getAttributes();
        Object rowKey = attributes.get("shiftRowKey");
        if (rowKey == null) {
            rowKey = attributes.get("activeRowKey");
            attributes.put("shiftRowKey", rowKey);
        }
        table.setRowKey(rowKey);
        int shiftIndex = table.getRowIndex();
        if (ClientSelection.FLAG_ALL.equals(selectionFlag)) {
            newRange = new SequenceRange(0, 0);
        } else if (shiftIndex > 0) {
            if (ClientSelection.FLAG_BEFORE_RANGE.equals(selectionFlag)) {
                newRange = new SequenceRange(shiftIndex, range.getFirstRow() - shiftIndex);
            } else {
                int last = range.getFirstRow() + range.getRows();
                newRange = new SequenceRange(last, shiftIndex - last + 1);
            }
        }
        table.setRowKey(context, key);
        table.restoreOrigValue(context);
        if (newRange != null) {
View Full Code Here

Examples of org.ajax4jsf.model.SequenceRange

     *
     * @see org.ajax4jsf.model.ExtendedDataModel#walk(javax.faces.context.FacesContext, org.ajax4jsf.model.DataVisitor,
     * org.ajax4jsf.model.Range, java.lang.Object)
     */
    public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) {
        final SequenceRange seqRange = (SequenceRange) range;
        int rows = seqRange.getRows();
        int rowCount = getRowCount();
        int currentRow = seqRange.getFirstRow();
        if (rows > 0) {
            rows += currentRow;
            rows = Math.min(rows, rowCount);
        } else {
            rows = rowCount;
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.