Package hudson.util

Examples of hudson.util.ListBoxModel


        @Override public String getDisplayName() {
            return "Install a tool";
        }

        public ListBoxModel doFillTypeItems() {
            ListBoxModel r = new ListBoxModel();
            r.add("<any>", "");
            for (ToolDescriptor<?> desc : ToolInstallation.all()) {
                r.add(desc.getDisplayName(), desc.getId());
            }
            return r;
        }
View Full Code Here


            return r;
        }

        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)) {
                    continue;
                }
                for (ToolInstallation tool : desc.getInstallations()) {
                    r.add(tool.getName());
                }
            }
            return r;
        }
View Full Code Here

        public String getDisplayName() {
            return "Executes the body with a timeout";
        }

        public ListBoxModel doFillUnitItems() {
            ListBoxModel r = new ListBoxModel();
            for (TimeUnit unit : TimeUnit.values()) {
                r.add(unit.name());
            }
            return r;
        }
View Full Code Here

    public Builder newInstance(StaplerRequest req, JSONObject formData) throws hudson.model.Descriptor.FormException {
      return req.bindJSON(clazz, formData);
    }

    public ListBoxModel doFillSiteNameItems() {
      ListBoxModel m = new ListBoxModel();
      for (SSHSite site : SSHBuildWrapper.DESCRIPTOR.getSites()) {
        m.add(site.getSitename());
      }
      return m;
    }
View Full Code Here

        public String getDisplayName() {
            return "Set build status on GitHub commit";
        }
       
        public ListBoxModel doFillResultOnFailureItems() {
            ListBoxModel items = new ListBoxModel();
            for (Result result : SUPPORTED_RESULTS) {
                items.add(result.toString());
            }
            return items;
        }
View Full Code Here

       * the previous time
       *
       * @return the name of the option selected in the previous run
       */
    public ListBoxModel doFillComparisonTypeItems() {
      ListBoxModel items = new ListBoxModel();

      //getting the user selected value
      String temp = getOptionType();

      if(temp.equalsIgnoreCase("ART")) {

        items.add("Average Response Time", "ART");
        items.add("Median Response Time", "MRT");
        items.add("Percentile Response Time", "PRT");
      } else if(temp.equalsIgnoreCase("MRT")) {

        items.add("Median Response Time", "MRT");
        items.add("Percentile Response Time", "PRT");
        items.add("Average Response Time", "ART");
      } else if(temp.equalsIgnoreCase("PRT")) {

        items.add("Percentile Response Time", "PRT");
        items.add("Average Response Time", "ART");
        items.add("Median Response Time", "MRT");
      }

      return items;
    }
View Full Code Here

            }
            return new String[0];
        }

        public ListBoxModel doFillHypervisorDescriptionItems() {
            ListBoxModel items = new ListBoxModel();
            for (Cloud cloud : Hudson.getInstance().clouds) {
                if (cloud instanceof Hypervisor) {
                    items.add(((Hypervisor) cloud).getHypervisorURI(), ((Hypervisor) cloud).getHypervisorDescription());
                }
            }
            return items;
        }
View Full Code Here

            return FormValidation.error("Not a number.");
        }
    }

    public void doComputerNameValues(StaplerRequest req, StaplerResponse rsp, @QueryParameter("value") String value) throws IOException, ServletException {
        ListBoxModel m = new ListBoxModel();
        List<VirtualMachine> virtualMachines = null;
        for (Cloud cloud : Jenkins.getInstance().clouds) {
            if (cloud instanceof Hypervisor) {
                Hypervisor hypervisor = (Hypervisor) cloud;
                if (value != null && value.equals(hypervisor.getHypervisorDescription())) {
                    virtualMachines = hypervisor.getVirtualMachines();
                    break;
                }
            }
        }
        if (virtualMachines != null) {
            for (VirtualMachine vm : virtualMachines) {
                m.add(new ListBoxModel.Option(vm.getName(), vm.getName()));
            }
            if( m.size() > 0 )
                m.get(0).selected = true;
        }
        m.writeTo(req, rsp);
    }
View Full Code Here

        }
        m.writeTo(req, rsp);
    }

    public void doSnapshotNameValues(StaplerRequest req, StaplerResponse rsp, @QueryParameter("vm") String vm, @QueryParameter("hypervisor") String hypervisor) throws IOException, ServletException {
        ListBoxModel m = new ListBoxModel();
        m.add(new ListBoxModel.Option("", ""));
        for (Cloud cloud : Hudson.getInstance().clouds) {
            if (cloud instanceof Hypervisor) {
                Hypervisor hypHandle = (Hypervisor) cloud;
                if (hypervisor != null && hypervisor.equals(hypHandle.getHypervisorURI())) {
                  String[] ss  = hypHandle.getSnapshots(vm);
                  for (String sshot : ss) {
                    m.add(new ListBoxModel.Option(sshot, sshot));
                  }
                }
            }
        }
       
        m.writeTo(req, rsp);
    }
View Full Code Here

         * @param serverName the name of the server selected in the "Choose Server" dropdown.
         * @return a ListBoxModel for the drop-down list.
         */
        public ListBoxModel doFillVerdictCategoryItems(
                    @QueryParameter("serverName") @RelativePath(value = "..") String serverName) {
            ListBoxModel m = new ListBoxModel();

            Collection<VerdictCategory> list = null;
            if (ANY_SERVER.equals(serverName)) { //list all configured VCs in all servers
                Map<String, VerdictCategory> map = new HashMap<String, VerdictCategory>();
                for (GerritServer server : PluginImpl.getInstance().getServers()) {
                    for (VerdictCategory vc : server.getConfig().getCategories()) {
                        if (!map.containsKey(vc.getVerdictValue())) {
                            map.put(vc.getVerdictValue(), vc);
                        }
                    }
                }
                list = map.values();
            } else {
                list = PluginImpl.getInstance().getServer(serverName).getConfig().getCategories();
            }
            if (list != null && !list.isEmpty()) {
                for (VerdictCategory v : list) {
                    m.add(v.getVerdictDescription(), v.getVerdictValue());
                }
            }
            return m;
        }
View Full Code Here

TOP

Related Classes of hudson.util.ListBoxModel

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.