Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » form body
form body [message #261311] Tue, 13 July 2004 20:33 Go to next message
Tal Abir is currently offline Tal AbirFriend
Messages: 56
Registered: July 2009
Member
Hi,
I tried the follwing code in an editorPart.
A form was constructed with a title and the background of the body but I
couldn't add any controls to the body :(
Any suggestions?

public void createPartControl(Composite parent) {
GridLayout gl = new GridLayout();

toolkit = new FormToolkit(parent.getDisplay());
Form form = toolkit.createForm(parent);
form.setText("Version Properties");
form.getBody().setLayoutData(gl);
toolkit.createButton(form.getBody(), "Checkbox", SWT.CHECK);
form.getBody().setBackground(new Color(parent.getDisplay(),100,100,100));
// Hyperlink link =
toolkit.createHyperlink(form.getBody(),"moo",SWT.WRAP);
}
Tal.
Re: form body [message #261328 is a reply to message #261311] Tue, 13 July 2004 21:43 Go to previous message
Michal Tkacz is currently offline Michal TkaczFriend
Messages: 105
Registered: July 2009
Senior Member
Tal wrote:

> Hi,
> I tried the follwing code in an editorPart.
> A form was constructed with a title and the background of the body but I
> couldn't add any controls to the body :(
> Any suggestions?
>
> public void createPartControl(Composite parent) {
> GridLayout gl = new GridLayout();
>
> toolkit = new FormToolkit(parent.getDisplay());
> Form form = toolkit.createForm(parent);
> form.setText("Version Properties");
> form.getBody().setLayoutData(gl);
> toolkit.createButton(form.getBody(), "Checkbox", SWT.CHECK);
> form.getBody().setBackground(new Color(parent.getDisplay(),100,100,100));
> // Hyperlink link =
> toolkit.createHyperlink(form.getBody(),"moo",SWT.WRAP);
> }
> Tal.
>

Hello Tal,

You forgot to set the layout for the form body. E.g:

public void createPartControl(Composite parent) {
GridLayout gl = new GridLayout();

toolkit = new FormToolkit(parent.getDisplay());
Form form = toolkit.createForm(parent);
form.setText("Version Properties");
form.getBody().setLayoutData(gl);

form.getBody().setLayout(new RowLayout(SWT.VERTICAL)); // <----

toolkit.createButton(form.getBody(), "Checkbox", SWT.CHECK);
form.getBody().setBackground(new Color(parent.getDisplay(),100,100,100));
// Hyperlink link =
toolkit.createHyperlink(form.getBody(),"moo",SWT.WRAP);
}

Regards,

Michal Tkacz
Previous Topic:[ANN] MyEclipse New Release Supports Hibernate, Database Explorer, Struts Modeler and JSF 1.1
Next Topic:[RCP] Building Eclipse // Importing Plug-ins eradicates classpath src property
Goto Forum:
  


Current Time: Sat Nov 09 01:47:18 GMT 2024

Powered by FUDForum. Page generated in 0.02713 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top