Still happening with the 02/11/04 1.2.3 beta version.
How to reproduce:
1) Copy the first three controls from the preview window (chkName, lblDescription, and lblRequired)
2) Paste them after the last control in the preview
3) I get the empty {;} blocks in the source.
Here is my new source that has the problem:
- Code: Select all
public class WidgetTests extends Composite {
private List argumentField;
public WidgetTests(Composite parent, int style) {
super(parent, style);
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 3;
setLayout(gridLayout);
{
final Button chkName = new Button(this, SWT.CHECK);
chkName.setText("-e");
}
{
final Label lblDescription = new Label(this, SWT.NONE);
final GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridData.horizontalSpan = 2;
lblDescription.setLayoutData(gridData);
lblDescription.setText("Natural language description of the option.");
}
{
final Label lblRequired = new Label(this, SWT.RIGHT);
lblRequired.setText("*");
lblRequired.setForeground(ResourceManager.getColor(SWT.COLOR_RED));
lblRequired.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
}
{
final Text txtArgument = new Text(this, SWT.BORDER);
txtArgument.setEnabled(false);
final GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridData.horizontalSpan = 2;
txtArgument.setLayoutData(gridData);
}
{
final Button cmdBrowse = new Button(this, SWT.NONE);
cmdBrowse.setEnabled(false);
final GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
gridData.horizontalSpan = 3;
cmdBrowse.setLayoutData(gridData);
cmdBrowse.setText("...");
}
{
final Button button = new Button(this, SWT.CHECK);
button.setText("-e");
}
{
final Label label = new Label(this, SWT.NONE);
final GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridData.horizontalSpan = 2;
label.setLayoutData(gridData);
label.setText("Natural language description of the option.");
}
{
final Label label = new Label(this, SWT.RIGHT);
final GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
gridData.verticalSpan = 4;
label.setLayoutData(gridData);
label.setForeground(ResourceManager.getColor(SWT.COLOR_RED));
label.setText("*");
}
{
argumentField = new List(this, SWT.BORDER);
final GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
gridData.verticalSpan = 4;
argumentField.setLayoutData(gridData);
}
{
final Button cmdAdd = new Button(this, SWT.NONE);
cmdAdd.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
}
});
cmdAdd.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
cmdAdd.setText("+");
}
{
final Button cmdRemove = new Button(this, SWT.NONE);
cmdRemove.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
}
});
cmdRemove.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
cmdRemove.setText("-");
}
{
final Button cmdUp = new Button(this, SWT.NONE);
cmdUp.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
}
});
cmdUp.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
cmdUp.setText("^");
}
{
final Button cmdDown = new Button(this, SWT.NONE);
cmdDown.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
}
});
cmdDown.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
cmdDown.setText("v");
}
}
public void dispose() {
super.dispose();
}
protected void checkSubclass() {
}
}
This is the result in the new source:
- Code: Select all
.
.
. {
final Button button = new Button(this, SWT.CHECK);
button.setText("-e");
}
{
final Label label = new Label(this, SWT.NONE);
final GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridData.horizontalSpan = 2;
label.setLayoutData(gridData);
label.setText("Natural language description of the option.");
{
;
}
}
{
final Label label = new Label(this, SWT.RIGHT);
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
label.setForeground(ResourceManager.getColor(SWT.COLOR_RED));
label.setText("*");
{
;
}
}
.
.
.