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

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


    }

    public void buildOrdered(Criteria criteria)
    {
        String property;
        SortParam sort = sortState.getSort();
        if( sort != null && sort.getProperty() != null )
        {
            property  = sort.getProperty();
            asc = sort.isAscending();
        }
        else {
            property = defaultProperty;
        }
        if( property != null )
View Full Code Here


        }

        public Iterator iterator(int first, int count)
        {
            List list = getList();
            final SortParam sortParam = getSort();
            if (sortParam != null) {
                if (list != listModel.getObject() || // Synthesized list. Always sort.
                                lastSortParam == null || // Haven't sorted yet.
                                !lastSortParam.getProperty().equals(sortParam.getProperty()) || // Sort params changed.
                                lastSortParam.isAscending() != sortParam.isAscending()) {

                    lastSortParam = new SortParam(sortParam.getProperty(), sortParam.isAscending());
                    ElementMetaData property = metaData.findElement(sortParam.getProperty());
                    Collections.sort(list, new PropertyComparator(property, sortParam.isAscending()));
                }
            }

            return list.subList(first, first + count).iterator();
        }
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

  /**
   * @see org.apache.wicket.markup.repeater.data.IDataProvider#iterator(int, int)
   */
  public Iterator iterator(int first, int count)
  {
    SortParam sp = getSort();
    return getContactsDB().find(first, count, sp.getProperty(), sp.isAscending()).iterator();
  }
View Full Code Here

  /**
   * @see org.apache.wicket.markup.repeater.data.IDataProvider#iterator(int, int)
   */
  public Iterator<Contact> iterator(int first, int count)
  {
    SortParam sp = getSort();
    return getContactsDB().find(first, count, sp.getProperty(), sp.isAscending()).iterator();
  }
View Full Code Here

  /**
   * @see org.apache.wicket.markup.repeater.data.IDataProvider#iterator(int, int)
   */
  public Iterator iterator(int first, int count)
  {
    SortParam sp = getSort();
    return getContactsDB().find(first, count, sp.getProperty(), sp.isAscending()).iterator();
  }
View Full Code Here

  /**
   * @see org.apache.wicket.markup.repeater.data.IDataProvider#iterator(int, int)
   */
  public Iterator<Contact> iterator(int first, int count)
  {
    SortParam sp = getSort();
    return getContactsDB().find(first, count, sp.getProperty(), sp.isAscending()).iterator();
  }
View Full Code Here

      return new Model<RepositoryModel>(header);
    }

    @Override
    public Iterator<RepositoryModel> iterator(int first, int count) {
      SortParam sp = getSort();
      String prop = sp.getProperty();
      final boolean asc = sp.isAscending();

      if (prop == null || prop.equals(SortBy.date.name())) {
        Collections.sort(list, new Comparator<RepositoryModel>() {
          @Override
          public int compare(RepositoryModel o1, RepositoryModel o2) {
View Full Code Here

                     * @see org.apache.wicket.markup.html.link.Link#getURL()
                     */
                    @Override
                    protected CharSequence getURL() {
                        final PageParameters params = new PageParameters();
                        final SortParam sort = dp.getSort();
                        params.add( "page", String.valueOf( getPageNumber() + 1 ) );
                        params.add( "orderby", sort.getProperty() );
                        params.add( "asc", String.valueOf( sort.isAscending() ) );

                        return urlFor( ListLightPage.class, params );
                    }

                    /*
 
View Full Code Here

         * @see org.apache.wicket.markup.html.link.Link#getURL()
         */
        @Override
        protected CharSequence getURL() {
            final PageParameters params = new PageParameters();
            final SortParam sort = _dataProvider.getSort();
            params.add( "page", String.valueOf( getPageNumber() + 1 ) );
            params.add( "orderby", sort.getProperty() );
            params.add( "asc", String.valueOf( sort.isAscending() ) );

            return urlFor( ListLightPage.class, params );
        }
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.