Refine search
public ListBoxModel doFillStateItems() { ListBoxModel options = new ListBoxModel(); for (BuildState buildState : EnumSet.allOf(BuildState.class)) { options.add(buildState.name()); } return options; }
public ListBoxModel doFillImpactDefectFilterItems(@QueryParameter(value = "../cimInstance") String cimInstance) { ListBoxModel result = new ListBoxModel(); result.add("High"); result.add("Medium"); result.add("Low"); return result; }
public ListBoxModel doFillNoOfColumnsItems(@AncestorInPath ItemGroup<?> context) { ListBoxModel options = new ListBoxModel(); options.add("1", "1"); options.add("2", "2"); options.add("3", "3"); return options; }
public ListBoxModel doFillResultItems(@QueryParameter String result) { ListBoxModel items = new ListBoxModel(); GHCommitState[] results = new GHCommitState[] {GHCommitState.SUCCESS, GHCommitState.ERROR, GHCommitState.FAILURE}; for (GHCommitState nextResult : results) { items.add(nextResult.toString(), nextResult.toString()); if (result.equals(nextResult.toString())) { items.get(items.size() - 1).selected = true; } } return items; } }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath SCMSourceOwner owner, @QueryParameter String source) { if (!hasAccessToCredentialsMetadata(owner)) { return new ListBoxModel(); } return new StandardUsernameListBoxModel() .withEmptySelection() .withAll(availableCredentials(owner, source)); }
public ListBoxModel doFillInputTypeItems(@AncestorInPath Item item, @QueryParameter String key, @QueryParameter String type) { ListBoxModel ret = new ListBoxModel(); ret.add("Json contents", "json"); ret.add("API Object type : API Object key", "kv"); ret.add("Label", "label"); return ret; }
public ListBoxModel doFillTriggerOpenMergeRequestOnPushItems(@QueryParameter String triggerOpenMergeRequestOnPush) { return new ListBoxModel(new Option("Never", "never", triggerOpenMergeRequestOnPush.matches("never")), new Option("On push to source branch", "source", triggerOpenMergeRequestOnPush.matches("source")), new Option("On push to source or target branch", "both", triggerOpenMergeRequestOnPush.matches("both"))); }
/** * For UI. */ @SuppressWarnings({"UnusedDeclaration", "JavaDoc"}) public void doComputerNameValues(StaplerRequest req, StaplerResponse resp, @QueryParameter("hostName") String hostName) throws IOException, ServletException { ListBoxModel m = new ListBoxModel(); List<VirtualBoxMachine> virtualMachines = getDefinedVirtualMachines(hostName); if (virtualMachines != null && virtualMachines.size() > 0) { for (VirtualBoxMachine vm : virtualMachines) { m.add(new ListBoxModel.Option(vm.getName(), vm.getName())); } m.get(0).selected = true; } m.writeTo(req, resp); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath ItemGroup context) { AccessControlled ac = (context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance()); if (!ac.hasPermission(Jenkins.ADMINISTER)) { return new ListBoxModel(); } return new SSHUserListBoxModel().withMatching(SSHAuthenticator.matcher(Connection.class), CredentialsProvider.lookupCredentials(StandardUsernameCredentials.class, context, ACL.SYSTEM, SSHLauncher.SSH_SCHEME)); } }
public ListBoxModel doFillLastJobItems(@AncestorInPath ItemGroup<?> context) { ListBoxModel options = new ListBoxModel(); options.add(""); options.addAll(ProjectUtil.fillAllProjects(context, AbstractProject.class)); return options; }
/** * A version of the {@link #add(String, String)} method where the display name and the value are the same. */ public ListBoxModel add(String nameAndValue) { add(nameAndValue,nameAndValue); return this; }
public ListBoxModel doFillMultiMetricOperatorItems(){ boolean defaultGT = true; boolean defaultLT = false; if( multiMetricOperator != null && multiMetricOperator.equals("lessThan")) { defaultGT = false; defaultLT = true; } return new ListBoxModel( new Option("Greater Than", "greaterThan", defaultGT), new Option("Less Than", "lessThan", defaultLT)); }
@Override public void run() { ListBoxModel options = r.jenkins.getDescriptorByType(MercurialSCM.DescriptorImpl.class).doFillCredentialsIdItems(null, "http://nowhere.net/"); assertEquals(CredentialsNameProvider.name(c), options.get(1).name); } });
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; }
public ListBoxModel doFillThemeItems(@AncestorInPath ItemGroup<?> context) { ListBoxModel options = new ListBoxModel(); options.add("Default", "default"); options.add("Contrast", "contrast"); options.add("Overview", "overview"); return options; }
public ListBoxModel doFillUnstableAsItems() { ListBoxModel items = new ListBoxModel(); GHCommitState[] results = new GHCommitState[] {GHCommitState.SUCCESS, GHCommitState.ERROR, GHCommitState.FAILURE}; for (GHCommitState nextResult : results) { String text = StringUtils.capitalize(nextResult.toString().toLowerCase()); items.add(text, nextResult.toString()); if (unstableAs.toString().equals(nextResult.toString())) { items.get(items.size() - 1).selected = true; } } return items; }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Job<?,?> owner, @QueryParameter String source) { if (!hasAccessToCredentialsMetadata(owner)) { return new ListBoxModel(); } return new StandardUsernameListBoxModel() .withEmptySelection() .withAll(availableCredentials(owner, new EnvVars( ).expand( source ))); }
public ListBoxModel doFillInputTypeItems(@AncestorInPath Item item, @QueryParameter String key, @QueryParameter String type) { ListBoxModel ret = new ListBoxModel(); ret.add("Json contents", "json"); ret.add("API Object type : API Object key", "kv"); ret.add("Label", "label"); return ret; }
public ListBoxModel doFillVpceServiceNameItems(@QueryParameter String currentVpceServiceName) { List<ListBoxModel.Option> entries = new ArrayList<ListBoxModel.Option>(); // Create ListBoxModel for all VPCE configs for this AWS Device Farm account. try { System.out.print("Getting VPCE configs"); List<String> vpceServiceNames = getAWSDeviceFarmVpceConfigurations(); System.out.print(String.format("VPCE configs length = %d", vpceServiceNames.size())); for (String vpceServiceName : vpceServiceNames) { entries.add(new ListBoxModel.Option(vpceServiceName, vpceServiceName, vpceServiceName.equals(currentVpceServiceName))); } } catch (ServiceAccountException e) { System.out.println("Account does not have a VPC configured or has not been whitelisted for VPC. Note: VPC is a private device only feature"); } return new ListBoxModel(entries); }