Example usage for org.apache.wicket.extensions.markup.html.repeater.util SortParam SortParam

List of usage examples for org.apache.wicket.extensions.markup.html.repeater.util SortParam SortParam

Introduction

In this page you can find the example usage for org.apache.wicket.extensions.markup.html.repeater.util SortParam SortParam.

Prototype

public SortParam(final T property, final boolean ascending) 

Source Link

Usage

From source file:com.francetelecom.clara.cloud.presentation.tools.ApplicationProvider.java

License:Apache License

public ApplicationProvider(String searchCriteria, List<Application> applicationsList) {
    this.searchCriteria = searchCriteria;
    this.applicationsList = applicationsList;
    setSort(new SortParam<String>("label", true));
}

From source file:com.francetelecom.clara.cloud.presentation.tools.EnvironmentDtoProvider.java

License:Apache License

public EnvironmentDtoProvider(String searchCriteria, List<EnvironmentDto> envList) {
    this.searchCriteria = searchCriteria;
    this.envList = envList;
    setSort(new SortParam<String>(Environment.CREATION_DATE, false));
}

From source file:com.francetelecom.clara.cloud.presentation.tools.ReleaseProvider.java

License:Apache License

public ReleaseProvider(String searchCriteria, List<ApplicationRelease> releasesList) {
    this.searchCriteria = searchCriteria;
    this.releasesList = releasesList;
    setSort(new SortParam<String>("label", true));
}

From source file:com.norconex.commons.wicket.util.SortablePropertyComparator.java

License:Apache License

public SortablePropertyComparator(S property, boolean ascending) {
    this(new SortParam<S>(property, ascending));
}

From source file:com.socialsite.dao.hibernate.CourseDaoTest.java

License:Open Source License

@Transactional
@Test//  w ww  . j  a  v  a 2s. co  m
public void testFindAll() {
    // courses
    final Course course1 = new Course();
    course1.setName("test1");
    final Course course2 = new Course();
    course2.setName("test2");
    saveCourses(course1, course2);
    assertEquals(2, courseDao.findAll("test", 0, 2, new SortParam("name", true)).size());
    assertEquals(2, courseDao.findAll(null, 0, 2, new SortParam("name", false)).size());
    assertEquals(2, courseDao.findAll().size());
}

From source file:com.socialsite.dao.hibernate.UniversityDaoTest.java

License:Open Source License

@Test
@Transactional//from   w  ww  .  j  a v a  2  s .c  om
public void testFinlAll() {
    // TODO check some more conditions
    final University u = new University("test");
    universityDao.save(u);
    assertEquals(1, universityDao.findAll("te", 0, 5, new SortParam("name", true)).size());
}

From source file:com.socialsite.dao.hibernate.UserDaoTest.java

License:Open Source License

@Test
@Transactional/*from ww  w .ja  v  a 2s . c  om*/
public void testFindAll() {
    final User ananth = new Student("ananth", "pass");
    final User anantha = new Student("anantha", "pass");
    saveUsers(ananth, anantha);
    assertEquals(2, userDao.findAll(null, 0, 2, new SortParam("userName", true)).size());
    assertEquals(2, userDao.findAll("an", 0, 2, new SortParam("userName", false)).size());
}

From source file:com.swordlord.gozer.components.wicket.list.GWListPanel.java

License:Open Source License

public GWListPanel(String id, IModel<?> model, GList glist, final Form<?> form) {
    super(id, model);

    _list = glist;/*from   www.  j  av  a  2s  . c om*/
    _form = form;

    _div = new WebMarkupContainer("div");
    add(_div);

    // validate if this is within an hbox or not
    if (hasVBoxAsParent(glist)) {
        _div.add(new AttributeModifier("id", new Model<String>("sub_element_halve")));
    }

    IGozerFrameExtension fe = getFrameExtension();

    SortParam sortParam = null;

    String strOrdering = glist.getOrdering();
    if ((strOrdering != null) && (strOrdering.length() > 0)) {
        sortParam = new SortParam(strOrdering, true);
    }

    GozerSortableFilterableDataProvider provider = new GozerSortableFilterableDataProvider(fe, glist,
            sortParam);

    DataBindingContext dbc = fe.getDataBindingContext();

    List<IColumn<DataRowBase, String>> columns = createColumns(glist, fe, dbc);

    int nRows = glist.getPageSize(ROWS_PER_PAGE);

    _table = new GozerDataTable("list", columns, provider, nRows, model, glist, form, this);
    _div.add(_table);

    listPanel = this;
    GozerController gc = getGWContext().getFrameExtension().getGozerController();
    gc.addGozerEventListener(new GozerListener());

}

From source file:de.twenty11.skysail.client.osgimonitor.wicket.pages.bundles.BundlesDataProvider.java

License:Apache License

/**
 * retrieves contacts from database starting with index <code>first</code>
 * and ending with <code>first+count</code>
 * /* ww w.  jav a  2  s .  c o  m*/
 * @see org.apache.wicket.markup.repeater.data.IDataProvider#iterator(int,
 *      int)
 */
public Iterator<Bundle> iterator(int first, int count) {
    return getContactsDB().find(first, count, new SortParam("symboliName", true)).iterator();
}

From source file:gr.interamerican.wicket.extensions.markup.html.repeater.util.TestSortableDataProvider.java

License:Open Source License

@Override
@SuppressWarnings("nls")
protected Component initializeComponent() {
    List<Bean1> rows = Arrays.asList(beans);
    SortableDataProvider<Bean1> sdp = new SortableDataProvider<Bean1>(rows, Bean1.class);
    List<IColumn<Bean1>> columns = new ArrayList<IColumn<Bean1>>();
    columns.add(new PropertyColumn<Bean1>(new Model<String>("Amount"), "amount", "amount"));
    columns.add(new PropertyColumn<Bean1>(new Model<String>("Description"), "description", "description"));
    SortParam sort = new SortParam("amount", true);
    sdp.setSort(sort);/* w  w w. j  a v  a2s.c  om*/
    return new DefaultDataTable<Bean1>(TEST_ID, columns, sdp, 10);
}