Java Code Examples for hudson.util.ListBoxModel#add()

The following examples show how to use hudson.util.ListBoxModel#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnsiblePlaybookStep.java    From ansible-plugin with Apache License 2.0 5 votes vote down vote up
public ListBoxModel doFillInstallationItems() {
    ListBoxModel model = new ListBoxModel();
    for (AnsibleInstallation tool : AnsibleInstallation.allInstallations()) {
        model.add(tool.getName());
    }
    return model;
}
 
Example 2
Source File: GitLabSCMSource.java    From gitlab-branch-source-plugin with GNU General Public License v2.0 5 votes vote down vote up
@Restricted(NoExternalUse.class)
public ListBoxModel doFillProjectPathItems(@QueryParameter @RelativePath("sourceSettings") String connectionName) throws GitLabAPIException {
    ListBoxModel items = new ListBoxModel();
    // TODO: respect settings in nearest GitLabSCMNavigator
    for (GitLabProject project : gitLabAPI(connectionName).findProjects(VISIBLE, ALL, "")) {
        items.add(project.getPathWithNamespace());
    }
    return items;
}
 
Example 3
Source File: CodeBuilder.java    From aws-codebuild-jenkins-plugin with Apache License 2.0 5 votes vote down vote up
public ListBoxModel doFillArtifactEncryptionDisabledOverrideItems() {
    final ListBoxModel selections = new ListBoxModel();

    for(BooleanValue t: BooleanValue.values()) {
        selections.add(t.toString());
    }

    return selections;
}
 
Example 4
Source File: DockerBuilderControlOption.java    From docker-plugin with MIT License 5 votes vote down vote up
public ListBoxModel doFillCloudNameItems() {
    ListBoxModel model = new ListBoxModel();
    model.add("Cloud this build is running on", "");
    for (Cloud cloud : DockerCloud.instances()) {
        model.add(cloud.name);
    }
    return model;
}
 
Example 5
Source File: ECSTaskTemplateStep.java    From amazon-ecs-plugin with MIT License 5 votes vote down vote up
public ListBoxModel doFillNetworkModeItems() {
    final ListBoxModel options = new ListBoxModel();
    for (NetworkMode networkMode : NetworkMode.values()) {
        options.add(networkMode.toString());
    }
    return options;
}
 
Example 6
Source File: GitHubSCMSource.java    From github-branch-source-plugin with MIT License 5 votes vote down vote up
public ListBoxModel doFillApiUriItems() {
    ListBoxModel result = new ListBoxModel();
    result.add("GitHub", "");
    for (Endpoint e : GitHubConfiguration.get().getEndpoints()) {
        result.add(e.getName() == null ? e.getApiUri() : e.getName() + " (" + e.getApiUri() + ")",
                e.getApiUri());
    }
    return result;
}
 
Example 7
Source File: SignArtifactPlugin.java    From jenkins-android-signing with Apache License 2.0 5 votes vote down vote up
public ListBoxModel doFillKeystoreItems() {
    ListBoxModel items = new ListBoxModel();
    for (KeystoreCredentials gpgKey : CredentialsProvider.lookupCredentials(KeystoreCredentials.class, Jenkins.getInstance(), ACL.SYSTEM)) {
        items.add(gpgKey.getDescription(), gpgKey.getId());
    }
    return items;
}
 
Example 8
Source File: GitHubConfiguration.java    From github-branch-source-plugin with MIT License 5 votes vote down vote up
public ListBoxModel doFillApiRateLimitCheckerItems() {
    ListBoxModel items = new ListBoxModel();
    for (ApiRateLimitChecker mode : ApiRateLimitChecker.values()) {
        items.add(mode.getDisplayName(), mode.name());
    }
    return items;
}
 
Example 9
Source File: CodeBuilder.java    From aws-codebuild-jenkins-plugin with Apache License 2.0 5 votes vote down vote up
public ListBoxModel doFillComputeTypeOverrideItems() {
    final ListBoxModel selections = new ListBoxModel();

    for (ComputeType t : ComputeType.values()) {
        selections.add(t.toString());
    }
    selections.add("");
    return selections;
}
 
Example 10
Source File: OriginPullRequestDiscoveryTrait.java    From github-branch-source-plugin with MIT License 5 votes vote down vote up
/**
 * Populates the strategy options.
 *
 * @return the strategy options.
 */
@NonNull
@Restricted(NoExternalUse.class)
@SuppressWarnings("unused") // stapler
public ListBoxModel doFillStrategyIdItems() {
    ListBoxModel result = new ListBoxModel();
    result.add(Messages.ForkPullRequestDiscoveryTrait_mergeOnly(), "1");
    result.add(Messages.ForkPullRequestDiscoveryTrait_headOnly(), "2");
    result.add(Messages.ForkPullRequestDiscoveryTrait_headAndMerge(), "3");
    return result;
}
 
