类hudson.model.AutoCompletionCandidates源码实例Demo

下面列出了怎么用hudson.model.AutoCompletionCandidates的API类实例代码及写法,或者点击链接到github查看源代码。

public static AutoCompletionCandidates doAutoCompleteResourceNames(
		@QueryParameter String value) {
	AutoCompletionCandidates c = new AutoCompletionCandidates();

	value = Util.fixEmptyAndTrim(value);

	if (value != null) {
		for (LockableResource r : LockableResourcesManager.get()
				.getResources()) {
			if (r.getName().startsWith(value))
				c.add(r.getName());
		}
	}

	return c;
}
 
源代码2 项目: gitlab-plugin   文件: ProjectLabelsProvider.java
public AutoCompletionCandidates doAutoCompleteLabels(Job<?, ?> job, String query) {
    AutoCompletionCandidates result = new AutoCompletionCandidates();
    // show all suggestions for short strings
    if (query.length() < 2) {
        result.add(getProjectLabelsAsArray(job));
    } else {
        for (String branch : getProjectLabelsAsArray(job)) {
            if (branch.toLowerCase().contains(query.toLowerCase())) {
                result.add(branch);
            }
        }
    }
    return result;
}
 
源代码3 项目: gitlab-plugin   文件: ProjectBranchesProvider.java
public AutoCompletionCandidates doAutoCompleteBranchesSpec(Job<?, ?> job, String query) {
    AutoCompletionCandidates result = new AutoCompletionCandidates();
    // show all suggestions for short strings
    if (query.length() < 2) {
        result.add(getProjectBranchesAsArray(job));
    } else {
        for (String branch : getProjectBranchesAsArray(job)) {
            if (branch.toLowerCase().contains(query.toLowerCase())) {
                result.add(branch);
            }
        }
    }
    return result;
}
 
public AutoCompletionCandidates doAutoCompleteLabelName(
		@QueryParameter String value) {
	AutoCompletionCandidates c = new AutoCompletionCandidates();

	value = Util.fixEmptyAndTrim(value);

	for (String l : LockableResourcesManager.get().getAllLabels())
		if (value != null && l.startsWith(value))
			c.add(l);

	return c;
}
 
public AutoCompletionCandidates doAutoCompleteJobs(@QueryParameter String value, @AncestorInPath Item self, @AncestorInPath ItemGroup container) {
    // Item.READ checked inside
    return AutoCompletionCandidates.ofJobNames(Job.class,value,self,container);
}
 
源代码6 项目: gitlab-plugin   文件: GitLabPushTrigger.java
public AutoCompletionCandidates doAutoCompleteIncludeBranchesSpec(@AncestorInPath final Job<?, ?> job, @QueryParameter final String value) {
    return ProjectBranchesProvider.instance().doAutoCompleteBranchesSpec(job, value);
}
 
源代码7 项目: gitlab-plugin   文件: GitLabPushTrigger.java
public AutoCompletionCandidates doAutoCompleteExcludeBranchesSpec(@AncestorInPath final Job<?, ?> job, @QueryParameter final String value) {
    return ProjectBranchesProvider.instance().doAutoCompleteBranchesSpec(job, value);
}
 
源代码8 项目: gitlab-plugin   文件: GitLabPushTrigger.java
public AutoCompletionCandidates doAutoCompleteIncludeMergeRequestLabels(@AncestorInPath final Job<?, ?> job, @QueryParameter final String value) {
    return ProjectLabelsProvider.instance().doAutoCompleteLabels(job, value);
}
 
源代码9 项目: gitlab-plugin   文件: GitLabPushTrigger.java
public AutoCompletionCandidates doAutoCompleteExcludeMergeRequestLabels(@AncestorInPath final Job<?, ?> job, @QueryParameter final String value) {
    return ProjectLabelsProvider.instance().doAutoCompleteLabels(job, value);
}
 
源代码10 项目: lockable-resources-plugin   文件: LockStep.java
public AutoCompletionCandidates doAutoCompleteResource(@QueryParameter String value) {
  return RequiredResourcesProperty.DescriptorImpl.doAutoCompleteResourceNames(value);
}
 
public AutoCompletionCandidates doAutoCompleteResource(@QueryParameter String value) {
	return RequiredResourcesProperty.DescriptorImpl.doAutoCompleteResourceNames(value);
}
 
/**
 * Auto completion for jobs.
 *
 * @param value     the user-entered value
 * @param container the folder being configured
 * @return candidates inside container based on value
 */
public AutoCompletionCandidates doAutoCompleteJobs(@QueryParameter String value, @AncestorInPath ItemGroup container) {
    return AutoCompletionCandidates.ofJobNames(Job.class, value, container);
}
 
 类所在包
 类方法
 同包方法