Skip to main content



      Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Grid Layout
Grid Layout [message #52032] Wed, 25 March 2009 12:00 Go to next message
Eclipse UserFriend
Hi,

I'm implementing an Wizard Page extending the class WizardPage. In the
createControl method I have the following code:
public void createControl(Composite parent) {
Composite composite1 = createComposite(parent,2);
new Label(composite1,SWT.NULL).setText("class name:");
className = createTextField(composite1);
className.addModifyListener(new TextModifyListener());

textChanged();

Composite composite2 = createComposite(parent,1);
composite2.setVisible(true);
new EiffelContainerSelectionGroup(composite2,null);

setControl(parent);
}

the problem is: the second composite is not showing up inside the Wizard
Page - only the first one.

the createComposite method looks as follows:

private Composite createComposite(Composite parent, int columns){
Composite composite = new Composite(parent,SWT.NULL);
GridLayout layout = new GridLayout();
layout.numColumns = columns;
composite.setLayout(layout);

GridData data = new GridData();
data.horizontalAlignment=SWT.FILL;
data.grabExcessHorizontalSpace=true;
//data.verticalAlignment=SWT.FILL;
composite.setLayoutData(data);
return composite;
}

Does anyone know, where the problem is? I've tried to put the two
composites inside a top-level composite and with that both composites
appeared but the result didn't look like I expected it to do. Although I
specified only one column for the top Level composite, all widgets were on
the left side of the page...

Kind regards, Kathi
Re: Grid Layout [message #52060 is a reply to message #52032] Wed, 25 March 2009 12:11 Go to previous messageGo to next message
Eclipse UserFriend
it's me again,

I tried to modify the GridData a bit and now it works with the extra
top-Level Composite.
But it shouldn't it work without this extra composite, too?

regards, Kathi
Re: Grid Layout [message #52085 is a reply to message #52060] Thu, 26 March 2009 01:34 Go to previous messageGo to next message
Eclipse UserFriend
Katharina Brandl wrote:
> it's me again,
>
> I tried to modify the GridData a bit and now it works with the extra
> top-Level Composite.
> But it shouldn't it work without this extra composite, too?
>
> regards, Kathi
>
You problem has more chances of getting resolved at SWT newsgroup eclipse.platform.swt
Am not SWT guru, but it looks like you were facing this issue either due to incorrect spanning (hspan) or incorrect nesting of composites. Like I said - i don't know for sure.

Ankur..
Re: Grid Layout [message #52110 is a reply to message #52085] Thu, 26 March 2009 03:15 Go to previous messageGo to next message
Eclipse UserFriend
ok, I'll try it there - thanks for the idea,

kathi
Re: Grid Layout [message #52136 is a reply to message #52032] Thu, 26 March 2009 04:04 Go to previous messageGo to next message
Eclipse UserFriend
shouldn't you call setControl() with *your* top level composite and not with
the parent that is passed to you?

- Prakash
--
http://blog.eclipse-tips.com
Re: Grid Layout [message #53170 is a reply to message #52136] Thu, 02 April 2009 04:31 Go to previous message
Eclipse UserFriend
Prakash G.R. wrote:

> shouldn't you call setControl() with *your* top level composite and not with
> the parent that is passed to you?

> - Prakash

Yes, that was the initial problem: I have to create only one control and
pass it to the parent. Evertything else should be inside this new top
level control.

thanks for your help
Kathi
Re: Grid Layout [message #593975 is a reply to message #52032] Wed, 25 March 2009 12:11 Go to previous message
Eclipse UserFriend
it's me again,

I tried to modify the GridData a bit and now it works with the extra
top-Level Composite.
But it shouldn't it work without this extra composite, too?

regards, Kathi
Re: Grid Layout [message #593984 is a reply to message #52060] Thu, 26 March 2009 01:34 Go to previous message
Eclipse UserFriend
Katharina Brandl wrote:
> it's me again,
>
> I tried to modify the GridData a bit and now it works with the extra
> top-Level Composite.
> But it shouldn't it work without this extra composite, too?
>
> regards, Kathi
>
You problem has more chances of getting resolved at SWT newsgroup eclipse.platform.swt
Am not SWT guru, but it looks like you were facing this issue either due to incorrect spanning (hspan) or incorrect nesting of composites. Like I said - i don't know for sure.

Ankur..
Re: Grid Layout [message #593993 is a reply to message #52085] Thu, 26 March 2009 03:15 Go to previous message
Eclipse UserFriend
ok, I'll try it there - thanks for the idea,

kathi
Re: Grid Layout [message #593997 is a reply to message #52032] Thu, 26 March 2009 04:04 Go to previous message
Eclipse UserFriend
shouldn't you call setControl() with *your* top level composite and not with
the parent that is passed to you?

- Prakash
--
http://blog.eclipse-tips.com
Re: Grid Layout [message #594471 is a reply to message #52136] Thu, 02 April 2009 04:31 Go to previous message
Eclipse UserFriend
Prakash G.R. wrote:

> shouldn't you call setControl() with *your* top level composite and not with
> the parent that is passed to you?

> - Prakash

Yes, that was the initial problem: I have to create only one control and
pass it to the parent. Evertything else should be inside this new top
level control.

thanks for your help
Kathi
Previous Topic:Plugin build and listing dependencies
Next Topic:Writing to stdout
Goto Forum:
  


Current Time: Sun Jul 13 00:27:17 EDT 2025

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

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

Back to the top