Example 11
Source File: JiraSendDeploymentInfoStep.java    From atlassian-jira-software-cloud-plugin with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unused")
public ListBoxModel doFillSiteItems() {
    ListBoxModel items = new ListBoxModel();
    final List<JiraCloudSiteConfig> siteList = globalConfig.getSites();
    for (JiraCloudSiteConfig siteConfig : siteList) {
        items.add(siteConfig.getSite(), siteConfig.getSite());
    }

    return items;
}
 
Example 12
Source File: GitLabSCMNavigator.java    From gitlab-branch-source-plugin with GNU General Public License v2.0 5 votes vote down vote up
@Restricted(NoExternalUse.class)
public ListBoxModel doFillProjectSelectorIdItems() {
    ListBoxModel items = new ListBoxModel();
    for (String id : GitLabProjectSelector.ids()) {
        items.add(id, id);
    }
    return items;
}
 
Example 13
Source File: CodeBuildStep.java    From aws-codebuild-jenkins-plugin with Apache License 2.0 5 votes vote down vote up
public ListBoxModel doFillCacheTypeOverrideItems() {
    final ListBoxModel selections = new ListBoxModel();

    for (CacheType t : CacheType.values()) {
        selections.add(t.toString());
    }
    selections.add("");
    return selections;
}
 
Example 14
Source File: ECSTaskTemplate.java    From amazon-ecs-plugin with MIT License 5 votes vote down vote up
public ListBoxModel doFillLaunchTypeItems() {
    final ListBoxModel options = new ListBoxModel();
    for (LaunchType launchType: LaunchType.values()) {
        options.add(launchType.toString());
    }
    return options;
}
 
Example 15
Source File: ProjectNamingStrategyTrait.java    From gitlab-branch-source-plugin with MIT License 5 votes vote down vote up
/**
 * Populates the strategy options.
 *
 * @return the stategy options.
 */
@NonNull
@Restricted(NoExternalUse.class)
@SuppressWarnings("unused") // stapler
public ListBoxModel doFillStrategyIdItems() {
    ListBoxModel result = new ListBoxModel();
    result.add(Messages.ProjectNamingStrategyTrait_fullProjectPath(), "1");
    result.add(Messages.ProjectNamingStrategyTrait_projectName(), "2");
    return result;
}
 
Example 16
Source File: CodeBuilder.java    From aws-codebuild-jenkins-plugin with Apache License 2.0 5 votes vote down vote up
public ListBoxModel doFillCacheTypeOverrideItems() {
    final ListBoxModel selections = new ListBoxModel();

    for (CacheType t : CacheType.values()) {
        selections.add(t.toString());
    }
    selections.add("");
    return selections;
}
 
Example 17
Source File: CodeBuildStep.java    From aws-codebuild-jenkins-plugin with Apache License 2.0 5 votes vote down vote up
public ListBoxModel doFillGitCloneDepthOverrideItems() {
    final ListBoxModel selections = new ListBoxModel();

    for(GitCloneDepth t: GitCloneDepth.values()) {
        selections.add(t.toString());
    }

    return selections;
}
 
Example 18
Source File: JiraSendBuildInfoStep.java    From atlassian-jira-software-cloud-plugin with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unused")
public ListBoxModel doFillSiteItems() {
    ListBoxModel items = new ListBoxModel();
    final List<JiraCloudSiteConfig> siteList = globalConfig.getSites();
    for (JiraCloudSiteConfig siteConfig : siteList) {
        items.add(siteConfig.getSite(), siteConfig.getSite());
    }

    return items;
}
 
Example 19
Source File: OpenShiftDeleterLabels.java    From jenkins-plugin with Apache License 2.0 5 votes vote down vote up
public ListBoxModel doFillInputTypeItems(@AncestorInPath Item item,
        @QueryParameter String key, @QueryParameter String type) {
    ListBoxModel ret = new ListBoxModel();
    ret.add("Json contents", "json");
    ret.add("API Object type : API Object key", "kv");
    ret.add("Label", "label");
    return ret;
}
 
Example 20
Source File: VaultConfiguration.java    From hashicorp-vault-plugin with MIT License 5 votes vote down vote up
@Restricted(NoExternalUse.class)
public static ListBoxModel engineVersions(Item context) {
    ListBoxModel options = new ListBoxModel(
        new Option("2", "2"),
        new Option("1", "1")
    );
    if (context != null) {
        Option option = new Option("Default", "");
        options.add(0, option);
    }
    return options;
}