/** * Get the url for the given path (without image path). Later, the path of the images is changeable. * * @param requestCycle Needed to encode url. * @param subpath * @return */ public static String getImageUrl(final RequestCycle requestCycle, final String path) { return getUrl(requestCycle, path, true); }
/** * @see WicketUtils#getUrl(org.apache.wicket.Response, String, boolean) */ public String getUrl(final String path, final boolean encodeUrl) { return WicketUtils.getUrl(getRequestCycle(), path, encodeUrl); }
/** * @see WicketUtils#getUrl(org.apache.wicket.Response, String, boolean) */ public String getUrl(final String path, final boolean encodeUrl) { return WicketUtils.getUrl(getRequestCycle(), path, encodeUrl); }
/** * Adds BookmarkablePageLink with given id to the given parentContainer. * * @param id id of the link (shouldn't bee "newsLink" in body, because it's already used by DocumentationPage). * @param parentContainer Page (normally body) */ public static final AbstractLink addNewsLink(final WebMarkupContainer parentContainer, final String id) { final AbstractLink link = new ExternalLink(id, WicketUtils.getUrl(parentContainer.getRequestCycle(), "secure/doc/News.html", true)); parentContainer.add(link); return link; }
/** * Appends attribute onclick and changes the cursor to pointer. onclick results in location.href. * * @param location url to go on click. * @param newWindow If true then a new browser with the given url is opened. * @return */ public IconPanel setOnClickLocation(final RequestCycle requestCycle, final String location, final boolean newWindow) { appendAttribute("style", "cursor: pointer;"); final String url = WicketUtils.getUrl(requestCycle, location, false); if (newWindow == true) { appendAttribute("onclick", "window.open('" + url + "'); return false;"); } else { appendAttribute("onclick", "location.href='" + url + "';"); } return this; }
private static void addDocLink(final WebMarkupContainer parentContainer, final String id, final String url) { final WebMarkupContainer linkContainer = new WebMarkupContainer(id); String surl = url; if (surl.startsWith("http") == false) { surl = WicketUtils.getUrl(parentContainer.getRequestCycle(), "secure/" + url, true); } linkContainer.add(AttributeModifier.replace("onclick", "javascript:openDoc('" + surl + "');")); linkContainer.add(AttributeModifier.replace("onmouseover", "style.cursor='pointer'")); parentContainer.add(linkContainer); }
final String url = menuEntry.getUrl(); if (url != null) { link = new ExternalLink("link", WicketUtils.getUrl(RequestCycle.get(), url, true)); } else { link = new ExternalLink("link", "#");