/** * Exposes the {@link #getActions()} for Stapler. * * @param token the name of the action. * @return the {@link Action} or {@code null} * @since 2.0 */ @CheckForNull @SuppressWarnings("unused") // stapler binding public Object getDynamic(String token) { for (Action a : getActions()) { String url = a.getUrlName(); if (url == null) { continue; } if (url.equals(token)) { return a; } } return null; }
/** * Exposes the {@link #getActions()} for Stapler. * * @param token the name of the action. * @return the {@link Action} or {@code null} * @since 2.0 */ @CheckForNull @SuppressWarnings("unused") // stapler binding public Object getDynamic(String token) { for (Action a : getActions()) { String url = a.getUrlName(); if (url == null) { continue; } if (url.equals(token)) { return a; } } return null; }
/** * Creates the 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 getContextMenu(String prefix) { ContextMenu menu = new ContextMenu(); if (getStore().isDomainsModifiable() && getStore().hasPermission(MANAGE_DOMAINS)) { menu.add(ContextMenuIconUtils.buildUrl(prefix, "newDomain"), getMenuItemIconUrlByClassSpec("icon-credentials-new-domain icon-md"), Messages.CredentialsStoreAction_AddDomainAction() ); } for (Action action : getActions()) { ContextMenuIconUtils.addMenuItem(menu, prefix, action); } return menu.items.isEmpty() ? null : menu; }
/** * Creates the 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 getContextMenu(String prefix) { ContextMenu menu = new ContextMenu(); if (getStore().isDomainsModifiable() && getStore().hasPermission(MANAGE_DOMAINS)) { menu.add(ContextMenuIconUtils.buildUrl(prefix, "newDomain"), getMenuItemIconUrlByClassSpec("icon-credentials-new-domain icon-md"), Messages.CredentialsStoreAction_AddDomainAction() ); } for (Action action : getActions()) { ContextMenuIconUtils.addMenuItem(menu, prefix, action); } return menu.items.isEmpty() ? null : menu; }