private StreamNegotiator getNegotiator(final FormField field) throws NoAcceptableTransferMechanisms { String variable; boolean isByteStream = false; boolean isIBB = false; for (FormField.Option option : field.getOptions()) { variable = option.getValue(); if (variable.equals(Bytestream.NAMESPACE) && !IBB_ONLY) { isByteStream = true; } else if (variable.equals(DataPacketExtension.NAMESPACE)) { isIBB = true; } } if (!isByteStream && !isIBB) { throw new FileTransferException.NoAcceptableTransferMechanisms(); } if (isByteStream && isIBB) { return new FaultTolerantNegotiator(connection(), byteStreamTransferManager, inbandTransferManager); } else if (isByteStream) { return byteStreamTransferManager; } else { return inbandTransferManager; } }
String value; if (v instanceof FormField.Option) { value = ((FormField.Option)v).getValue();
JComboBox box = new JComboBox(); for ( final FormField.Option option : field.getOptions() ) { String value = option.getValue(); box.addItem(value); for ( final Option option : field.getOptions() ) { String optionLabel = option.getLabel(); String optionValue = option.getValue(); checkBoxList.addCheckBox(new JCheckBox(optionLabel, values.contains(optionValue)), optionValue);
@Override public XmlStringBuilder toXML(String enclosingNamespace) { XmlStringBuilder xml = new XmlStringBuilder(this); // Add attribute xml.optAttribute("label", getLabel()); xml.rightAngleBracket(); // Add element xml.element("value", getValue()); xml.closeElement(this); return xml; }