/** * Computes the relative path from the current page to the specified domain. * * @param domain the domain * @return the relative path from the current page or {@code null} * @since 2.0 */ @CheckForNull public String getRelativeLinkTo(Domain domain) { String relativeLink = getRelativeLinkToAction(); if (relativeLink == null) { return null; } return relativeLink + domain.getUrl(); }
/** * Computes the relative path from the current page to the specified domain. * * @param domain the domain * @return the relative path from the current page or {@code null} * @since 2.0 */ @CheckForNull public String getRelativeLinkTo(Domain domain) { String relativeLink = getRelativeLinkToAction(); if (relativeLink == null) { return null; } return relativeLink + domain.getUrl(); }
private String url(CredentialsStore store) { for (Domain d: store.getDomains()) { for (Credentials c: store.getCredentials(d)) { if (c instanceof IdCredentials && value.equals(((IdCredentials) c).getId())) { String link = store.getRelativeLinkToAction(); return link == null ? null : link + d.getUrl() + "credential/"+ Util.rawEncode(value); } } } return null; }
private String url(CredentialsStore store) { for (Domain d: store.getDomains()) { for (Credentials c: store.getCredentials(d)) { if (c instanceof IdCredentials && value.equals(((IdCredentials) c).getId())) { String link = store.getRelativeLinkToAction(); return link == null ? null : link + d.getUrl() + "credential/"+ Util.rawEncode(value); } } } return null; }
/** * Creates the children context menu with the supplied prefix to all URLs. * * @param prefix the prefix to prepend to relative urls. * @return the {@link ContextMenu} or {@code null} * @since 2.0 */ @CheckForNull public ContextMenu getChildrenContextMenu(String prefix) { ContextMenu menu = new ContextMenu(); for (Domain d : getStore().getDomains()) { MenuItem item = new MenuItem(d.getUrl(), getMenuItemIconUrlByClassSpec("icon-credentials-domain icon-md"), d.isGlobal() ? Messages.CredentialsStoreAction_GlobalDomainDisplayName() : d.getName() ); item.subMenu = new DomainWrapper(this, d).getContextMenu(ContextMenuIconUtils.buildUrl(prefix, d.getUrl())); menu.add(item); } return menu.items.isEmpty() ? null : menu; }
/** * Creates the children context menu with the supplied prefix to all URLs. * * @param prefix the prefix to prepend to relative urls. * @return the {@link ContextMenu} or {@code null} * @since 2.0 */ @CheckForNull public ContextMenu getChildrenContextMenu(String prefix) { ContextMenu menu = new ContextMenu(); for (Domain d : getStore().getDomains()) { MenuItem item = new MenuItem(d.getUrl(), getMenuItemIconUrlByClassSpec("icon-credentials-domain icon-md"), d.isGlobal() ? Messages.CredentialsStoreAction_GlobalDomainDisplayName() : d.getName() ); item.subMenu = new DomainWrapper(this, d).getContextMenu(ContextMenuIconUtils.buildUrl(prefix, d.getUrl())); menu.add(item); } return menu.items.isEmpty() ? null : menu; }