composite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
if(form != null) {
Iterator i = form.getFields();
while(i.hasNext()) {
FormField field = (FormField)i.next();
if(field.getType().equals(FormField.TYPE_HIDDEN)) continue;
GridData defaultLayoutData = new GridData(SWT.FILL,SWT.NULL,false,false);
Object toAdd = null;
if(field.getType().equals(FormField.TYPE_TEXT_SINGLE)) {
createFieldLabel(composite, field);
Text inputText = new Text(composite,SWT.BORDER);
inputText.setLayoutData(defaultLayoutData);
String val = getFirstValueOfField(field);
if(val != null) inputText.setText(val);
toAdd = inputText;
} else if(field.getType().equals(FormField.TYPE_TEXT_PRIVATE)) {
createFieldLabel(composite, field);
Text inputText = new Text(composite,SWT.BORDER);
inputText.setLayoutData(defaultLayoutData);
toAdd = inputText;
inputText.setEchoChar('*');
String val = getFirstValueOfField(field);
if(val != null) inputText.setText(val);
} else if(field.getType().equals(FormField.TYPE_BOOLEAN)) {
Button button = new Button(composite,SWT.CHECK);
button.setText(field.getLabel());button.setToolTipText(field.getDescription());
button.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,2,1));
toAdd = button;
String val = getFirstValueOfField(field);
if(val != null) button.setSelection(val.equals("1"));
} else {
System.out.println("Field not supported: " + field.getLabel() + " (" + field.getType() + ")");
}
dialogArea.setData(field.getVariable(),toAdd);
}
} else {
GridData layoutData = new GridData(SWT.FILL,SWT.NULL,false,false);
Map attributes = reg.getAttributes();
Map<String,String> atts = attributes;