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

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

Introduction

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

Prototype

public SortParam<T> getSort() 

Source Link

Usage

From source file:de.elatexam.editor.pages.subtaskdefs.PrivateSubtasksDataProvider.java

License:Open Source License

private String createQueryString() {
    String q = String.format(query, TaskEditorSession.get().getUser().getUsername());
    // admin sees all subtasks
    if (TaskEditorApplication.isAdmin()) {
        q = adminQuery;/*from  w  w  w  . ja  va 2  s.  c om*/
    }

    if (!SubTaskDef.class.equals(clazz)) {
        q = q + String.format(classQuery, clazz.getName());
    }
    for (final Map.Entry<String, String> entry : (Set<Map.Entry<String, String>>) ((Map) builder
            .getFilterState()).entrySet()) {
        final String property = entry.getKey();
        final String value = entry.getValue();
        if (value == null) {
            continue;
        }
        q = q + " and task." + property + " like '%" + value + "%'";
    }
    final SingleSortState sort = (SingleSortState) getSortState();
    if (sort.getSort() != null) {
        q = q + " order by task." + sort.getSort().getProperty() + " "
                + (sort.getSort().isAscending() ? " asc" : "desc");
    }
    return q;
}

From source file:org.artifactory.common.wicket.component.table.masterdetail.MasterDetailRowPanel.java

License:Open Source License

private SortParam getSortParam(SortableTable table) {
    final SingleSortState sortState = (SingleSortState) table.getSortableDataProvider().getSortState();
    if (sortState == null) {
        return null;
    }//  w  ww  .j ava 2  s.c o m
    return sortState.getSort();
}