本文整理汇总了Java中org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider类的典型用法代码示例。如果您正苦于以下问题:Java SortableDataProvider类的具体用法?Java SortableDataProvider怎么用?Java SortableDataProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SortableDataProvider类属于org.apache.wicket.extensions.markup.html.repeater.util包,在下文中一共展示了SortableDataProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initLayout
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
private void initLayout(final IModel<TaskDto> taskDtoModel, final PageBase pageBase) {
SortableDataProvider<OperationResult, String> provider = new ListDataProvider<>(this,
new PropertyModel<List<OperationResult>>(taskDtoModel, TaskDto.F_OP_RESULT));
TablePanel resultTablePanel = new TablePanel<>(ID_OPERATION_RESULT, provider, initResultColumns());
resultTablePanel.setStyle("padding-top: 0px;");
resultTablePanel.setShowPaging(false);
resultTablePanel.setOutputMarkupId(true);
add(resultTablePanel);
add(new AjaxFallbackLink(ID_SHOW_RESULT) {
public void onClick(AjaxRequestTarget target) {
OperationResult opResult = taskDtoModel.getObject().getTaskOperationResult();
OperationResultPanel body = new OperationResultPanel(
pageBase.getMainPopupBodyId(),
new Model<>(OpResult.getOpResult(pageBase, opResult)),
pageBase);
body.setOutputMarkupId(true);
pageBase.showMainPopup(body, target);
}
});
}
示例2: YagoTypeListPage
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
public YagoTypeListPage(PageParameters parameters) {
super(parameters);
final ImmutableList<PropertyColumn<YagoType, String>> columns = ImmutableList.of(
new LinkColumn<>(new Model<>("Node name"), "nn", "nn",
YagoTypeShowPage.class, "nodeName", "nn"),
new PropertyColumn<>(new Model<>("prefLabel"), "prefLabel", "prefLabel"),
new PropertyColumn<>(new Model<>("isPreferredMeaningOf"), "isPreferredMeaningOf"),
new PropertyColumn<>(new Model<>("hasGloss"), "hasGloss")
);
final int ITEMS_PER_PAGE = 20;
final SortableDataProvider<YagoType, String> yagoTypeDp = new SortableDataProvider<YagoType, String>() {
{{
setSort("nn", SortOrder.ASCENDING);
}}
@Override
public Iterator iterator(long first, long count) {
final PageRequest pageable = new PageRequest((int) (first / ITEMS_PER_PAGE), (int) count,
getSort().isAscending() ? Sort.Direction.ASC : Sort.Direction.DESC, getSort().getProperty());
return yagoTypeRepo.findAll(pageable).iterator();
}
@Override
public long size() {
return yagoTypeRepo.count();
}
@Override
public IModel model(YagoType object) {
return new Model<>(object);
}
};
final BootstrapDataTable<YagoType, String> yagoTypeTable = new BootstrapDataTable<>("yagoTypeTable", columns, yagoTypeDp, ITEMS_PER_PAGE);
yagoTypeTable.setOutputMarkupId(true);
add(yagoTypeTable);
// add(new BootstrapAjaxPagingNavigator("navigator", yagoTypeTable));
}
示例3: ThingListPage
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
public ThingListPage(PageParameters parameters) {
super(parameters);
final ImmutableList<PropertyColumn<Thing, String>> columns = ImmutableList.of(
new LinkColumn<>(new Model<>("Node name"), "nn", "nn",
ThingShowPage.class, "nodeName", "nn"),
new PropertyColumn<>(new Model<>("prefLabel"), "prefLabel", "prefLabel")
);
final int ITEMS_PER_PAGE = 20;
final SortableDataProvider<Thing, String> thingDp = new SortableDataProvider<Thing, String>() {
{{
setSort("nn", SortOrder.ASCENDING);
}}
@Override
public Iterator iterator(long first, long count) {
final PageRequest pageable = new PageRequest((int) (first / ITEMS_PER_PAGE), (int) count,
getSort().isAscending() ? Sort.Direction.ASC : Sort.Direction.DESC, getSort().getProperty());
return thingRepo.findAll(pageable).iterator();
}
@Override
public long size() {
return thingRepo.count();
}
@Override
public IModel model(Thing object) {
return new Model<>(object);
}
};
final BootstrapDataTable<Thing, String> thingTable = new BootstrapDataTable<>("thingTable", columns, thingDp, ITEMS_PER_PAGE);
thingTable.setOutputMarkupId(true);
add(thingTable);
}
示例4: delegate
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
@Override
protected SortableDataProvider delegate() {
if(thisRunProvider==null)
{
if(useQueryProvider())
{
if(queryProvider==null) queryProvider = new ODocumentLinksQueryDataProvider(docModel, propertyModel) {
@Override
public SortParam<String> getSort() {
return ODocumentLinksDataProvider.this.getSort();
}
};
thisRunProvider = queryProvider;
}
else
{
if(javaSortableProvider==null) javaSortableProvider = new ODocumentLinksJavaSortableDataProvider<String>(docModel, propertyModel){
@Override
public SortParam<String> getSort() {
return ODocumentLinksDataProvider.this.getSort();
}
};
thisRunProvider = javaSortableProvider;
}
}
return thisRunProvider;
}
示例5: DMDJavaScriptDataTable
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
public DMDJavaScriptDataTable(String id, List<IColumn<T, String>> columns,
SortableDataProvider<T, String> dataProvider,
int rowsPerPage, TableItemPosition navigationbarPosition) {
super(id, columns, dataProvider, rowsPerPage);
this.dataProvider = dataProvider;
addToolbar(navigationbarPosition, newNavigationToolbar());
addToolbar(TableItemPosition.top, new JavaScriptHeaderToolbar(this, dataProvider));
addToolbar(TableItemPosition.bottom, new NoRecordsToolbar(this));
setOutputMarkupId(true);
}
示例6: newDataProvider
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
/**
* Method defines ISortableDataProvider instance for the table. Default
* implementation provides entities form the list specified in the
* constructor of GenericDataTablePanel. First property of the
*/
protected SortableDataProvider<T, String> newDataProvider() {
SortParam<String> sortParam = null;
if (columnConfigurator.getSortable().size() > 0 && getDefaultSortOrder() != ColumnSortOrder.NONE) {
String initialSortColumn = getInitialSortColumn();
if (initialSortColumn == null) {
initialSortColumn = columnConfigurator.getSortable().get(0);
}
sortParam = new SortParam<String>(initialSortColumn, (getDefaultSortOrder() == ColumnSortOrder.UP));
}
return new SortableGenericDataProvider<T, String>((IModel<List<T>>) getDefaultModel(), sortParam);
}
示例7: DataPanel
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
public DataPanel(String id, int rowsPerPage) {
super(id);
List<IColumn> columns = getColumns();
SortableListModel<T> sortableListModel = getSortableListModel();
SortableDataProvider dataProvider = new SortableListDataProvider(sortableListModel);
dataTable = new DataTable("dataTable", columns.toArray(new IColumn[0]), dataProvider, rowsPerPage);
add(dataTable);
dataTable.setOutputMarkupId(true);
dataTable.setVersioned(false);
dataTable.addTopToolbar(new AjaxFallbackHeadersToolbar(dataTable, dataProvider) {
@Override
protected WebMarkupContainer newSortableHeader(String borderId,
String property, ISortStateLocator locator) {
WebMarkupContainer sortableHeader = super.newSortableHeader(borderId, property, locator);
sortableHeader.add(new SimpleAttributeModifier("scope", "col"));
return sortableHeader;
}
});
dataTable.addBottomToolbar(new AjaxNavigationToolbar(dataTable) {
@Override
protected PagingNavigator newPagingNavigator(String navigatorId,
DataTable table) {
return new AutoHidePagingNavigator(navigatorId, table);
}
});
dataTable.addBottomToolbar(new NoRecordsToolbar(dataTable));
dataTable.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
}
示例8: 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);
}
示例9: 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);
}
示例10: 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);
}
示例11: createTablePanel
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
protected AjaxCheckTablePanel<Entity> createTablePanel(EntityListDataProvider dataProvider) {
SortableDataProvider<Entity, String> sortableDataProvider = new SortableDataAdapter<Entity>(dataProvider);
return new AjaxCheckTablePanel<Entity>("table", createTableColumns(), sortableDataProvider, 10) {
private static final long serialVersionUID = 1L;
@Override
protected boolean isCheckable(IModel<Entity> rowModel) {
return !StorageUtil.isSystemPath(rowModel.getObject().getPath());
}
};
}
示例12: SortableUserProviderComparator
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
public SortableUserProviderComparator(
final SortableDataProvider<UserTO> provider) {
super(provider);
}
示例13: SortableDataProviderComparator
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
public SortableDataProviderComparator(
final SortableDataProvider<T> provider) {
this.provider = provider;
}
示例14: TaxonomyNeo4jListPage
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
public TaxonomyNeo4jListPage(PageParameters parameters) {
super(parameters);
final List<Thing> things = new ArrayList<>();
try (Transaction tx = taxonomyDb.beginTx()) {
try (final Result thingsRes = taxonomyDb.execute("MATCH (t: schema_Thing) RETURN t LIMIT 25")) {
while (thingsRes.hasNext()) {
final Map<String, Object> row = thingsRes.next();
final Node thingNode = (Node) row.get("t");
final Thing thing = new Thing();
thing.setId(thingNode.getId());
thing.setNn((String) thingNode.getProperty("nn"));
thing.setIsPreferredMeaningOf((String) thingNode.getProperty("isPreferredMeaningOf", null));
thing.setPrefLabel((String) thingNode.getProperty("prefLabel", null));
things.add(thing);
}
}
tx.success();
}
final ImmutableList<PropertyColumn<Thing, String>> columns = ImmutableList.of(
new PropertyColumn<>(new Model<>("ID"), "id", "id"),
new TextFilteredPropertyColumn<>(new Model<>("Node name"), "nn"),
new PropertyColumn<>(new Model<>("prefLabel"), "prefLabel"),
new PropertyColumn<>(new Model<>("isPreferredMeaningOf"), "isPreferredMeaningOf")
);
final int ITEMS_PER_PAGE = 20;
final SortableDataProvider<Thing, String> thingDp = new SortableDataProvider<Thing, String>() {
{{
setSort("creationTime", SortOrder.DESCENDING);
}}
@Override
public Iterator iterator(long first, long count) {
return things.iterator();
// final PageRequest pageable = new PageRequest((int) (first / ITEMS_PER_PAGE), (int) count,
// getSort().isAscending() ? Sort.Direction.ASC : Sort.Direction.DESC, getSort().getProperty());
// return placeRepo.findAll(pageable).iterator();
}
@Override
public long size() {
return things.size();
}
@Override
public IModel model(Thing object) {
return new Model<>(object);
}
};
final DefaultDataTable<Thing, String> thingTable = new DefaultDataTable<>("thingTable", columns, thingDp, ITEMS_PER_PAGE);
thingTable.setOutputMarkupId(true);
add(thingTable);
}
示例15: ModalListPanel
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; //导入依赖的package包/类
protected ModalListPanel(String id, SortableDataProvider<T> dataProvider) {
super(id, dataProvider);
init();
}