本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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;
}