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


Java ListBoxModel.get方法代码示例

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


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

示例3: doFillUnstableAsItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
@SuppressWarnings("UnusedDeclaration")
public ListBoxModel doFillUnstableAsItems() {
    ListBoxModel items = new ListBoxModel();
    GHCommitState[] results = new GHCommitState[] {GHCommitState.SUCCESS,GHCommitState.ERROR,GHCommitState.FAILURE};
    for (GHCommitState nextResult : results) {
        String text = StringUtils.capitalize(nextResult.toString().toLowerCase());
        items.add(text, nextResult.toString());
        if (unstableAs.toString().equals(nextResult)) {
            items.get(items.size()-1).selected = true;
        }
    }

    return items;
}
 
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:15,代码来源:GhprcTrigger.java

示例4: doFillResultItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
public ListBoxModel doFillResultItems(@QueryParameter String result) {
    ListBoxModel items = new ListBoxModel();
    GHCommitState[] results = new GHCommitState[] { GHCommitState.SUCCESS, GHCommitState.ERROR, GHCommitState.FAILURE };
    for (GHCommitState nextResult : results) {

        items.add(nextResult.toString(), nextResult.toString());
        if (result.toString().equals(nextResult)) {
            items.get(items.size() - 1).selected = true;
        }
    }

    return items;
}
 
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:14,代码来源:GhprcBuildResultMessage.java

示例5: doFillCredentialsStringItems

import hudson.util.ListBoxModel; //导入方法依赖的package包/类
public ListBoxModel doFillCredentialsStringItems(@QueryParameter String credentials) {
    ListBoxModel items = new ListBoxModel();
    items.add("");
    for (AWSEBCredentials creds : AWSEBCredentials.getCredentials()) {

        items.add(creds, creds.toString());
        if (creds.toString().equals(credentials)) {
            items.get(items.size() - 1).selected = true;
        }
    }

    return items;
}
 
开发者ID:DavidTanner,项目名称:aws-beanstalk-publisher,代码行数:14,代码来源:AWSEBElasticBeanstalkSetup.java


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