List of usage examples for org.apache.wicket.markup.html.navigation.paging PagingNavigation setViewSize
public void setViewSize(final int size)
From source file:com.doculibre.constellio.wicket.paging.ConstellioPagingNavigator.java
License:Open Source License
@Override protected PagingNavigation newNavigation(IPageable pageable, IPagingLabelProvider labelProvider) { PagingNavigation pagingNavigation = new PagingNavigation("navigation", pageable, labelProvider) { private static final long serialVersionUID = 1L; public boolean isEnabled() { return super.isEnabled() && ConstellioPagingNavigator.this.isEnabled() && ConstellioPagingNavigator.this.isEnableAllowed(); }/* w w w.ja v a2 s . c om*/ @Override protected Link newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { return ConstellioPagingNavigator.this.newPagingNavigationLink(id, pageable, pageIndex); } }; pagingNavigation.setViewSize(5); return pagingNavigation; }
From source file:com.francetelecom.clara.cloud.presentation.common.AjaxNavigationCustomToolbar.java
License:Apache License
@Override protected PagingNavigator newPagingNavigator(String navigatorId, final DataTable<?, ?> table) { OAjaxBigPagingNavigator oAjaxBigPagingNavigator = new OAjaxBigPagingNavigator(navigatorId, table) { private static final long serialVersionUID = 1L; /**/* w w w .j a v a2 s . com*/ * Implement our own ajax event handling in order to update the datatable itself, as the * default implementation doesn't support DataViews. * * @see AjaxPagingNavigator#onAjaxEvent(org.apache.wicket.ajax.AjaxRequestTarget) */ @Override protected void onAjaxEvent(final AjaxRequestTarget target) { target.add(table); } @Override protected PagingNavigation newNavigation(String id, IPageable pageable, IPagingLabelProvider labelProvider) { PagingNavigation nv = super.newNavigation(id, pageable, labelProvider); nv.setViewSize(NUMBER_PAGE_DISPLAYED); return nv; } }; return oAjaxBigPagingNavigator; }
From source file:jp.xet.uncommons.wicket.gp.SimplePagingNavigator.java
License:Apache License
@Override protected PagingNavigation newNavigation(String id, IPageable pageable, IPagingLabelProvider labelProvider) { PagingNavigation pg = new PagingNavigation("navigation", pageable, labelProvider) { @Override/*ww w . j a v a 2 s . c o m*/ protected Link<Void> newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { @SuppressWarnings("unchecked") Link<Void> lnk = (Link<Void>) super.newPagingNavigationLink(id, pageable, pageIndex); if (isAnchorSelf()) { lnk.setAnchor(SimplePagingNavigator.this); } return lnk; } }; pg.setViewSize(getViewsize()); return pg; }
From source file:jp.xet.uncommons.wicket.gp.StatelessSimplePagingNavigator.java
License:Apache License
@Override protected PagingNavigation newNavigation(String id, IPageable pageable, IPagingLabelProvider labelProvider) { PagingNavigation pn = new PagingNavigation(id, pageable, labelProvider) { @Override/*from w ww . j av a 2 s. c o m*/ protected Link<Void> newPagingNavigationLink(String id, IPageable pageable, final int pageIndex) { PageParameters pp = newPageParameters(); pp.set(pageKeyName, String.valueOf(pageIndex + 1)); BookmarkablePageLink<Void> lnk = new BookmarkablePageLink<Void>(id, clazz, pp) { @Override public boolean isEnabled() { return currentPage != pageIndex; } @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); if (anchor != null && tag.getAttribute("href") != null) { String href = tag.getAttribute("href"); String atag = anchor.contains("#") ? anchor : "#" + anchor; tag.put("href", href + atag); } } }; if (isAnchorSelf()) { lnk.setAnchor(StatelessSimplePagingNavigator.this); } return lnk; } }; pn.setViewSize(getViewsize()); return pn; }
From source file:jp.xet.uncommons.wicket.paging.RequestParameterPagingNavigator.java
License:Apache License
@Override protected PagingNavigation newNavigation(String id, IPageable pageable, IPagingLabelProvider labelProvider) { PagingNavigation pn = new PagingNavigation(id, pageable, labelProvider) { @Override//w w w . ja v a 2s. c o m protected Link<Void> newPagingNavigationLink(String id, final IPageable pageable, final int pageIndex) { PageParameters pp = newPageParameters(); pp.set(pageKeyName, String.valueOf(pageIndex + 1)); BookmarkablePageLink<Void> lnk = new BookmarkablePageLink<Void>(id, clazz, pp) { @Override public boolean isEnabled() { return pageable.getCurrentPage() != pageIndex; } @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); if (anchor != null && tag.getAttribute("href") != null) { String href = tag.getAttribute("href"); String atag = anchor.contains("#") ? anchor : "#" + anchor; tag.put("href", href + atag); } } }; if (isAnchorSelf()) { lnk.setAnchor(RequestParameterPagingNavigator.this); } return lnk; } }; pn.setViewSize(getViewsize()); return pn; }
From source file:org.geoserver.web.wicket.GeoServerPagingNavigator.java
License:Open Source License
@Override protected PagingNavigation newNavigation(IPageable pageable, IPagingLabelProvider labelProvider) { // make sure we don't have too many links, it gets quite busy in popups PagingNavigation navigation = super.newNavigation(pageable, labelProvider); navigation.setViewSize(5); return navigation; }