Package hudson.util

Examples of hudson.util.ListBoxModel$Option


    public static final class DescriptorImpl extends UISampleDescriptor {
        /**
         * This method determines the values of the album drop-down list box.
         */
        public ListBoxModel doFillAlbumItems() {
            ListBoxModel m = new ListBoxModel();
            m.add("Yellow Submarine","1");
            m.add("Abbey Road","2");
            m.add("Let It Be","3");
            return m;
        }
View Full Code Here


    }

    @Extension
    public static final class DescriptorImpl extends UISampleDescriptor {
        public ListBoxModel doFillStateItems(@QueryParameter String country) {
            ListBoxModel m = new ListBoxModel();
            for (String s : asList("A","B","C"))
                m.add(String.format("State %s in %s", s, country),
                        country+':'+s);
            return m;
        }
View Full Code Here

                        country+':'+s);
            return m;
        }

        public ListBoxModel doFillCityItems(@QueryParameter String country, @QueryParameter String state) {
            ListBoxModel m = new ListBoxModel();
            for (String s : asList("X","Y","Z"))
                m.add(String.format("City %s in %s %s", s, state, country),
                        state+':'+s);
            return m;
        }
View Full Code Here

      }
      return FormValidation.ok();
    }

    public ListBoxModel doFillTagItems(@AncestorInPath Job<?,?> context, @QueryParameter String param) {
        ListBoxModel model = new ListBoxModel();
        if (context != null) {
            ParametersDefinitionProperty prop = context.getProperty(ParametersDefinitionProperty.class);
            if (prop != null) {
                ParameterDefinition def = prop.getParameterDefinition(param);
                if (def instanceof ListSubversionTagsParameterDefinition) {
                    for (String tag : ((ListSubversionTagsParameterDefinition) def).getTags(context)) {
                        if (tag.startsWith("!")) {
                            model.add(tag.substring(1), "");
                        } else {
                            model.add(tag);
                        }
                    }
                }
            }
        }
View Full Code Here

            return null;
        }

        public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item context, @AncestorInPath Run run) {
            if (context == null || !context.hasPermission(SCM.TAG)) {
                return new ListBoxModel();
            }
            Set<StandardCredentials> c = new LinkedHashSet<StandardCredentials>();
            SubversionTagAction action = run != null ? run.getAction(SubversionTagAction.class) : null;
            List<DomainRequirement> domainRequirements = Collections.<DomainRequirement>emptyList();
            if (action != null) {
View Full Code Here

      }
      return AnsiColorMap.Default;
    }

    public ListBoxModel doFillColorMapNameItems() {
      ListBoxModel m = new ListBoxModel();
      for(AnsiColorMap colorMap : getColorMaps()) {
        String name = colorMap.getName().trim();
        if(name.length() > 0)
          m.add(name);
      }
      return m;
    }
View Full Code Here

         return null;
      }

      // This method will populate the servers in the select box
      public ListBoxModel doFillServerNameItems(@QueryParameter String serverName) {   
       ListBoxModel s = new ListBoxModel();
       if (this._servers == null)
       {
         descriptorlogger.warning("Failed to find AccuRev server. Add Server under AccuRev section in the Manage Jenkins > Configure System page.");
           return s;
       }
           for (AccurevServer server : this._servers) {
              s.add(server.getName(), server.getName());
           }
          return s;
      }
View Full Code Here

      // server selected.
      public ListBoxModel doFillDepotItems(@QueryParameter String serverName, @QueryParameter String depot) {
       
         final AccurevServer server = getServerAndPath(serverName);
         if (server == null) {       
            return new ListBoxModel();
         }

         ListBoxModel d = null;
         Option temp = null;
         List<String> depots = new ArrayList<String>();
        
         // Execute the login command first & upon success of that run show depots
         // command. If any of the command's exitvalue is 1 proper error message is
         // logged
         try {
         if (Login.accurevLoginfromGlobalConfig(server, accurevPath, descriptorlogger)) {
           depots = ShowDepots.getDepots(server, accurevPath, descriptorlogger);
          }
       } catch (IOException e) {        
        
       } catch (InterruptedException e) {
        
       }

         d = new ListBoxModel();
         for (String dname : depots) {
            d.add(dname, dname);
         }
         // Below while loop is for to retain the selected item when you open the
         // Job to reconfigure
         Iterator<Option> depotsIter = d.iterator();
         while (depotsIter.hasNext()) {
            temp = depotsIter.next();
            if (depot.equals(temp.name)) {
               temp.selected = true;
            }
View Full Code Here

            this.globalAntOpts = globalAntOpts;
            save();
        }

        public ListBoxModel doFillSettingsItems() {
            ListBoxModel lb = new ListBoxModel();
            for (Config config : IvyConfig.provider.getAllConfigs()) {
                lb.add(config.name, config.id);
            }
            return lb;
        }
View Full Code Here

    public String getDisplayName() {
      return Messages.SSH_DisplayName();
    }

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

TOP

Related Classes of hudson.util.ListBoxModel$Option

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.