/** * Fills the webHook name input. * @return */ public ListBoxModel doFillWebHookNameItems() { StandardListBoxModel listBoxModel = new StandardListBoxModel(); for (ReleaseWebHook webHook : ReleaseWebHookHelper.getReleaseWebHookConfigurations()) { listBoxModel.add(webHook.getWebHookName()); } return listBoxModel; } }
listBoxModel.add(releaseDefinition.getName());
/** * Populates a {@link ListBoxModel} with the checkout credentials appropriate for the supplied context against the * supplied API endpoint. * * @param context the context. * @param apiUri the api endpoint. * @return a {@link ListBoxModel}. */ @NonNull public static ListBoxModel listCheckoutCredentials(@CheckForNull Item context, String apiUri) { StandardListBoxModel result = new StandardListBoxModel(); result.includeEmptyValue(); result.add("- same as scan credentials -", GitHubSCMSource.DescriptorImpl.SAME); result.add("- anonymous -", GitHubSCMSource.DescriptorImpl.ANONYMOUS); return result.includeMatchingAs( context instanceof Queue.Task ? Tasks.getDefaultAuthenticationOf((Queue.Task) context) : ACL.SYSTEM, context, StandardUsernameCredentials.class, githubDomainRequirements(apiUri), GitClient.CREDENTIALS_MATCHER ); }
@SuppressWarnings("unused") @Restricted(NoExternalUse.class) public final ListBoxModel doFillBuildStatusPublishModeItems() { StandardListBoxModel result = new StandardListBoxModel(); for (BuildStatusPublishMode mode : BuildStatusPublishMode.values()) { result.add(mode.name()); } return result; } }
listBoxModel.add(project.getName());
public ListBoxModel doFillSshCredentialsIdItems(@AncestorInPath Item owner) { StandardListBoxModel model = new StandardListBoxModel(); model.add(Messages.SSHCredentials_selectCredentials(), Constants.INVALID_OPTION); model.includeAs(ACL.SYSTEM, owner, SSHUserPrivateKey.class); model.includeAs(ACL.SYSTEM, owner, StandardUsernamePasswordCredentials.class); return model; }
@Restricted(NoExternalUse.class) public ListBoxModel doFillCheckoutCredentialsIdItems(@AncestorInPath SCMSourceOwner context, @QueryParameter String connectionName, @QueryParameter String checkoutCredentialsId) { if (context == null && !Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER) || context != null && !context.hasPermission(Item.EXTENDED_READ)) { return new StandardListBoxModel().includeCurrentValue(checkoutCredentialsId); } StandardListBoxModel result = new StandardListBoxModel(); result.add("- anonymous -", CHECKOUT_CREDENTIALS_ANONYMOUS); return result.includeMatchingAs( context instanceof Queue.Task ? Tasks.getDefaultAuthenticationOf((Queue.Task) context) : ACL.SYSTEM, context, StandardUsernameCredentials.class, SettingsUtils.gitLabConnectionRequirements(connectionName), GitClient.CREDENTIALS_MATCHER ); }
/** * Form completion. * * @param context the context. * @param apiUri the server url. * @param credentialsId the current selection. * @return the form items. */ @Restricted(NoExternalUse.class) @SuppressWarnings("unused") // stapler form binding public ListBoxModel doFillCredentialsIdItems(@CheckForNull @AncestorInPath Item context, @QueryParameter String apiUri, @QueryParameter String credentialsId) { if (context == null ? !Jenkins.getActiveInstance().hasPermission(Jenkins.ADMINISTER) : !context.hasPermission(Item.EXTENDED_READ)) { return new StandardListBoxModel().includeCurrentValue(credentialsId); } StandardListBoxModel result = new StandardListBoxModel(); result.add(Messages.SSHCheckoutTrait_useAgentKey(), ""); return result.includeMatchingAs( context instanceof Queue.Task ? Tasks.getDefaultAuthenticationOf((Queue.Task) context) : ACL.SYSTEM, context, StandardUsernameCredentials.class, Connector.githubDomainRequirements(apiUri), CredentialsMatchers.instanceOf(SSHUserPrivateKey.class) ); }
result.add(Messages.SSHCheckoutTrait_useAgentKey(), ""); result.includeMatchingAs( context instanceof Queue.Task ?