a problem about Formpage [message #445928] |
Fri, 12 November 2004 11:30 |
Eclipse User |
|
|
|
Originally posted by: anance.263.net
hi,i meet a problem when i use a formpage,first i create a page extend
from the frompage,then on the page create a sashForm, next create two
children section on the sashForm.each section only have a multi line text.
in this page i want when the page is resized,only the text have scolled
bar,and the page don't have.but i failed when i try to implement it.
could anybody help me?
thx
the following are my code:
protected void createFormContent(IManagedForm managedForm) {
super.createFormContent(managedForm);
ScrolledForm form = managedForm.getForm();
FormToolkit toolkit = managedForm.getToolkit();
GridLayout layout = new GridLayout();
layout.marginWidth = 4;
layout.marginHeight = 4;
form.getBody().setLayout(layout);
sashForm = new SashForm(form.getBody(), SWT.FLAT );
toolkit.adapt(sashForm, false, false);
sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
createRequestPart(managedForm, sashForm);
createResponcePart(managedForm, sashForm);
createToolBarActions(managedForm);
form.setText("SOAPMessage Page"); //$NON-NLS-1$
form.updateToolBar();
managedForm.refresh();
}
private void createRequestPart(IManagedForm managedForm, SashForm
parent) {
FormToolkit toolkit = managedForm.getToolkit();
Section section = createStaticSection(parent, toolkit);
section.setText("SOAP Request");
Composite client = toolkit.createComposite(section, SWT.WRAP);
GridLayout layout = new GridLayout();
layout.marginWidth = 3;
layout.marginHeight = 4;
client.setLayout(layout);
request = toolkit.createText(client, "", SWT.MULTI | SWT.WRAP );
request.setSize(100, 200);
//request.setText(" test\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ");
request.setEditable(false);
toolkit.paintBordersFor(client);
section.setClient(client);
final SectionPart spart = new SectionPart(section);
managedForm.addPart(spart);
}
|
|
|
Powered by
FUDForum. Page generated in 0.03310 seconds