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"))); }
/** * Fill the dropdown for notification levels. * * @return the values. */ public ListBoxModel doFillNotificationLevelItems() { Map<Notify, String> levelTextsById = notificationLevelTextsById(); ListBoxModel items = new ListBoxModel(levelTextsById.size()); for (Entry<Notify, String> level : levelTextsById.entrySet()) { items.add(new Option(level.getValue(), level.getKey().toString())); } return items; } }
/** * Fill the dropdown for notification levels. * @param serverName the server name. * @return the values. */ public ListBoxModel doFillNotificationLevelItems(@QueryParameter("serverName") final String serverName) { Map<Notify, String> levelTextsById = GerritServer.notificationLevelTextsById(); ListBoxModel items = new ListBoxModel(levelTextsById.size() + 1); items.add(getOptionForNotificationLevelDefault(serverName, levelTextsById)); for (Entry<Notify, String> level : levelTextsById.entrySet()) { items.add(new Option(level.getValue(), level.getKey().toString())); } return items; }
/** * Adds an "empty" credential to signify selection of no credential. * * @return {@code this} for method chaining. * @since 2.1.0 */ @NonNull public AbstractIdCredentialsListBoxModel<T, C> includeEmptyValue() { for (Option a : this) { if (StringUtils.equals("", a.value)) { return this; } } add(0, new Option(Messages.AbstractIdCredentialsListBoxModel_EmptySelection(), "")); return this; }
public void add(String displayName, String value) { add(new Option(displayName,value)); }
public void add(String displayName, String value) { add(new Option(displayName,value)); }
public void add(String displayName, String value) { add(new Option(displayName,value)); }
public ListBoxModel doFillKubeNameItems() { List<KubernetesCloud> cloudList = KubernetesCloud.getKubernetesClouds(); ListBoxModel items = new ListBoxModel(PluginHelper.OPTION_CHOOSE_CLOUD); if (cloudList != null && cloudList.size() == 1) { final KubernetesCloud cloud = cloudList.get(0); items.add(new ListBoxModel.Option(cloud.getDisplayName(), cloud.getName(), true) ); } else { for (KubernetesCloud cloud : cloudList) { items.add(cloud.getDisplayName(), cloud.getName() ); } } return items; }
public void add(String displayName, String value) { add(new Option(displayName, value)); }
public void add(String displayName, String value) { add(new Option(displayName,value)); }
public ListBoxModel doFillGitHubAuthIdItems(@QueryParameter("gitHubAuthId") String gitHubAuthId) { ListBoxModel model = new ListBoxModel(); for (GhprbGitHubAuth auth : getGithubAuth()) { String description = Util.fixNull(auth.getDescription()); int length = description.length(); length = length > MAX_DESCRIPTION_LENGTH ? MAX_DESCRIPTION_LENGTH : length; Option next = new Option(auth.getServerAPIUrl() + " : " + description.substring(0, length), auth.getId()); if (!StringUtils.isEmpty(gitHubAuthId) && gitHubAuthId.equals(auth.getId())) { next.selected = true; } model.add(next); } return model; }
public ListBoxModel doFillUpdateModeItems(@QueryParameter String updateMode) { ListBoxModel items = new ListBoxModel(); for (UpdateModeValue updateModeValue : UpdateModeValue.values()) { items.add(new ListBoxModel.Option(updateModeValue.getDisplayName(), updateModeValue.getMode(), updateModeValue.getMode().equals(updateMode))); } return items; }
public ListBoxModel doFillSortingMethodItems() { return new ListBoxModel( // default option should be listed first new ListBoxModel.Option(Messages.SortingMethod_ALPHABETICAL(), SortingMethod.ALPHABETICAL.name()), new ListBoxModel.Option(Messages.SortingMethod_NATURAL(), SortingMethod.NATURAL.name())); } }
public ListBoxModel doFillBuildCauseItems() { ListBoxModel items = new ListBoxModel(); for (BuildCause cause : BuildCause.values()) { items.add(new ListBoxModel.Option(cause.displayName, cause.name())); } return items; }
private ListBoxModel getResultsModel() { ListBoxModel items = new ListBoxModel(); for (Result result : ALL_RESULTS) { items.add(new ListBoxModel.Option(result.color.getDescription(), result.toString())); } return items; }
public ListBoxModel doFillBuildStatusItems() { return new ListBoxModel( // default option should be listed first new ListBoxModel.Option(Messages.BuildStatus_unchanged(), null), new ListBoxModel.Option(Messages.BuildStatus_FAILURE(), Result.FAILURE.toString()), new ListBoxModel.Option(Messages.BuildStatus_UNSTABLE(), Result.UNSTABLE.toString())); }
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)); }
public ListBoxModel doFillUpdateModeItems(@QueryParameter String updateMode) { ListBoxModel items = new ListBoxModel(); for (UpdateModeValue updateModeValue : UpdateModeValue.values()) { items.add(new ListBoxModel.Option(updateModeValue.getDisplayName(), updateModeValue.getMode(), updateModeValue.getMode().equals(updateMode))); } return items; }
public ListBoxModel doFillSingleMetricOperatorItems(){ boolean defaultGT = true; boolean defaultLT = false; if( singleMetricOperator != null && singleMetricOperator.equals("lessThan")) { defaultGT = false; defaultLT = true; } return new ListBoxModel( new Option("Greater Than", "greaterThan", defaultGT), new Option("Less Than", "lessThan", defaultLT)); }
public void add(String displayName, String value) { add(new Option(displayName,value)); }