public void resetToDefaults() { for (OptionEditComponent editor : this.editComponents) { editor.setEditState(editor.getEditedOption().getDefaultCLIString()); } }
public String getAsCLIString() { StringBuilder commandLine = new StringBuilder(); for (Option option : this.optionList) { String value = option.getValueAsCLIString(); if ((value != null) && !value.equals(option.getDefaultCLIString())) { if (commandLine.length() > 0) { commandLine.append(" "); } commandLine.append("-" + option.getCLIChar()); if (value.length() > 0) { if (value.indexOf(' ') < 0) { commandLine.append(" " + value); } else { commandLine.append(" (" + value + ")"); } } } } return commandLine.toString(); }
public String getAsCLIString() { StringBuilder commandLine = new StringBuilder(); for (Option option : this.optionList) { String value = option.getValueAsCLIString(); if ((value != null) && !value.equals(option.getDefaultCLIString())) { if (commandLine.length() > 0) { commandLine.append(" "); } commandLine.append("-" + option.getCLIChar()); if (value.length() > 0) { if (value.indexOf(' ') < 0) { commandLine.append(" " + value); } else { commandLine.append(" (" + value + ")"); } } } } return commandLine.toString(); }
public void getHelp(StringBuilder sb, int indent) { if (optionList.size() > 0) { for (Option option : optionList) { StringUtils.appendIndent(sb, indent); sb.append('-'); sb.append(option.getCLIChar()); sb.append(' '); sb.append(option.getName()); String defaultString = option.getDefaultCLIString(); if (defaultString != null && defaultString.length() > 0) { sb.append(" (default: "); sb.append(defaultString); sb.append(')'); } StringUtils.appendNewline(sb); StringUtils.appendIndent(sb, indent); sb.append(option.getPurpose()); StringUtils.appendNewline(sb); } } else { StringUtils.appendIndented(sb, indent, "No options."); } }
public void getHelp(StringBuilder sb, int indent) { if (optionList.size() > 0) { for (Option option : optionList) { StringUtils.appendIndent(sb, indent); sb.append('-'); sb.append(option.getCLIChar()); sb.append(' '); sb.append(option.getName()); String defaultString = option.getDefaultCLIString(); if (defaultString != null && defaultString.length() > 0) { sb.append(" (default: "); sb.append(defaultString); sb.append(')'); } StringUtils.appendNewline(sb); StringUtils.appendIndent(sb, indent); sb.append(option.getPurpose()); StringUtils.appendNewline(sb); } } else { StringUtils.appendIndented(sb, indent, "No options."); } }