I am already desperated, because I can’t fix my User Interface in Eclipse RCP. So I hope you can help me. Here is the screen and I guess it’s obvious what is bugging me:
https://i.stack.imgur.com/QQN0Y.jpg
Here is the code without the labels and the texts (I postet the first label and text, the rest is the same, setSize() is only done on the first label per section):
Composite c = this.toolkit.createComposite(parent);
c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
ColumnLayout columnLayout = new ColumnLayout();
columnLayout.minNumColumns = 2;
columnLayout.maxNumColumns = 2;
c.setLayout(columnLayout);
Section leftUpSection = this.toolkit.createSection(c,
Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE
| Section.EXPANDED);
leftUpSection.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
KundeEditor.this.form.reflow(true);
}
});
leftUpSection.setText("Daten");
leftUpSection
.setLayoutData(new ColumnLayoutData(ColumnLayoutData.FILL));
Composite leftUp = this.toolkit.createComposite(leftUpSection);
leftUp.setLayout(new GridLayout(2, false));
lblNachname.setSize(230, lblNachname.getSize().y);
this.txtNachname = this.toolkit.createText(leftUp,
this.kunde.getNachname(), SWT.LEFT | SWT.BORDER);
this.txtNachname.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
this.txtNachname.addModifyListener(listener);
Section leftDownSection = this.toolkit.createSection(c,
Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE
| Section.EXPANDED);
leftDownSection.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
KundeEditor.this.form.reflow(true);
}
});
leftDownSection.setText("Kontoinformation");
leftDownSection.setLayoutData(new ColumnLayoutData(
ColumnLayoutData.FILL));
Composite leftDown = this.toolkit.createComposite(leftDownSection);
leftDown.setLayout(new GridLayout(2, false));
Section rightSection = this.toolkit.createSection(c,
Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE
| Section.EXPANDED);
rightSection.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
KundeEditor.this.form.reflow(true);
}
});
rightSection.setText("Kontaktinformation");
rightSection.setLayoutData(new ColumnLayoutData(ColumnLayoutData.FILL));
Composite right = this.toolkit.createComposite(rightSection);
right.setLayout(new GridLayout(2, false));
Section rightDownSection = this.toolkit.createSection(c,
Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE
| Section.EXPANDED);
rightDownSection.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
KundeEditor.this.form.reflow(true);
}
});
rightDownSection.setText("Mitgliedsinformation");
rightDownSection.setLayoutData(new ColumnLayoutData(
ColumnLayoutData.FILL));
Composite rightDown = this.toolkit.createComposite(rightDownSection);
rightDown.setLayout(new GridLayout(2, false));
Thanks in advance!
I can’t see anything obviously wrong with your code, but here is what I suggest for how to proceed:
I think if you carefully go through these steps you will find the error which will likely be a simple mistake. Often I have found problems just be cleaning up and simplifying code.