当前位置: 首页>>代码示例>>Java>>正文


Java ListBoxModel.Option方法代码示例

本文整理汇总了Java中hudson.util.ListBoxModel.Option方法的典型用法代码示例。如果您正苦于以下问题:Java ListBoxModel.Option方法的具体用法?Java ListBoxModel.Option怎么用?Java ListBoxModel.Option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hudson.util.ListBoxModel的用法示例。


在下文中一共展示了ListBoxModel.Option方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doFillImageItems_shouldFillWithDockerImages

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
@Test
public void doFillImageItems_shouldFillWithDockerImages() {
    TestgridBuildWrapper.DescriptorImpl descriptor = jenkins.getInstance().getDescriptorByType(TestgridBuildWrapper.DescriptorImpl.class);
    List<DockerImageSettings> images = new ArrayList<DockerImageSettings>();
    images.add(new DockerImageSettings("ff","ffimage"));
    images.add(new DockerImageSettings("chrome","chromeimage"));
    
    descriptor.setDockerImages(images);

    ListBoxModel model = new BrowserInstance("").getDescriptor().doFillImageItems();
    assertEquals(images.size(),model.size());
    for (int i = 0; i < model.size(); i++) {
        DockerImageSettings image = images.get(i);
        ListBoxModel.Option o = model.get(i);
        assertEquals(image.getName(), o.name);
        assertEquals(image.getImageName(),o.value);
    }
}
 
开发者ID:DevOnGlobal,项目名称:testgrid-plugin,代码行数:19,代码来源:BrowserInstanceTest.java

示例2: testListBoxEmpty

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
@Test
public void testListBoxEmpty() throws Exception {
  ListBoxModel list = GoogleRobotCredentials.getCredentialsListBox(
      FakeGoogleCredentials.class);

  assertEquals(0, list.size());

  FakeGoogleCredentials credentials = new FakeGoogleCredentials(PROJECT_ID,
      fakeCredential);
  SystemCredentialsProvider.getInstance().getCredentials().add(credentials);

  list = GoogleRobotCredentials.getCredentialsListBox(
      FakeGoogleCredentials.class);

  assertEquals(1, list.size());
  for (ListBoxModel.Option option : list) {
    assertEquals(NAME, option.name);
    assertEquals(credentials.getId(), option.value);
  }
}
 
开发者ID:jenkinsci,项目名称:google-oauth-plugin,代码行数:21,代码来源:GoogleRobotCredentialsTest.java

示例3: doFillAuthenticationItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
/**
 * Fills the items for authentication for global configuration.
 * @return
 */
@SuppressWarnings("UnusedDeclaration")
public ListBoxModel doFillAuthenticationItems(){
    ListBoxModel authModel = new ListBoxModel(
            new ListBoxModel.Option("Username / Password", Authentication.plain.name()),
            new ListBoxModel.Option("OpenSSL", Authentication.openSSL.name()),
            new ListBoxModel.Option("Kerberos (TBD)", Authentication.kerberos.name())
    );


    if (authentication == null) {
        authModel.get(0).selected = true;
        return authModel;
    }

    for (ListBoxModel.Option option : authModel) {
        if (option.value.equals(Authentication.plain.name()))
            option.selected = authentication.equals(Authentication.plain.name());
        else if (option.value.equals(Authentication.openSSL.name()))
            option.selected = authentication.equals(Authentication.openSSL.name());
        else if (option.value.equals(Authentication.kerberos.name()))
            option.selected = authentication.equals(Authentication.kerberos.name());
    }

    return authModel;
}
 
开发者ID:vtunka,项目名称:jenkins-koji-plugin,代码行数:30,代码来源:KojiBuilder.java

