/** * @deprecated * Exposed for stapler. Not meant for programatic consumption. */ @Exported @Deprecated public Option[] values() { return toArray(new Option[size()]); } }
/** * @deprecated * Exposed for stapler. Not meant for programatic consumption. */ @Exported @Deprecated public Option[] values() { return toArray(new Option[size()]); } }
/** * @deprecated * Exposed for stapler. Not meant for programatic consumption. */ @Exported public Option[] values() { return toArray(new Option[size()]); } }
/** * @deprecated Exposed for stapler. Not meant for programatic consumption. */ @Exported public Option[] values() { return toArray(new Option[size()]); } }
/** * @deprecated * Exposed for stapler. Not meant for programatic consumption. */ @Exported public Option[] values() { return toArray(new Option[size()]); } }
/** * @deprecated * Exposed for stapler. Not meant for programatic consumption. */ @Exported public Option[] values() { return toArray(new Option[size()]); } }
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 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 doFillStateItems(@QueryParameter("state") String state) { ListBoxModel items = new ListBoxModel(); for (GHCommitState commitState : GHCommitState.values()) { items.add(commitState.toString(), commitState.toString()); if (state.equals(commitState.toString())) { items.get(items.size() - 1).selected = true; } } return items; } }
@NonNull public static ListBoxModel doFillFileItems(@Nullable final String currentValue) { ListBoxModel m = new ListBoxModel(); m.add("- none -", ""); for (ConfigProvider p : ConfigProvider.all()) { ConfigSuitableFor a = p.getClass().getAnnotation(ConfigSuitableFor.class); if (null != a && a.target() == UserData.class) { for (Config cfg : p.getAllConfigs()) { String label = p.getDisplayName() + " " + cfg.name; if (cfg.comment != null && !cfg.comment.isEmpty()) { label += String.format(" [%s]", cfg.comment); } m.add(label, cfg.id); if (cfg.id.equals(currentValue)) { m.get(m.size() - 1).selected = true; } } } } return m; } }
JsonArray array = jsonReader.readArray(); if (projects.size() == 0) { projects.add("-- Select Project --", null);
@Test public void credentialsListableAtFolderScope() throws Exception { Folder f = createFolder(); ListBoxModel asGroup = CredentialsProvider.listCredentials(StandardUsernamePasswordCredentials.class, (ItemGroup) f, ACL.SYSTEM, Collections.emptyList(), CredentialsMatchers.always()); ListBoxModel asItem = CredentialsProvider.listCredentials(StandardUsernamePasswordCredentials.class, (Item) f, ACL.SYSTEM, Collections.emptyList(), CredentialsMatchers.always()); assertThat(asGroup, is(asItem)); assertThat(asGroup.size(), is(0)); assertThat(asItem.size(), is(0)); CredentialsStore folderStore = getFolderStore(f); UsernamePasswordCredentialsImpl credentials = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, "test-id", "description", "test-user", "secret"); folderStore.addCredentials(Domain.global(), credentials); asGroup = CredentialsProvider.listCredentials(StandardUsernamePasswordCredentials.class, (ItemGroup) f, ACL.SYSTEM, Collections.emptyList(), CredentialsMatchers.always()); asItem = CredentialsProvider.listCredentials(StandardUsernamePasswordCredentials.class, (Item) f, ACL.SYSTEM, Collections.emptyList(), CredentialsMatchers.always()); assertThat(asGroup.size(), is(1)); assertThat(asGroup.get(0).value, is("test-id")); assertThat(asItem.size(), is(1)); assertThat(asItem.get(0).value, is("test-id")); }