@Override public Class<? extends Page> getPageIdentity() { return oldLink.getPageClass(); } }
/** * Whether this link refers to the given page. * * @param page * the page * @see org.apache.wicket.markup.html.link.Link#linksTo(org.apache.wicket.Page) */ @Override public boolean linksTo(final Page page) { return page.getClass() == getPageClass(); }
/** * Whether this link refers to the given page. * * @param page * the page * @see org.apache.wicket.markup.html.link.Link#linksTo(org.apache.wicket.Page) */ @Override public boolean linksTo(final Page page) { return page.getClass() == getPageClass(); }
/** * Whether this link refers to the given page. * * @param page * the page * @see org.apache.wicket.markup.html.link.Link#linksTo(org.apache.wicket.Page) */ @Override public boolean linksTo(final Page page) { return page.getClass() == getPageClass(); }
/** * Whether this link refers to the given page. * * @param page * the page * @see org.apache.wicket.markup.html.link.Link#linksTo(org.apache.wicket.Page) */ public boolean linksTo(final Page page) { return page.getClass() == getPageClass(); }
/** * Gets the url to use for this link. * * @return The URL that this link links to * @see org.apache.wicket.markup.html.link.Link#getURL() */ @Override protected CharSequence getURL() { PageParameters parameters = getPageParameters(); return urlFor(getPageClass(), parameters); } }
/** * Gets the url to use for this link. * * @return The URL that this link links to * @see org.apache.wicket.markup.html.link.Link#getURL() */ @Override protected CharSequence getURL() { PageParameters parameters = getPageParameters(); return urlFor(getPageClass(), parameters); } }
/** * Asserts that that the BookmarkablePageLink identified by "id" points to the page as expected * - including parameters. * * @param id * @param pageClass * @param parameters */ public void assertBookmarkablePageLink(final String id, final Class<? extends WebPage> pageClass, final String parameters) { BookmarkablePageLink<?> pageLink = null; try { pageLink = (BookmarkablePageLink<?>)getComponentFromLastRenderedPage(id); } catch (ClassCastException e) { throw new IllegalArgumentException("Component with id:" + id + " is not a BookmarkablePageLink"); } Assert.assertEquals("BookmarkablePageLink: " + id + " is pointing to the wrong page", pageClass, pageLink.getPageClass()); Assert.assertEquals( "One or more of the parameters associated with the BookmarkablePageLink: " + id + " do not match", new PageParameters(parameters), pageLink.getPageParameters()); }
@Override public boolean isActive(Component item) { final Class<? extends Page> pageClass = item.getPage().getPageClass(); for (AbstractLink link : buttonListView.getList()) { if (link instanceof Activatable) { return ((Activatable) link).isActive(item); } else if (link instanceof BookmarkablePageLink) { if (((BookmarkablePageLink) link).getPageClass().equals(pageClass)) { return true; } } } return false; }
/** * checks whether there is a button that is active or not * * @param activeButton the current active button * @return true, if at least one button of button list is active */ public final boolean hasActiveButton(final Component activeButton) { final Class<? extends Page> pageClass = activeButton.getPage().getPageClass(); for (final AbstractLink link : getList()) { if (link instanceof Activatable) { if (((Activatable) link).isActive(activeButton)) { return true; } } else if (link instanceof BookmarkablePageLink) { if (((BookmarkablePageLink<?>) link).getPageClass().equals(pageClass)) { return true; } } } return false; }
/** * Asserts that that the BookmarkablePageLink<?> identified by "id" points to the page as * expected - including parameters. * * @param id * @param pageClass * @param parameters */ public void assertBookmarkablePageLink(final String id, final Class<? extends WebPage> pageClass, final PageParameters parameters) { BookmarkablePageLink<?> pageLink; try { pageLink = (BookmarkablePageLink<?>)getComponentFromLastRenderedPage(id); } catch (ClassCastException e) { throw new IllegalArgumentException("Component with id:" + id + " is not a BookmarkablePageLink"); } assertEquals("BookmarkablePageLink: " + id + " is pointing to the wrong page", pageClass, pageLink.getPageClass()); assertEquals("One or more of the parameters associated with the BookmarkablePageLink: " + id + " do not match", parameters, pageLink.getPageParameters()); }
/** * Asserts that that the BookmarkablePageLink<?> identified by "id" points to the page as * expected - including parameters. * * @param id * @param pageClass * @param parameters */ public void assertBookmarkablePageLink(final String id, final Class<? extends WebPage> pageClass, final PageParameters parameters) { BookmarkablePageLink<?> pageLink; try { pageLink = (BookmarkablePageLink<?>)getComponentFromLastRenderedPage(id); } catch (ClassCastException e) { throw new IllegalArgumentException( "Component with id:" + id + " is not a BookmarkablePageLink"); } assertEquals(pageClass, pageLink.getPageClass(), "BookmarkablePageLink: " + id + " is pointing to the wrong page"); assertEquals(parameters, pageLink.getPageParameters(), "One or more of the parameters associated with the BookmarkablePageLink: " + id + " do not match"); }
/** * Gets the url to use for this link. * * @return The URL that this link links to * @see org.apache.wicket.markup.html.link.Link#getURL() */ protected CharSequence getURL() { if (pageMapName != null && getPopupSettings() != null) { throw new IllegalStateException("You cannot specify popup settings and a page map"); } PageParameters parameters = getPageParameters(); if (getPopupSettings() != null) { return urlFor(getPopupSettings().getPageMap(this), getPageClass(), parameters); } else { return urlFor(getPageMap(), getPageClass(), parameters); } } }
return urlFor(new BookmarkablePageRequestTarget(pageMapName, getPageClass(), parameters)); return urlFor(getPageMap(), getPageClass(), parameters);
if (component instanceof BookmarkablePageLink) final Class<? extends Page> clazz = ((BookmarkablePageLink<?>)component).getPageClass(); parameters.put(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME, pageMapName + ':' + clazz.getName());
if (component instanceof BookmarkablePageLink) final Class clazz = ((BookmarkablePageLink)component).getPageClass(); parameters.put(WebRequestCodingStrategy.BOOKMARKABLE_PAGE_PARAMETER_NAME, pageMapName + ':' + clazz.getName());
bookmarkablePageLink, (Object[])null); startPage(bookmarkablePageLink.getPageClass(), parameters);
.invoke(bookmarkablePageLink, (Object[])null); startPage(bookmarkablePageLink.getPageClass(), parameters);