本文整理汇总了Java中org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator类的典型用法代码示例。如果您正苦于以下问题:Java ISortStateLocator类的具体用法?Java ISortStateLocator怎么用?Java ISortStateLocator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISortStateLocator类属于org.apache.wicket.extensions.markup.html.repeater.data.sort包,在下文中一共展示了ISortStateLocator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IconOrderByBorder
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
public IconOrderByBorder(final DataTable<?, ?> dataTable, final String id, final S property,
final ISortStateLocator<S> stateLocator) {
super(id);
this.property = property;
this.stateLocator = stateLocator;
final AjaxFallbackOrderByBorder<S> orderByBorder = new AjaxFallbackOrderByBorder<S>("orderByBorder", property,
stateLocator) {
@Override
protected void onAjaxClick(final AjaxRequestTarget target) {
target.add(dataTable);
}
};
addToBorder(orderByBorder);
this.icon = new Icon("icon", (IconType) null);
orderByBorder.add(icon);
}
示例2: newSortableHeader
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的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);
}
}
}
};
}
示例3: newGroupByLink
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
private Component newGroupByLink(String id, final ISortStateLocator stateLocator, final String groupProperty) {
return new AjaxLink(id) {
@Override
public void onClick(AjaxRequestTarget target) {
if (stateLocator instanceof IGroupStateLocator) {
IGroupStateLocator groupStateLocator = (IGroupStateLocator) stateLocator;
switchGroupState(groupStateLocator, groupProperty);
target.add(getTable());
}
}
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.put("title", "Group By");
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new CancelDefaultDecorator();
}
};
}
示例4: newSortableHeader
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
protected WebMarkupContainer newSortableHeader(final String borderId, final String property,
final ISortStateLocator locator) {
return new AjaxFallbackOrderByBorder(borderId, property, locator, getAjaxCallListener()) {
private static final long serialVersionUID = 1L;
@Override
protected void onAjaxClick(final AjaxRequestTarget target) {
target.add(getTable());
}
@Override
protected void onSortChanged() {
super.onSortChanged();
getTable().setCurrentPage(0);
}
};
}
示例5: newSortableHeader
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
@Override
protected WebMarkupContainer newSortableHeader(String headerId, final String property, final ISortStateLocator locator) {
return new AjaxFallbackOrderByBorder(headerId, property, locator) {
@Override
protected void onSortChanged() {
getTable().setCurrentPage(0);
}
@Override
protected void onAjaxClick(AjaxRequestTarget target) {
target.add(getTable());
}
@Override
public void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
ISortState sortState = locator.getSortState();
SortOrder dir = sortState.getPropertySortOrder(property);
String cssClass;
if (dir == SortOrder.ASCENDING) {
cssClass = "sortable asc";
} else if (dir == SortOrder.DESCENDING) {
cssClass = "sortable desc";
} else {
cssClass = "sortable";
}
if (!Strings.isEmpty(cssClass)) {
tag.append("class", cssClass, " ");
}
}
};
}
示例6: newOrderByLink
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
@Override
protected OrderByLink newOrderByLink(String id, Object property, ISortStateLocator stateLocator) {
return new OrderByLink(id, property, stateLocator) {
@Override
protected void onSortChanged() {
BasicOrderByBorder.this.onSortChanged();
}
};
}
示例7: newHeadersToolbar
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
protected AbstractToolbar newHeadersToolbar() {
return new AjaxFallbackHeadersToolbar<String>(this, (ISortableDataProvider<Object, String>) getDataProvider()) {
@Override
protected WebMarkupContainer newSortableHeader(final String headerId, final String property,
final ISortStateLocator<String> locator) {
return ModelDataTable.this.newSortableHeader(getTable(), headerId, property, locator);
}
};
}
示例8: newSortableHeader
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
@Override
protected WebMarkupContainer newSortableHeader(String headerId, final String property, final ISortStateLocator locator) {
return new AjaxFallbackOrderByBorder(headerId, property, locator) {
@Override
protected void onSortChanged() {
getTable().setCurrentPage(0);
}
@Override
protected void onAjaxClick(AjaxRequestTarget target) {
target.add(getTable());
}
@Override
public void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
ISortState sortState = locator.getSortState();
SortOrder dir = sortState.getPropertySortOrder(property);
String cssClass;
if (dir == SortOrder.ASCENDING) {
cssClass = "sortable asc";
} else if (dir == SortOrder.DESCENDING) {
cssClass = "sortable desc";
} else {
cssClass = "sortable";
}
if (!Strings.isEmpty(cssClass)) {
tag.append("class", cssClass, " ");
}
}
};
}
示例9: newSortableHeader
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
@Override
protected WebMarkupContainer newSortableHeader(String headerId, Object property, ISortStateLocator locator) {
return new BasicOrderByBorder(headerId, property, locator) {
@Override
protected void onSortChanged() {
getTable().setCurrentPage(0);
}
};
}
示例10: newOrderByLink
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
@Override
protected OrderByLink newOrderByLink(String id, Object property, ISortStateLocator stateLocator) {
return new OrderByLink(id, property, stateLocator, new OrderByLink.VoidCssProvider()) {
@Override
protected void onSortChanged() {
BasicOrderByBorder.this.onSortChanged();
}
};
}
示例11: newSortableHeader
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
@Override
protected WebMarkupContainer newSortableHeader(String headerId, S property, ISortStateLocator<S> locator) {
return new OrderByBorder<S>(headerId, property, locator, new OrderByLink.CssProvider<S>("", "", "")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSortChanged() {
getTable().setCurrentPage(0);
}
};
}
示例12: DataPanel
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的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());
}
示例13: DataViewOrderByLink
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
/**
* @param id
* @param property
* @param stateLocator
* @param cssProvider
*/
public DataViewOrderByLink(String id, String property, DataView dataView,
ICssProvider cssProvider) {
super(id, property, (ISortStateLocator) dataView.getDataProvider(),
cssProvider);
this.dataView = dataView;
}
示例14: TableHeadersToolbar
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
public TableHeadersToolbar(DataTable<T, String> table, ISortStateLocator stateLocator) {
super(table, stateLocator);
}
示例15: BasicOrderByBorder
import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator; //导入依赖的package包/类
protected BasicOrderByBorder(String id, Object property, ISortStateLocator stateLocator) {
super(id, property, stateLocator);
}