本文整理汇总了Java中hudson.tools.ToolDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java ToolDescriptor类的具体用法?Java ToolDescriptor怎么用?Java ToolDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ToolDescriptor类属于hudson.tools包,在下文中一共展示了ToolDescriptor类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doFillTypeItems
import hudson.tools.ToolDescriptor; //导入依赖的package包/类
public ListBoxModel doFillTypeItems() {
ListBoxModel r = new ListBoxModel();
r.add("<any>", "");
for (ToolDescriptor<?> desc : ToolInstallation.all()) {
String idOrSymbol = desc.getId();
Set<String> symbols = SymbolLookup.getSymbolValue(desc);
if (!symbols.isEmpty()) {
idOrSymbol = symbols.iterator().next();
}
r.add(desc.getDisplayName(), idOrSymbol);
}
return r;
}
示例2: doFillNameItems
import hudson.tools.ToolDescriptor; //导入依赖的package包/类
public ListBoxModel doFillNameItems(@QueryParameter String type) {
type = Util.fixEmpty(type);
ListBoxModel r = new ListBoxModel();
for (ToolDescriptor<?> desc : ToolInstallation.all()) {
if (type != null && !desc.getId().equals(type) && !SymbolLookup.getSymbolValue(desc).contains(type)) {
continue;
}
for (ToolInstallation tool : desc.getInstallations()) {
r.add(tool.getName());
}
}
return r;
}
示例3: getOpenEdgeInstallations
import hudson.tools.ToolDescriptor; //导入依赖的package包/类
public List<OpenEdgeInstallation> getOpenEdgeInstallations() {
List<OpenEdgeInstallation> list = new ArrayList<>();
for (ToolDescriptor<?> desc : ToolInstallation.all()) {
for (ToolInstallation inst : desc.getInstallations()) {
if (inst instanceof OpenEdgeInstallation) {
list.add((OpenEdgeInstallation) inst);
}
}
}
return list;
}
示例4: doFillToolUsedItems
import hudson.tools.ToolDescriptor; //导入依赖的package包/类
/**
* List model to choose the tool used (normally, it should be the ZAProxy tool).
*
* @return a {@link ListBoxModel}
*/
public ListBoxModel doFillToolUsedItems() {
ListBoxModel items = new ListBoxModel();
for(ToolDescriptor<?> desc : ToolInstallation.all()) {
for (ToolInstallation tool : desc.getInstallations()) {
items.add(tool.getName());
}
}
return items;
}
示例5: getApplicableDescriptors
import hudson.tools.ToolDescriptor; //导入依赖的package包/类
/**
* Return list of applicable GitTool descriptors.
* @return list of applicable GitTool descriptors
*/
@SuppressWarnings("unchecked")
public List<ToolDescriptor<? extends GitTool>> getApplicableDescriptors() {
List<ToolDescriptor<? extends GitTool>> r = new ArrayList<>();
Jenkins jenkinsInstance = Jenkins.getInstance();
for (ToolDescriptor<?> td : jenkinsInstance.<ToolInstallation,ToolDescriptor<?>>getDescriptorList(ToolInstallation.class)) {
if (GitTool.class.isAssignableFrom(td.clazz)) { // This checks cast is allowed
r.add((ToolDescriptor<? extends GitTool>)td); // This is the unchecked cast
}
}
return r;
}
示例6: testGetApplicableFromDescriptor
import hudson.tools.ToolDescriptor; //导入依赖的package包/类
@Test
public void testGetApplicableFromDescriptor() {
GitTool.DescriptorImpl gitDescriptor = gitTool.getDescriptor();
GitTool.DescriptorImpl jgitDescriptor = (new JGitTool()).getDescriptor();
GitTool.DescriptorImpl jgitApacheDescriptor = (new JGitApacheTool()).getDescriptor();
List<ToolDescriptor<? extends GitTool>> toolDescriptors = gitDescriptor.getApplicableDescriptors();
assertTrue("git tool descriptor not found in " + toolDescriptors, toolDescriptors.contains(gitDescriptor));
assertTrue("jgit tool descriptor not found in " + toolDescriptors, toolDescriptors.contains(jgitDescriptor));
assertTrue("jgitapache tool descriptor not found in " + toolDescriptors, toolDescriptors.contains(jgitApacheDescriptor));
assertEquals("Wrong tool descriptor count in " + toolDescriptors, 3, toolDescriptors.size());
}
示例7: getApplicableDescriptors
import hudson.tools.ToolDescriptor; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public List<ToolDescriptor<? extends TransifexTool>> getApplicableDescriptors()
{
List<ToolDescriptor<? extends TransifexTool>> r = new ArrayList<ToolDescriptor<? extends TransifexTool>>();
for (ToolDescriptor td : Jenkins.getInstance().<ToolInstallation, ToolDescriptor<?>> getDescriptorList(
ToolInstallation.class))
{
if (TransifexTool.class.isAssignableFrom(td.clazz))
r.add(td);
}
return r;
}
示例8: getApplicableDesccriptors
import hudson.tools.ToolDescriptor; //导入依赖的package包/类
/**
* Misspelled method name. Please use #getApplicableDescriptors.
* @return list of applicable GitTool descriptors
* @deprecated
*/
@Deprecated
public List<ToolDescriptor<? extends GitTool>> getApplicableDesccriptors() {
return getApplicableDescriptors();
}