Package hudson.model

Examples of hudson.model.AutoCompletionCandidates


         *
         * @param value
         *      The text that the user entered.
         */
        public AutoCompletionCandidates doAutoCompleteState(@QueryParameter String value) {
            AutoCompletionCandidates c = new AutoCompletionCandidates();
            for (String state : STATES)
                if (state.toLowerCase().startsWith(value.toLowerCase()))
                    c.add(state);
            return c;
        }
View Full Code Here


         * @param value
         *            to search for
         * @return candidates
         */
        public AutoCompletionCandidates doAutoCompleteLabel() {
            AutoCompletionCandidates candidates = new AutoCompletionCandidates();
            List<Node> masterNodeList = Hudson.getInstance().getNodes();
            for (Node node : masterNodeList) {
                try {
                    for (LabelAtom atom : Label.parseExpression(node.getLabelString()).listAtoms()) {
                        candidates.add(atom.getName());
                    }
                } catch (ANTLRException e) {
                    // invalid expression, skipped
                }
            }
View Full Code Here

            else
                return new AggregatedTestResultPublisher(s.getString("jobs"), req.getParameter("includeFailedBuilds") != null);
        }

        public AutoCompletionCandidates doAutoCompleteJobs(@QueryParameter String value) {
            AutoCompletionCandidates candidates = new AutoCompletionCandidates();
            List<Job> jobs = Jenkins.getInstance().getItems(Job.class);
            for (Job job: jobs) {
                if (job.getFullName().startsWith(value)) {
                    if (job.hasPermission(Item.READ)) {
                        candidates.add(job.getFullName());
                    }
                }
            }
            return candidates;
        }
View Full Code Here

            return FormValidation.ok();
        }

        public AutoCompletionCandidates doAutoCompleteChildProjects(@QueryParameter String value) {
            AutoCompletionCandidates candidates = new AutoCompletionCandidates();
            List<Job> jobs = Jenkins.getInstance().getItems(Job.class);
            for (Job job: jobs) {
                if (job.getFullName().startsWith(value)) {
                    if (job.hasPermission(Item.READ)) {
                        candidates.add(job.getFullName());
                    }
                }
            }
            return candidates;
        }
View Full Code Here

            return true;
        }

        // pending https://trello.com/c/THjT9lwd/131-autocompletioncandidates-for-label
        public AutoCompletionCandidates doAutoCompleteLabel(@QueryParameter String value) {
            AutoCompletionCandidates c = new AutoCompletionCandidates();
            Jenkins j = Jenkins.getInstance();
            if (j != null) {
                for (Label label : j.getLabels()) {
                    if (label.getName().startsWith(value)) {
                        c.add(label.getName());
                    }
                }
            }
            return c;
        }
View Full Code Here

    return FormValidation.ok();
  }

  public AutoCompletionCandidates doAutoCompleteSubProjects(
      @QueryParameter String value) {
    AutoCompletionCandidates candidates = new AutoCompletionCandidates();
    Set<AbstractProject> projects = getSubProjects();
    for (AbstractProject project : projects) {
      if (project.getFullName().startsWith(value)) {
        if (project.hasPermission(Item.READ)) {
          candidates.add(project.getFullName());
        }
      }
    }
    return candidates;
  }
View Full Code Here

         *
         * @param value
         * @return
         */
        public AutoCompletionCandidates doAutoCompleteProjects(@QueryParameter String value, @AncestorInPath ItemGroup context) {
            AutoCompletionCandidates candidates = new AutoCompletionCandidates();
            List<Job> jobs = Jenkins.getInstance().getAllItems(Job.class);
            for (Job job: jobs) {
                String relativeName = job.getRelativeNameFrom(context);
                if (relativeName.startsWith(value)) {
                    if (job.hasPermission(Item.READ)) {
                        candidates.add(relativeName);
                    }
                }
            }
            return candidates;
        }
View Full Code Here

            return FormValidation.ok();
        }

        public AutoCompletionCandidates doAutoCompleteChildProjectsValue(@QueryParameter String value) {
            AutoCompletionCandidates c = new AutoCompletionCandidates();
            List<Item> items = Hudson.getInstance().getItems(Item.class);
            List<String> queries = new AutoCompleteSeeder(value).getSeeds();

            for (String term : queries) {
                for (Item item : items) {
                    if (item.getName().startsWith(term)) {
                        c.add(item.getName());
                    }
                }
            }
            return c;
        }
View Full Code Here

         *
         * @param value the value that the user has typed in the textbox.
         * @return the list of server names, depending on the current value in the textbox.
         */
        public AutoCompletionCandidates doAutoCompleteCopyNewItemFrom(@QueryParameter final String value) {
            final AutoCompletionCandidates r = new AutoCompletionCandidates();

            for (String s : PluginImpl.getInstance().getServerNames()) {
                if (s.startsWith(value)) {
                    r.add(s);
                }
            }
            return r;
        }
View Full Code Here

TOP

Related Classes of hudson.model.AutoCompletionCandidates

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.