// boolean field
if (type.equals("bool")) {
Composite comp = new Composite(composite, SWT.NONE);
comp.setLayout(new RowLayout());
Button yesButton = new Button(comp, SWT.RADIO);
yesButton.setText("Yes");
yesButton.setData("ID_" + i + "_True");
yesButton.addSelectionListener(this);
Button noButton = new Button(comp, SWT.RADIO);
noButton.setText("No");
noButton.setData("ID_" + i + "_False");
noButton.addSelectionListener(this);
comp.setLayoutData(tgd);
}
// text field
else if (type.equals("text")) {
Text nameText = new Text(composite, SWT.BORDER);
nameText.setData("ID_" + i);
nameText.addModifyListener(this);
GridData gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
nameText.setLayoutData(gridData);
// nameText.setText("");
}
// multi text field
else if (type.equals("multiline")) {
Text nameText = new Text(composite, SWT.BORDER | SWT.WRAP
| SWT.MULTI);
nameText.setData("ID_" + i);
nameText.addModifyListener(this);
GridData gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.verticalAlignment = SWT.FILL;
gridData.grabExcessVerticalSpace = true;
gridData.minimumHeight = 60;
nameText.setLayoutData(gridData);
// addressText.setText("This text field and the List\nbelow share any excess space.");
}
// 5 option field
else if (type.equals("5options")) {
Composite comp = new Composite(composite, SWT.NONE);
comp.setLayout(new RowLayout());
for (int j = 0; j < 5; j++) {
Button optionButton = new Button(comp, SWT.RADIO);
optionButton.setText(Integer.toString(j + 1));
optionButton.setData("ID_" + i + "_" + j);
optionButton.addSelectionListener(this);