當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。