String id = input.getName();
QName type = input.getType();
JLabel paramLabel = new JLabel(id, SwingConstants.TRAILING);
JLabel typeLabel = new JLabel(type.getLocalPart());
XBayaTextComponent paramField;
if (LEADTypes.isKnownType(type)) {
paramField = new XBayaTextField();
columnWeights.add(new Double(0));
} else {
paramField = new XBayaTextArea();
columnWeights.add(new Double(1.0));
}
paramLabel.setLabelFor(paramField.getSwingComponent());
// default value
Object value = input.getDefaultValue();
String valueString = null;
if (value != null) {
if (value instanceof XmlElement) {
XmlElement valueElement = (XmlElement) value;
valueString = XMLUtil.xmlElementToString(valueElement);
} else {
// Only string comes here for now.
valueString = value.toString();
}
}
if (valueString == null) {
// show some sample URI to ease inputs.
final String sampleURI = "gsiftp://rainier.extreme.indiana.edu//tmp/foo.txt";
if (LEADTypes.isURIType(type)) {
valueString = sampleURI;
} else if (LEADTypes.isURIArrayType(type)) {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 4; i++) {
buf.append(sampleURI).append(" ");
}
valueString = buf.toString();
}
}
paramField.setText(valueString);
this.parameterPanel.add(paramLabel);
this.parameterPanel.add(typeLabel);
this.parameterPanel.add(paramField);
this.parameterTextFields.add(paramField);