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


Java ToolDescriptor类代码示例

本文整理汇总了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;
}
 
开发者ID:10000TB,项目名称:Jenkins-Plugin-Examples,代码行数:17,代码来源:ToolStep.java

示例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;
}
 
开发者ID:10000TB,项目名称:Jenkins-Plugin-Examples,代码行数:15,代码来源:ToolStep.java

示例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;
}
 
开发者ID:Riverside-Software,项目名称:openedge-jenkins-plugin,代码行数:12,代码来源:OpenEdgeAxis.java

示例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;
}
 
开发者ID:jenkinsci,项目名称:zaproxy-plugin,代码行数:15,代码来源:ZAProxy.java

示例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;
}
 
开发者ID:jenkinsci,项目名称:git-client-plugin,代码行数:16,代码来源:GitTool.java

示例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());
}
 
开发者ID:jenkinsci,项目名称:git-client-plugin,代码行数:12,代码来源:GitToolTest.java

示例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;
}
 
开发者ID:jenkinsci,项目名称:transifex-plugin,代码行数:13,代码来源:TransifexTool.java

示例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();
}
 
开发者ID:jenkinsci,项目名称:git-client-plugin,代码行数:10,代码来源:GitTool.java


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