/** * Returns the full display name of the {@link #getContext()}. * * @return the full display name of the {@link #getContext()}. */ public String getContextFullDisplayName() { String n; if (context instanceof Item) { n = ((Item) context).getFullDisplayName(); } else if (context instanceof Jenkins) { n = context.getDisplayName(); } else if (context instanceof ItemGroup) { n = ((ItemGroup) context).getFullDisplayName(); } else if (context instanceof User) { n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName()); } else { // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline n = Jenkins.getActiveInstance().getFullDisplayName(); } return n; }
/** * Returns the full display name of the {@link #getContext()}. * * @return the full display name of the {@link #getContext()}. */ public String getContextFullDisplayName() { String n; if (context instanceof Item) { n = ((Item) context).getFullDisplayName(); } else if (context instanceof Jenkins) { n = context.getDisplayName(); } else if (context instanceof ItemGroup) { n = ((ItemGroup) context).getFullDisplayName(); } else if (context instanceof User) { n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName()); } else { // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline n = Jenkins.getActiveInstance().getFullDisplayName(); } return n; }
/** * Returns the {@link Item#getFullDisplayName()} or nearest approximation. * * @return the {@link Item#getFullDisplayName()} or nearest approximation. */ public final String getFullDisplayName() { String n; ModelObject context = getStore().getContext(); if (context instanceof Item) { n = ((Item) context).getFullDisplayName(); } else if (context instanceof ItemGroup) { n = ((ItemGroup) context).getFullDisplayName(); } else if (context instanceof User) { n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName()); } else { // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline n = Jenkins.getActiveInstance().getFullDisplayName(); } if (n.length() == 0) { return getDisplayName(); } else { return n + " \u00BB " + getDisplayName(); } }
/** * Returns the {@link Item#getFullDisplayName()} or nearest approximation. * * @return the {@link Item#getFullDisplayName()} or nearest approximation. */ public final String getFullDisplayName() { String n; ModelObject context = getStore().getContext(); if (context instanceof Item) { n = ((Item) context).getFullDisplayName(); } else if (context instanceof ItemGroup) { n = ((ItemGroup) context).getFullDisplayName(); } else if (context instanceof User) { n = Messages.CredentialsStoreAction_UserDisplayName(((User) context).getDisplayName()); } else { // TODO switch to Jenkins.getInstance() once 2.0+ is the baseline n = Jenkins.getActiveInstance().getFullDisplayName(); } if (n.length() == 0) { return getDisplayName(); } else { return n + " \u00BB " + getDisplayName(); } }