示例4: doFillApiTokenIdItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
public ListBoxModel doFillApiTokenIdItems(@QueryParameter String name, @QueryParameter String url) {
    if (Jenkins.getInstance().hasPermission(Item.CONFIGURE)) {
        AbstractIdCredentialsListBoxModel<StandardListBoxModel, StandardCredentials> options = new StandardListBoxModel()
            .includeEmptyValue()
            .includeMatchingAs(ACL.SYSTEM,
                               Jenkins.getActiveInstance(),
                               StandardCredentials.class,
                               URIRequirementBuilder.fromUri(url).build(),
                               new GitLabCredentialMatcher());
        if (name != null && connectionMap.containsKey(name)) {
            String apiTokenId = connectionMap.get(name).getApiTokenId();
            options.includeCurrentValue(apiTokenId);
            for (ListBoxModel.Option option : options) {
                if (option.value.equals(apiTokenId)) {
                    option.selected = true;
                }
            }
        }
        return options;
    }
    return new StandardListBoxModel();
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:23,代码来源:GitLabConnectionConfig.java

示例5: doCheckCredentialsId

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
public FormValidation doCheckCredentialsId(
    @AncestorInPath Item context, @QueryParameter String remote, @QueryParameter String value) {
  if (context == null && !Jenkins.getActiveInstance().hasPermission(Jenkins.ADMINISTER)
      || context != null && !context.hasPermission(Item.EXTENDED_READ)) {
    return FormValidation.ok();
  }

  value = Util.fixEmptyAndTrim(value);
  if (value == null) {
    return FormValidation.ok();
  }

  remote = Util.fixEmptyAndTrim(remote);
  if (remote == null)
  // not set, can't check
  {
    return FormValidation.ok();
  }

  for (ListBoxModel.Option o :
      CredentialsProvider.listCredentials(
          StandardUsernameCredentials.class,
          context,
          context instanceof Queue.Task
              ? Tasks.getAuthenticationOf((Queue.Task) context)
              : ACL.SYSTEM,
          URIRequirementBuilder.fromUri(remote).build(),
          GitClient.CREDENTIALS_MATCHER)) {
    if (StringUtils.equals(value, o.value)) {
      // TODO check if this type of credential is acceptable to the Git client or does it merit warning
      // NOTE: we would need to actually lookup the credential to do the check, which may require
      // fetching the actual credential instance from a remote credentials store. Perhaps this is
      // not required
      return FormValidation.ok();
    }
  }
  // no credentials available, can't check
  return FormValidation.warning("Cannot find any credentials with id " + value);
}
 
开发者ID:GerritForge,项目名称:gerrit-plugin,代码行数:40,代码来源:GerritSCMSource.java

示例6: doFillNameItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
public ListBoxModel doFillNameItems(@QueryParameter @RelativePath("..") final String serverUrl,
                                    @QueryParameter @RelativePath("..") final String userName,
                                    @QueryParameter @RelativePath("..") final String password,
                                    @QueryParameter @RelativePath("..") final String tenant,
                                    @QueryParameter @RelativePath("..") final String workflowName,
                                    @QueryParameter final String name)
        throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, IOException,
        URISyntaxException {

    BuildParam listWorkflowBuildParam = new BuildParam(serverUrl, userName, password, tenant, null);
    OrchestratorClient listWfClient = new OrchestratorClient(listWorkflowBuildParam);
    List<Workflow> workflows = listWfClient.fetchWorkflows();
    String workflowId = null;
    for (Workflow workflow : workflows) {
        if (workflow.getName().equals(workflowName)) {
            workflowId = workflow.getId();
            break;
        }
    }

    BuildParam buildParam = new BuildParam(serverUrl, userName, password, tenant, workflowId);
    OrchestratorClient client = new OrchestratorClient(buildParam);
    List<Parameter> parameters = client.fetchWorkflowInputParameters();
    List<ListBoxModel.Option> options = new ArrayList<ListBoxModel.Option>(parameters.size());
    for (Parameter parameter : parameters) {
        String paramDisplayName = String.format("%[email protected]%s", parameter.getName(), parameter.getType());
        options.add(new ListBoxModel.Option(paramDisplayName, paramDisplayName,
                paramDisplayName.matches(name)));
    }
    ListBoxModel listBoxModel = new ListBoxModel(options);
    return listBoxModel;
}
 
开发者ID:agovindaraju,项目名称:vmware-vrealize-orchestrator,代码行数:33,代码来源:Parameter.java

示例7: doFillIncreaseVersionOptionItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
public ListBoxModel doFillIncreaseVersionOptionItems() {
    return new ListBoxModel(
            new ListBoxModel.Option("Major", String.valueOf(VersionUtils.increaseVersionOptions.MAJOR), false),
            new ListBoxModel.Option("Minor", String.valueOf(VersionUtils.increaseVersionOptions.MINOR), false),
            new ListBoxModel.Option("Patch", String.valueOf(VersionUtils.increaseVersionOptions.PACTH), false),
            new ListBoxModel.Option("Build", String.valueOf(VersionUtils.increaseVersionOptions.BUILD), true)

    );
}
 
开发者ID:foundation-runtime,项目名称:jenkins-openstack-deployment-plugin,代码行数:10,代码来源:ProductBuilder.java

示例8: doFillGitHubAuthIdItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
@SuppressWarnings("UnusedDeclaration")
public ListBoxModel doFillGitHubAuthIdItems(@QueryParameter("gitHubAuthId") String gitHubAuthId) {
    ListBoxModel model = new ListBoxModel();
    for (GhprcGitHubAuth auth : getGithubAuth()) {
        String description = Util.fixNull(auth.getDescription());
        int length = description.length();
        length = length > 50 ? 50 : length;
        ListBoxModel.Option next = new ListBoxModel.Option(auth.getServerAPIUrl() + " : " + description.substring(0, length), auth.getId());
        if (!StringUtils.isEmpty(gitHubAuthId) && gitHubAuthId.equals(auth.getId())) {
            next.selected = true;
        }
        model.add(next);
    }
    return model;
}
 
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:16,代码来源:GhprcTrigger.java

示例9: doFillProjectNameItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
/**
 * Populate the project drop-down from the AWS Device Farm API or local cache.
 *
 * @return The ListBoxModel for the UI.
 */
@SuppressWarnings("unused")
public ListBoxModel doFillProjectNameItems(@QueryParameter String currentProjectName) {
    // Create ListBoxModel from all projects for this AWS Device Farm account.
    List<ListBoxModel.Option> entries = new ArrayList<ListBoxModel.Option>();
    System.out.print("getting projects");
    List<String> projectNames = getAWSDeviceFarmProjects();
    System.out.print(String.format("project length = %d", projectNames.size()));
    for (String projectName : projectNames) {
        // We don't ignore case because these *should* be unique.
        entries.add(new ListBoxModel.Option(projectName, projectName, projectName.equals(currentProjectName)));
    }
    return new ListBoxModel(entries);
}
 
开发者ID:awslabs,项目名称:aws-device-farm-jenkins-plugin,代码行数:19,代码来源:AWSDeviceFarmRecorder.java

示例10: doFillDevicePoolNameItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
/**
 * Populate the device pool drop-down from AWS Device Farm API or local cache.
 * based on the selected project.
 *
 * @param projectName           Name of the project selected.
 * @param currentDevicePoolName Name of the device pool selected.
 * @return The ListBoxModel for the UI.
 */
@SuppressWarnings("unused")
public ListBoxModel doFillDevicePoolNameItems(@QueryParameter String projectName, @QueryParameter String currentDevicePoolName) {
    List<ListBoxModel.Option> entries = new ArrayList<ListBoxModel.Option>();
    List<String> devicePoolNames = getAWSDeviceFarmDevicePools(projectName);
    if (devicePoolNames == null) {
        return new ListBoxModel();
    }
    for (String devicePoolName : devicePoolNames) {
        // We don't ignore case because these *should* be unique.
        entries.add(new ListBoxModel.Option(devicePoolName, devicePoolName, devicePoolName.equals(currentDevicePoolName)));
    }
    return new ListBoxModel(entries);
}
 
开发者ID:awslabs,项目名称:aws-device-farm-jenkins-plugin,代码行数:22,代码来源:AWSDeviceFarmRecorder.java

示例11: doFillAppiumVersionJunitItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
/**
 * Populate the project drop-down Appium Version.
 *
 * @return The ListBoxModel for the UI.
 */
@SuppressWarnings("unused")
public ListBoxModel doFillAppiumVersionJunitItems(@QueryParameter String currentAppiumVersion) {
    List<ListBoxModel.Option> entries = new ArrayList<ListBoxModel.Option>();
    ArrayList<String> appiumVersions = new ArrayList<String>();
    appiumVersions.add(APPIUM_VERSION_1_6_3);
    appiumVersions.add(APPIUM_VERSION_1_6_5);
    appiumVersions.add(APPIUM_VERSION_1_4_16);
    for (String appiumVersion: appiumVersions) {
        entries.add(new ListBoxModel.Option(appiumVersion, appiumVersion, appiumVersion.equals(currentAppiumVersion)));
    }
    return new ListBoxModel(entries);
}
 
开发者ID:awslabs,项目名称:aws-device-farm-jenkins-plugin,代码行数:18,代码来源:AWSDeviceFarmRecorder.java

示例12: doFillAppiumVersionTestngItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
/**
 * Populate the project drop-down Appium Version.
 *
 * @return The ListBoxModel for the UI.
 */
@SuppressWarnings("unused")
public ListBoxModel doFillAppiumVersionTestngItems(@QueryParameter String currentAppiumVersion) {
    List<ListBoxModel.Option> entries = new ArrayList<ListBoxModel.Option>();
    ArrayList<String> appiumVersions = new ArrayList<String>();
    appiumVersions.add(APPIUM_VERSION_1_6_3);
    appiumVersions.add(APPIUM_VERSION_1_6_5);
    appiumVersions.add(APPIUM_VERSION_1_4_16);
    for (String appiumVersion: appiumVersions) {
        // We don't ignore case because these *should* be unique.
        entries.add(new ListBoxModel.Option(appiumVersion, appiumVersion, appiumVersion.equals(currentAppiumVersion)));
    }
    return new ListBoxModel(entries);
}
 
开发者ID:awslabs,项目名称:aws-device-farm-jenkins-plugin,代码行数:19,代码来源:AWSDeviceFarmRecorder.java

示例13: doFillAppiumVersionPythonItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
/**
 * Populate the project drop-down Appium Version.
 *
 * @return The ListBoxModel for the UI.
 */
@SuppressWarnings("unused")
public ListBoxModel doFillAppiumVersionPythonItems(@QueryParameter String currentAppiumVersion) {
    // Create ListBoxModel from all projects for this AWS Device Farm account.
    List<ListBoxModel.Option> entries = new ArrayList<ListBoxModel.Option>();
    //System.out.print("getting appium version");
    ArrayList<String> appiumVersions = new ArrayList<String>();
    appiumVersions.add(APPIUM_VERSION_1_6_3);
    appiumVersions.add(APPIUM_VERSION_1_6_5);
    appiumVersions.add(APPIUM_VERSION_1_4_16);
    for (String appiumVersion: appiumVersions) {
        entries.add(new ListBoxModel.Option(appiumVersion, appiumVersion, appiumVersion.equals(currentAppiumVersion)));
    }
    return new ListBoxModel(entries);
}
 
开发者ID:awslabs,项目名称:aws-device-farm-jenkins-plugin,代码行数:20,代码来源:AWSDeviceFarmRecorder.java

示例14: doFillKojiTaskItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
/**
 * Fills the Koji task options for project configurations.
 * @return
 */
@SuppressWarnings("UnusedDeclaration")
public ListBoxModel doFillKojiTaskItems(){
    ListBoxModel kojiTaskModel = new ListBoxModel(
            new ListBoxModel.Option("Koji moshimoshi (validate client configuration)", KojiTask.moshimoshi.name()),
            new ListBoxModel.Option("Run a new maven build", KojiTask.mavenBuild.name()),
            new ListBoxModel.Option("Download maven build", KojiTask.download.name()),
            new ListBoxModel.Option("List latest build for package", KojiTask.listLatest.name())
    );
    return kojiTaskModel;
}
 
开发者ID:vtunka,项目名称:jenkins-koji-plugin,代码行数:15,代码来源:KojiBuilder.java

示例15: doFillServerTypeItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
public ListBoxModel doFillServerTypeItems()
{
    return new ListBoxModel(
            new ListBoxModel.Option("Production (https://login.salesforce.com)", "https://login.salesforce.com"),
            new ListBoxModel.Option("Sandbox (https://test.salesforce.com)", "https://test.salesforce.com")
    );
}
 
开发者ID:aesanch2,项目名称:salesforce-migration-assistant,代码行数:8,代码来源:SMABuilder.java


注:本文中的hudson.util.ListBoxModel.Option方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。