Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Grid Layout
Grid Layout [message #52032] Wed, 25 March 2009 16:00 Go to next message
Katharina Brandl is currently offline Katharina BrandlFriend
Messages: 14
Registered: July 2009
Junior Member
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 16:11 Go to previous messageGo to next message
Katharina Brandl is currently offline Katharina BrandlFriend
Messages: 14
Registered: July 2009
Junior Member
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 05:34 Go to previous messageGo to next message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 84
Registered: July 2009
Member
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 07:15 Go to previous messageGo to next message
Katharina Brandl is currently offline Katharina BrandlFriend
Messages: 14
Registered: July 2009
Junior Member
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 08:04 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
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 08:31 Go to previous message
Katharina Brandl is currently offline Katharina BrandlFriend
Messages: 14
Registered: July 2009
Junior Member
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 16:11 Go to previous message
Katharina Brandl is currently offline Katharina BrandlFriend
Messages: 14
Registered: July 2009
Junior Member
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 05:34 Go to previous message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 84
Registered: July 2009
Member
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 07:15 Go to previous message
Katharina Brandl is currently offline Katharina BrandlFriend
Messages: 14
Registered: July 2009
Junior Member
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 08:04 Go to previous message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
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 08:31 Go to previous message
Katharina Brandl is currently offline Katharina BrandlFriend
Messages: 14
Registered: July 2009
Junior Member
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: Fri Dec 19 21:49:12 GMT 2014

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

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