/** * Construct * * @param <C> * * @see BookmarkablePageLink#BookmarkablePageLink(String, Class, PageParameters) * * @param id * @param pageClass * @param parameters * @param anchor */ public <C extends Page> AutolinkBookmarkablePageLink(final String id, final Class<C> pageClass, final PageParameters parameters, final String anchor) { super(id, pageClass, parameters); this.anchor = anchor; setAutoEnable(autoEnable); add(new DisabledAttributeLinkBehavior()); }
/** * Constructor. * * @param id * See Component * @param pageable * The pageable component for this page link * @param pageNumber * The page number in the PageableListView that this link links to. Negative * pageNumbers are relative to the end of the list. */ public PagingNavigationLink(final String id, final IPageable pageable, final long pageNumber) { super(id); setAutoEnable(true); this.pageNumber = pageNumber; this.pageable = pageable; add(new DisabledAttributeLinkBehavior()); }
/** * Constructor. * * @param id * See Component * @param pageable * The pageable component the page links are referring to * @param increment * increment by */ public PagingNavigationIncrementLink(final String id, final IPageable pageable, final int increment) { super(id); setAutoEnable(true); this.increment = increment; this.pageable = pageable; add(new DisabledAttributeLinkBehavior()); }
/** * Constructor. * * @param id * See Component * @param pageable * The pageable component the page links are referring to * @param increment * increment by */ public PagingNavigationIncrementLink(final String id, final IPageable pageable, final int increment) { super(id); setAutoEnable(true); this.increment = increment; this.pageable = pageable; add(new DisabledAttributeLinkBehavior()); }
/** * Constructor. * * @param id * See Component * @param pageable * The pageable component for this page link * @param pageNumber * The page number in the PageableListView that this link links to. Negative * pageNumbers are relative to the end of the list. */ public PagingNavigationLink(final String id, final IPageable pageable, final long pageNumber) { super(id); setAutoEnable(true); this.pageNumber = pageNumber; this.pageable = pageable; add(new DisabledAttributeLinkBehavior()); }
/** * Construct * * @param <C> * * @see BookmarkablePageLink#BookmarkablePageLink(String, Class, PageParameters) * * @param id * @param pageClass * @param parameters * @param anchor */ public <C extends Page> AutolinkBookmarkablePageLink(final String id, final Class<C> pageClass, final PageParameters parameters, final String anchor) { super(id, pageClass, parameters); this.anchor = anchor; setAutoEnable(autoEnable); add(new DisabledAttributeLinkBehavior()); }
@Override protected AbstractLink newPagingNavigationIncrementLink(String id, IPageable pageable, int increment) { AbstractLink link; if (pagingHistorySupport != null) { int pageNumber = (int) pageable.getCurrentPage() + increment; link = new BookmarkablePageLink<Void>(id, getPage().getClass(), pagingHistorySupport.newPageParameters(pageNumber)) { @Override protected void onConfigure() { super.onConfigure(); setEnabled(pageNumber >= 0 && pageNumber < getPageable().getPageCount()); } }; link.add(new DisabledAttributeLinkBehavior()); } else { link = new PagingNavigationIncrementLink<Void>(id, pageable, increment); } return link; }
@Override protected AbstractLink newPagingNavigationLink(String id, IPageable pageable, int pageNumber) { AbstractLink link; int absolutePageNumber; if (pageNumber == -1) absolutePageNumber = (int) (getPageable().getPageCount()-1); else absolutePageNumber = pageNumber; if (pagingHistorySupport != null) { link = new BookmarkablePageLink<Void>(id, getPage().getClass(), pagingHistorySupport.newPageParameters(absolutePageNumber)) { @Override protected void onConfigure() { super.onConfigure(); setEnabled(absolutePageNumber != pageable.getCurrentPage()); } }; link.add(new DisabledAttributeLinkBehavior()); } else { link = new PagingNavigationLink<Void>(id, pageable, pageNumber); } return link; }
prevMatchLink.add(new DisabledAttributeLinkBehavior()); prevMatchLink.setOutputMarkupId(true); nextMatchLink.add(new DisabledAttributeLinkBehavior()); nextMatchLink.setOutputMarkupId(true);