public Option getOption(String optName) { for (Option option : this.optionList) { if (optName.equals(option.getName())) { return option; } } return null; }
public Option getOption(String optName) { for (Option option : this.optionList) { if (optName.equals(option.getName())) { return option; } } return null; }
public void addOption(Option opt) { if (getOption(opt.getName()) != null) { throw new IllegalArgumentException("Duplicate option name: " + opt.getName()); } if (getOption(opt.getCLIChar()) != null) { throw new IllegalArgumentException( "Duplicate option command line character: " + opt.getCLIChar()); } this.optionList.add(opt); }
public void addOption(Option opt) { if (getOption(opt.getName()) != null) { throw new IllegalArgumentException("Duplicate option name: " + opt.getName()); } if (getOption(opt.getCLIChar()) != null) { throw new IllegalArgumentException( "Duplicate option command line character: " + opt.getCLIChar()); } this.optionList.add(opt); }
panel.setLayout(gbLayout); for (int i = 0; i < options.length; i++) { JLabel label = new JLabel(options[i].getName()); label.setToolTipText(options[i].getPurpose()); gbc.gridx = 0;
public void applyChanges() { for (OptionEditComponent editor : this.editComponents) { try { editor.applyState(); } catch (Exception ex) { GUIUtils.showExceptionDialog(this, "Problem with option " + editor.getEditedOption().getName(), ex); } } }
public void applyChanges() { for (OptionEditComponent editor : this.editComponents) { try { editor.applyState(); } catch (Exception ex) { GUIUtils.showExceptionDialog(this, "Problem with option " + editor.getEditedOption().getName(), ex); } } }
public void applyChanges() { for (OptionEditComponent editor : this.editComponents) { try { editor.applyState(); } catch (Exception ex) { GUIUtils.showExceptionDialog(this, "Problem with option " + editor.getEditedOption().getName(), ex); } } }
List<String> descriptions = new ArrayList<String>(numberOptions.size()); for (Option o : numberOptions) { names.add(newNamePrefix + o.getName()); descriptions.add(o.getPurpose());
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."); } }
for (int i = startIndex; i < singleOptions.length; i++) { for (Option opt : currentOptionHandler.getOptions().getOptionArray()) { if (opt.getName().equals(singleOptions[i])) { if (opt instanceof ClassOption) { currentOptionHandler = (OptionHandler)
/** * Prepares the options of this class. * */ public void prepareClassOptions() { this.classOptionNamesToPreparedObjects = null; Option[] optionArray = getOptions().getOptionArray(); for (Option option : optionArray) { if (option instanceof ClassOption) { ClassOption classOption = (ClassOption) option; Object optionObj = classOption.materializeObject(); //monitor, if (optionObj instanceof Configurable) { JavaCLIParser config = new JavaCLIParser(optionObj, ""); } if (this.classOptionNamesToPreparedObjects == null) { this.classOptionNamesToPreparedObjects = new HashMap<String, Object>(); } this.classOptionNamesToPreparedObjects.put(option.getName(), optionObj); } } }
this.classOptionNamesToPreparedObjects = new HashMap<String, Object>(); this.classOptionNamesToPreparedObjects.put(option.getName(), optionObj);
this.classOptionNamesToPreparedObjects = new HashMap<String, Object>(); this.classOptionNamesToPreparedObjects.put(option.getName(), optionObj);
this.classOptionNamesToPreparedObjects = new HashMap<String, Object>(); this.classOptionNamesToPreparedObjects.put(option.getName(), optionObj);
this.classOptionNamesToPreparedObjects = new HashMap<String, Object>(); this.classOptionNamesToPreparedObjects.put(option.getName(), optionObj);
this.classOptionNamesToPreparedObjects = new HashMap<String, Object>(); this.classOptionNamesToPreparedObjects.put(option.getName(), optionObj);
this.classOptionNamesToPreparedObjects = new HashMap<String, Object>(); this.classOptionNamesToPreparedObjects.put(option.getName(), optionObj);