|
|
Re: re-using a composite [message #467087 is a reply to message #467078] |
Tue, 24 January 2006 16:18 |
Phill Perryman Messages: 214 Registered: July 2009 |
Senior Member |
|
|
Thanks, now I just can't figure out why it does not work. I have the
following code which produces the FormText field on creation but it all
goes blank on update (called by the selection changed event and I am
getting the correct selection event in debug).
I have cut everything out but a single widget to test the process. I have
tried all combinations of the layout in the update code with no effect, am
I just missing something basic.
public void createContents(Composite parentComposite) {
parent = parentComposite;
toolkit = managedForm.getToolkit();
parentComposite.setLayout(new GridLayout());
section = toolkit.createSection(parentComposite,
ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR);
section.setLayoutData(new GridData(GridData.FILL_BOTH));
section.setText("Configuration");
composite = toolkit.createComposite(section, SWT.NONE);
composite.setLayout(new TableWrapLayout());
toolkit.paintBordersFor(composite);
section.setClient(composite);
FormText formText = toolkit.createFormText(composite,
false);
formText.setText("New FormText", false, false);
}
private void update() {
composite.dispose();
composite = toolkit.createComposite(section, SWT.NONE);
composite.setLayout(new TableWrapLayout());
toolkit.paintBordersFor(composite);
section.setClient(composite);
FormText formText = toolkit.createFormText(composite,
false);
formText.setText(selection.getId(), false, false);
composite.layout(true);
section.layout(true);
parent.layout(true);
}
|
|
|
Powered by
FUDForum. Page generated in 0.03213 seconds