Package org.apache.wicket.extensions.markup.html.repeater.util

Examples of org.apache.wicket.extensions.markup.html.repeater.util.SortParam


        userFormatter, dateTimeFormatter);
    @SuppressWarnings("serial")
    final SortableDataProvider<TimesheetDO, String> sortableDataProvider = new SortableDataProvider<TimesheetDO, String>() {
      public Iterator<TimesheetDO> iterator(final long first, final long count)
      {
        final SortParam sp = getSort();
        final Comparator<TimesheetDO> comp = new MyBeanComparator<TimesheetDO>(sp.getProperty().toString(), sp.isAscending());
        Collections.sort(timesheets, comp);
        return timesheets.subList((int)first, (int)(first + count)).iterator();
      }

      public long size()
View Full Code Here


   * @param count
   *            number of rows to retrieve
   * @return iterator capable of iterating over {first, first+count} contacts
   */
  public Iterator<Contact> iterator(int first, int count) {
    SortParam sp = getSort();
    if (queryParam == null) {
      queryParam = new QueryParam(first, count, sp.getProperty(), sp
          .isAscending());
    } else {
      queryParam.setFirst(first);
      queryParam.setCount(count);
      queryParam.setSort(sp.getProperty());
      queryParam.setSortAsc(sp.isAscending());
    }
    return dao.find(queryParam, filter);
  }
View Full Code Here

   *            number of rows to retrieve
   * @return iterator capable of iterating over {first, first+count} contacts
   */
  public Iterator<Contact> iterator(int first, int count)
  {
    SortParam sp = getSort();
    if (queryParam == null)
    {
      queryParam = new QueryParam(first, count, sp.getProperty(), sp.isAscending());
    }
    else
    {
      queryParam.setFirst(first);
      queryParam.setCount(count);
      queryParam.setSort(sp.getProperty());
      queryParam.setSortAsc(sp.isAscending());
    }
    return dao.find(queryParam, filter);
  }
View Full Code Here

    String prefix = (String) fieldStringModel.getObject();

    if (prefix == null || currentListData == null)
      return new LinkedList<C>().iterator();

    SortParam sort = super.getSort();

    if (sort != null && this.currentListData.size() > 1) {

      Comparator<C> c = sorter.getComparatorForProperty(sort);
View Full Code Here

    AjaxLink sortLink(final GeoServerDataProvider<T> dataProvider, ListItem item) {
        return new AjaxLink("link", item.getModel()) {

            @Override
            public void onClick(AjaxRequestTarget target) {
                SortParam currSort = dataProvider.getSort();
                Property<T> property = (Property<T>) getModelObject();
                if (currSort == null || !property.getName().equals(currSort.getProperty())) {
                    dataProvider.setSort(new SortParam(property.getName(), true));
                } else {
                    dataProvider
                            .setSort(new SortParam(property.getName(), !currSort.isAscending()));
                }
                setSelection(false);
                target.addComponent(listContainer);
            }
View Full Code Here

    AjaxLink sortLink(final GeoServerDataProvider<T> dataProvider, ListItem item) {
        return new AjaxLink("link", item.getModel()) {

            @Override
            public void onClick(AjaxRequestTarget target) {
                SortParam currSort = dataProvider.getSort();
                Property<T> property = (Property<T>) getModelObject();
                if (currSort == null || !property.getName().equals(currSort.getProperty())) {
                    dataProvider.setSort(new SortParam(property.getName(), true));
                } else {
                    dataProvider
                            .setSort(new SortParam(property.getName(), !currSort.isAscending()));
                }
                setSelection(false);
                target.addComponent(listContainer);
            }
View Full Code Here

     */
    private Iterator<LayerInfo> filteredItems(Integer first, Integer count) {
        final Catalog catalog = getCatalog();

        // global sorting
        final SortParam sort = getSort();
        final Property<LayerInfo> property = getProperty(sort);

        SortBy sortOrder = null;
        if (sort != null) {
            if(property instanceof BeanProperty){
                final String sortProperty = ((BeanProperty<LayerInfo>)property).getPropertyPath();
                sortOrder = sortBy(sortProperty, sort.isAscending());
            }else if(property == ENABLED){
                sortOrder = sortBy("enabled", sort.isAscending());
            }
        }

        final Filter filter = getFilter();
        //our already filtered and closeable iterator
View Full Code Here

TOP

Related Classes of org.apache.wicket.extensions.markup.html.repeater.util.SortParam

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.