本文整理汇总了Java中org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder类的典型用法代码示例。如果您正苦于以下问题:Java SortOrder类的具体用法?Java SortOrder怎么用?Java SortOrder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SortOrder类属于org.apache.wicket.extensions.markup.html.repeater.data.sort包,在下文中一共展示了SortOrder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UserDataProvider
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
public UserDataProvider(
final UserRestClient restClient,
final int paginatorRows,
final boolean filtered) {
super();
this.restClient = restClient;
this.filtered = filtered;
this.paginatorRows = paginatorRows;
//Default sorting
setSort("id", SortOrder.ASCENDING);
comparator = new SortableUserProviderComparator(this);
}
示例2: TasksProvider
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
public TasksProvider(
final TaskRestClient restClient,
final int paginatorRows,
final String id,
final Class<T> reference) {
super();
//Default sorting
setSort("id", SortOrder.ASCENDING);
comparator = new SortableDataProviderComparator<T>(this);
this.paginatorRows = paginatorRows;
this.restClient = restClient;
this.id = id;
this.reference = reference;
}
示例3: onConfigure
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@Override
protected void onConfigure() {
super.onConfigure();
final SortOrder sortOrder = stateLocator.getSortState().getPropertySortOrder(property);
final IconType iconType;
switch (sortOrder) {
case NONE:
iconType = FontAwesomeIconType.sort;
break;
case ASCENDING:
iconType = FontAwesomeIconType.sort_asc;
break;
case DESCENDING:
iconType = FontAwesomeIconType.sort_desc;
break;
default:
throw UnknownArgumentException.newInstance(SortOrder.class, sortOrder);
}
icon.setType(iconType);
}
示例4: newSortableHeader
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
protected WebMarkupContainer newSortableHeader(String borderId, final String sortBy,
final String groupBy,
final ISortStateLocator stateLocator) {
return new AjaxFallbackOrderByBorder(borderId, sortBy, stateLocator, getAjaxCallDecorator()) {
@Override
protected void onAjaxClick(AjaxRequestTarget target) {
target.add(getTable());
}
@Override
protected void onSortChanged() {
super.onSortChanged();
getTable().setCurrentPage(0);
// reset group
if (stateLocator instanceof IGroupStateLocator) {
IGroupStateLocator locator = (IGroupStateLocator) stateLocator;
if (isGroupedBy(locator.getGroupParam(), groupBy)) {
boolean ascending = locator.getGroupParam().isAscending();
locator.setGroupParam(new SortParam(groupBy, !ascending));
locator.getSortState().setPropertySortOrder("", SortOrder.NONE);
}
}
}
};
}
示例5: testOClassesDataProvider
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@Test
public void testOClassesDataProvider()
{
OClassesDataProvider provider = new OClassesDataProvider();
provider.setSort("name", SortOrder.ASCENDING);
assertTrue(provider.size()>5);
Iterator<? extends OClass> it = provider.iterator(0, -1);
OSchema schema = wicket.getTester().getSchema();
List<OClass> allClasses = new ArrayList<OClass>(schema.getClasses());
while(it.hasNext())
{
OClass oClass = it.next();
assertTrue(allClasses.remove(provider.model(oClass).getObject()));
}
assertTrue(allClasses.size()==0);
provider.detach();
}
示例6: testOPropertiesDataProvider
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@Test
public void testOPropertiesDataProvider()
{
OSchema schema = wicket.getTester().getSchema();
OClass oClass = schema.getClass("ClassA");
OPropertiesDataProvider provider = new OPropertiesDataProvider(oClass, true);
provider.setSort("name", SortOrder.ASCENDING);
Iterator<? extends OProperty> it = provider.iterator(0, -1);
List<OProperty> allProperties = new ArrayList<OProperty>(oClass.properties());
while(it.hasNext())
{
OProperty oProperty = it.next();
assertTrue(allProperties.remove(provider.model(oProperty).getObject()));
}
assertTrue(allProperties.size()==0);
provider.detach();
}
示例7: testOIndexDataProvider
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@Test
public void testOIndexDataProvider()
{
OSchema schema = wicket.getTester().getSchema();
OClass oClass = schema.getClass("OUser");
OIndexesDataProvider provider = new OIndexesDataProvider(oClass, true);
provider.setSort("name", SortOrder.ASCENDING);
Iterator<? extends OIndex<?>> it = provider.iterator(0, -1);
List<OIndex<?>> allIndexes = new ArrayList<OIndex<?>>(oClass.getIndexes());
while(it.hasNext())
{
OIndex<?> oIndex = it.next();
assertTrue(allIndexes.remove(provider.model(oIndex).getObject()));
}
assertTrue(allIndexes.size()==0);
provider.detach();
}
示例8: testOQueryProvider
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@Test
public void testOQueryProvider()
{
OQueryDataProvider<OUser> provider = new OQueryDataProvider<OUser>("select from OUser where name <> :other", OUser.class);
provider.setSort("name", SortOrder.ASCENDING);
provider.setParameter("other", Model.of("blalba"));
Iterator<OUser> it = provider.iterator(0, -1);
List<ODocument> allUsers = wicket.getTester().getMetadata().getSecurity().getAllUsers();
assertTrue(provider.size()==allUsers.size());
while(it.hasNext())
{
OUser oUser = it.next();
assertTrue(allUsers.contains(provider.model(oUser).getObject().getDocument()));
}
provider.detach();
assertTrue(provider.size()==allUsers.size());
}
示例9: testCollectionFilterCriteria
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void testCollectionFilterCriteria() {
List<Integer> models = Lists.newArrayList();
models.add(NUM_VALUE_1);
models.add(NUM_VALUE_2);
IModel<Collection<Integer>> collectionModel = new CollectionModel<>(models);
IFilterCriteriaManager manager = new FilterCriteriaManager(wicket.getProperty(NUMBER_FIELD));
manager.addFilterCriteria(manager.createCollectionFilterCriteria(collectionModel, Model.of(true)));
String field = wicket.getProperty(NUMBER_FIELD).getObject().getName();
queryModel.addFilterCriteriaManager(field, manager);
queryModel.setSort(NUMBER_FIELD, SortOrder.ASCENDING);
assertTrue(queryModel.getObject().size() == 2);
assertTrue(queryModel.getObject().get(0).field(NUMBER_FIELD).equals(NUM_VALUE_1));
assertTrue(queryModel.getObject().get(1).field(NUMBER_FIELD).equals(NUM_VALUE_2));
}
示例10: testRangeFilterCriteria
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@Test
public void testRangeFilterCriteria() {
List<Integer> models = Lists.newArrayList();
models.add(NUM_VALUE_1);
models.add(NUM_VALUE_3);
IModel<List<Integer>> listModel = new ListModel<>(models);
IFilterCriteriaManager manager = new FilterCriteriaManager(wicket.getProperty(NUMBER_FIELD));
manager.addFilterCriteria(manager.createRangeFilterCriteria(listModel, Model.of(true)));
String field = wicket.getProperty(NUMBER_FIELD).getObject().getName();
queryModel.addFilterCriteriaManager(field, manager);
queryModel.setSort(NUMBER_FIELD, SortOrder.ASCENDING);
assertTrue("size must be 3, but it is - " + queryModel.size(), queryModel.size() == 3);
assertTrue(queryModel.getObject().get(0).field(NUMBER_FIELD).equals(NUM_VALUE_1));
assertTrue(queryModel.getObject().get(1).field(NUMBER_FIELD).equals(NUM_VALUE_2));
assertTrue(queryModel.getObject().get(2).field(NUMBER_FIELD).equals(NUM_VALUE_3));
}
示例11: init
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@Override
protected void init()
{
final List<IColumn<EmployeeSalaryDO, String>> columns = createColumns(this, true);
dataTable = createDataTable(columns, "employee.user.lastname", SortOrder.ASCENDING);
form.add(dataTable);
addExcelExport(getString("fibu.employee.salaries"), getString("fibu.employee.salaries"));
{
// Excel export
@SuppressWarnings("serial")
final SubmitLink excelExportLink = new SubmitLink(ContentMenuEntryPanel.LINK_ID, form) {
@Override
public void onSubmit()
{
if (form.getSearchFilter().getMonth() < 0 || form.getSearchFilter().getMonth() > 11) {
form.addError("fibu.employee.salary.error.monthNotGiven");
return;
}
exportExcel();
}
};
final ContentMenuEntryPanel excelExportButton = new ContentMenuEntryPanel(getNewContentMenuChildId(), excelExportLink,
getString("fibu.rechnung.kostExcelExport")).setTooltip(getString("fibu.employee.salary.exportXls.tooltip"));
addContentMenuEntry(excelExportButton);
}
}
示例12: init
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@SuppressWarnings("serial")
@Override
protected void init()
{
dataTable = createDataTable(createColumns(this, true), "datum", SortOrder.DESCENDING);
form.add(dataTable);
addExcelExport(getString("fibu.common.creditor"), getString("fibu.eingangsrechnungen"));
if (Configuration.getInstance().isCostConfigured() == true) {
final ContentMenuEntryPanel exportExcelButton = new ContentMenuEntryPanel(getNewContentMenuChildId(), new Link<Object>("link") {
@Override
public void onClick()
{
exportExcelWithCostAssignments();
};
}, getString("fibu.rechnung.kostExcelExport")).setTooltip(getString("fibu.rechnung.kostExcelExport.tootlip"));
addContentMenuEntry(exportExcelButton);
}
}
示例13: init
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@SuppressWarnings("serial")
@Override
protected void init()
{
dataTable = createDataTable(createColumns(this, true), "nummer", SortOrder.DESCENDING);
form.add(dataTable);
final ContentMenuEntryPanel exportExcelButton = new ContentMenuEntryPanel(getNewContentMenuChildId(), new Link<Object>("link") {
@Override
public void onClick()
{
final List<AuftragDO> list = getList();
final byte[] xls = orderExport.export(list);
if (xls == null || xls.length == 0) {
form.addError("datatable.no-records-found");
return;
}
final String filename = "ProjectForge-OrderExport_" + DateHelper.getDateAsFilenameSuffix(new Date()) + ".xls";
DownloadUtils.setDownloadTarget(xls, filename);
};
}, getString("exportAsXls")).setTooltip(getString("tooltip.export.excel"));
addContentMenuEntry(exportExcelButton);
}
示例14: init
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@SuppressWarnings("serial")
@Override
protected void init()
{
dataTable = createDataTable(createColumns(this, true), "nummer", SortOrder.DESCENDING);
form.add(dataTable);
addExcelExport(getString("fibu.common.debitor"), getString("fibu.rechnungen"));
if (Configuration.getInstance().isCostConfigured() == true) {
final ContentMenuEntryPanel exportExcelButton = new ContentMenuEntryPanel(getNewContentMenuChildId(), new Link<Object>("link") {
@Override
public void onClick()
{
exportExcelWithCostAssignments();
};
}, getString("fibu.rechnung.kostExcelExport")).setTooltip(getString("fibu.rechnung.kostExcelExport.tootlip"));
addContentMenuEntry(exportExcelButton);
}
}
示例15: init
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder; //导入依赖的package包/类
@SuppressWarnings("serial")
@Override
protected void init()
{
dataTable = createDataTable(createColumns(this, true), "formattedNumber", SortOrder.ASCENDING);
form.add(dataTable);
{
// Excel export
final SubmitLink excelExportLink = new SubmitLink(ContentMenuEntryPanel.LINK_ID, form) {
@Override
public void onSubmit()
{
exportExcel();
}
};
final ContentMenuEntryPanel excelExportButton = new ContentMenuEntryPanel(getNewContentMenuChildId(), excelExportLink,
getString("exportAsXls")).setTooltip(getString("tooltip.export.excel"));
addContentMenuEntry(excelExportButton);
}
}