本文整理汇总了Java中org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider.setSort方法的典型用法代码示例。如果您正苦于以下问题:Java SortableDataProvider.setSort方法的具体用法?Java SortableDataProvider.setSort怎么用?Java SortableDataProvider.setSort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider
的用法示例。
在下文中一共展示了SortableDataProvider.setSort方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRunHistoryTable
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入方法依赖的package包/类
protected DataTable<RunReportHistory, String> createRunHistoryTable(RunReportHistoryDataProvider dataProvider) {
SortableDataProvider<RunReportHistory, String> sortableDataProvider = new SortableDataAdapter<RunReportHistory>(
dataProvider);
sortableDataProvider.setSort("endDate", SortOrder.DESCENDING);
return new BaseTable<RunReportHistory>("runHistoryTable", createHistoryTableColumns(), sortableDataProvider,
rowsPerPage);
}
示例2: createJobsTable
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入方法依赖的package包/类
protected DataTable<ReportJobInfo, String> createJobsTable(ReportJobInfoDataProvider dataProvider) {
SortableDataProvider<ReportJobInfo, String> sortableDataProvider = new SortableDataAdapter<ReportJobInfo>(
dataProvider);
sortableDataProvider.setSort("startDate", SortOrder.ASCENDING);
return new BaseTable<ReportJobInfo>("jobsTable", createJobsTableColumns(), sortableDataProvider,
Integer.MAX_VALUE);
}
示例3: createSchedulerJobsTable
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入方法依赖的package包/类
protected DataTable<SchedulerJob, String> createSchedulerJobsTable(ActiveSchedulerJobDataProvider dataProvider) {
SortableDataProvider<SchedulerJob, String> sortableDataProvider = new SortableDataAdapter<SchedulerJob>(
dataProvider);
sortableDataProvider.setSort("nextRun", SortOrder.ASCENDING);
return new BaseTable<SchedulerJob>("schedulerJobsTable", createActiveSchedulerJobsTableColumns(),
sortableDataProvider, Integer.MAX_VALUE);
}
示例4: TimesheetMassUpdatePage
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入方法依赖的package包/类
public TimesheetMassUpdatePage(final AbstractSecuredPage callerPage, final List<TimesheetDO> timesheets)
{
super(new PageParameters(), callerPage);
this.timesheets = timesheets;
form = new TimesheetMassUpdateForm(this);
Integer taskId = null;
for (final TimesheetDO sheet : timesheets) {
if (taskId == null) {
taskId = sheet.getTaskId();
} else if (taskId.equals(sheet.getTaskId()) == false) {
taskId = null;
break;
}
}
if (taskId != null) {
// All time sheets have the same task, so pre-select this task.
timesheetDao.setTask(form.data, taskId);
}
body.add(form);
form.init();
final List<IColumn<TimesheetDO, String>> columns = TimesheetListPage.createColumns(this, false, true, null, taskTree,
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()
{
return timesheets != null ? timesheets.size() : 0;
}
public IModel<TimesheetDO> model(final TimesheetDO object)
{
return new Model<TimesheetDO>() {
@Override
public TimesheetDO getObject()
{
return object;
}
};
}
};
sortableDataProvider.setSort("startTime", SortOrder.DESCENDING);
final DefaultDataTable<TimesheetDO, String> dataTable = new DefaultDataTable<TimesheetDO, String>("table", columns, sortableDataProvider, 1000);
body.add(dataTable);
}
示例5: AddressCampaignValueMassUpdatePage
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入方法依赖的package包/类
public AddressCampaignValueMassUpdatePage(final AbstractSecuredPage callerPage, final List<AddressDO> addresses,
final AddressCampaignDO addressCampaign, final Map<Integer, PersonalAddressDO> personalAddressMap,
final Map<Integer, AddressCampaignValueDO> addressCampaignValueMap)
{
super(new PageParameters(), callerPage);
this.addresses = addresses;
form = new AddressCampaignValueMassUpdateForm(this, addressCampaign);
body.add(form);
form.init();
final List<IColumn<AddressDO, String>> columns = AddressCampaignValueListPage.createColumns(this, false, true, null, personalAddressMap,
addressCampaignValueMap);
@SuppressWarnings("serial")
final SortableDataProvider<AddressDO, String> sortableDataProvider = new SortableDataProvider<AddressDO, String>() {
@Override
public Iterator< ? extends AddressDO> iterator(final long first, final long count)
{
final SortParam sp = getSort();
if (addresses == null) {
return null;
}
final Comparator<AddressDO> comp = new MyBeanComparator<AddressDO>(sp.getProperty().toString(), sp.isAscending());
Collections.sort(addresses, comp);
return addresses.subList((int)first, (int)(first + count)).iterator();
}
public long size()
{
return addresses != null ? addresses.size() : 0;
}
public IModel<AddressDO> model(final AddressDO object)
{
return new Model<AddressDO>() {
@Override
public AddressDO getObject()
{
return object;
}
};
}
};
sortableDataProvider.setSort("name", SortOrder.DESCENDING);
final DefaultDataTable<AddressDO, String> dataTable = new DefaultDataTable<AddressDO, String>("table", columns, sortableDataProvider, 1000);
body.add(dataTable);
}