Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Adding section in a section ?
Adding section in a section ? [message #455933] Mon, 23 May 2005 13:12 Go to next message
Eclipse UserFriend
Originally posted by: jerome.bourgeon.bull.net

Hi, i'm a newbie with the rcp and swt :D

My problem is, i want to add a section in a section in my rcp apps
so i use the method createSection(composite parent,...,...) I want to
add section3 into section2 so i use sectionClient2 who is the composite
for the section2
But i have :
Unhandled event loop exception
Reason:
java.lang.ClassCastException

Thx a lot for you response

Here my code (maybe i want to do something impossible?)

Section section2;
Section section3;
Composite sectionClient2;
Composite sectionClient3;

section2 =
toolkit.createSection(form.getBody(),Section.DESCRIPTION|Sec tion.TWISTIE|Section.EXPANDED);
td = new TableWrapData();
section2.setLayoutData(td);
section2.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
form.reflow(true);
}
});
section2.setText("text1");
toolkit.createCompositeSeparator(section2);
section2.setDescription("text2");
sectionClient2 = toolkit.createComposite(section2);
gl = new GridLayout(2,true);

sectionClient2.setLayout(gl);

>>>>>>>>here i think the problem
section3 =
toolkit.createSection(sectionClient2,Section.DESCRIPTION|Sec tion.TWISTIE|Section.EXPANDED);
td = new TableWrapData();

section3.setLayoutData(td);
section3.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
form.reflow(true);
}
});
section3.setText("text3");
toolkit.createCompositeSeparator(section3);
section3.setDescription("text4");
sectionClient3 = toolkit.createComposite(section3);
section3.setClient(sectionClient3);


section2.setClient(sectionClient2);
Re: Adding section in a section ? [message #455934 is a reply to message #455933] Mon, 23 May 2005 14:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jerome.bourgeon.bull.net

Excuse me my code is false : i do
>td = new TableWrapData();
>section3.setLayoutData(td);
instead of
tw = new GridData();
section3.setLayoutData(tw);




Bourgeon Jérôme wrote:
> Hi, i'm a newbie with the rcp and swt :D
>
> My problem is, i want to add a section in a section in my rcp apps
> so i use the method createSection(composite parent,...,...) I want to
> add section3 into section2 so i use sectionClient2 who is the composite
> for the section2
> But i have :
> Unhandled event loop exception
> Reason:
> java.lang.ClassCastException
>
> Thx a lot for you response
>
> Here my code (maybe i want to do something impossible?)
>
> Section section2;
> Section section3;
> Composite sectionClient2;
> Composite sectionClient3;
>
> section2 =
> toolkit.createSection(form.getBody(),Section.DESCRIPTION|Sec tion.TWISTIE|Section.EXPANDED);
>
> td = new TableWrapData();
> section2.setLayoutData(td);
> section2.addExpansionListener(new ExpansionAdapter() {
> public void expansionStateChanged(ExpansionEvent e) {
> form.reflow(true);
> }
> });
> section2.setText("text1");
> toolkit.createCompositeSeparator(section2);
> section2.setDescription("text2");
> sectionClient2 = toolkit.createComposite(section2);
> gl = new GridLayout(2,true);
>
> sectionClient2.setLayout(gl);
>
> >>>>>>>>here i think the problem
> section3 =
> toolkit.createSection(sectionClient2,Section.DESCRIPTION|Sec tion.TWISTIE|Section.EXPANDED);
>
> td = new TableWrapData();
>
> section3.setLayoutData(td);
> section3.addExpansionListener(new ExpansionAdapter() {
> public void expansionStateChanged(ExpansionEvent e) {
> form.reflow(true);
> }
> });
> section3.setText("text3");
> toolkit.createCompositeSeparator(section3);
> section3.setDescription("text4");
> sectionClient3 = toolkit.createComposite(section3);
> section3.setClient(sectionClient3);
>
>
> section2.setClient(sectionClient2);
Re: Adding section in a section ? [message #455936 is a reply to message #455933] Mon, 23 May 2005 15:18 Go to previous message
bin is currently offline binFriend
Messages: 13
Registered: July 2009
Junior Member
Bourgeon Jérôme wrote:

> Hi, i'm a newbie with the rcp and swt :D

> My problem is, i want to add a section in a section in my rcp apps
> so i use the method createSection(composite parent,...,...) I want to
> add section3 into section2 so i use sectionClient2 who is the composite
> for the section2
> But i have :
> Unhandled event loop exception
> Reason:
> java.lang.ClassCastException

> Thx a lot for you response

> Here my code (maybe i want to do something impossible?)

> Section section2;
> Section section3;
> Composite sectionClient2;
> Composite sectionClient3;

> section2 =
>
toolkit.createSection(form.getBody(),Section.DESCRIPTION|Sec tion.TWISTIE|Section.EXPANDED);
> td = new TableWrapData();
> section2.setLayoutData(td);
> section2.addExpansionListener(new ExpansionAdapter() {
> public void expansionStateChanged(ExpansionEvent e) {
> form.reflow(true);
> }
> });
> section2.setText("text1");
> toolkit.createCompositeSeparator(section2);
> section2.setDescription("text2");
> sectionClient2 = toolkit.createComposite(section2);
> gl = new GridLayout(2,true);

> sectionClient2.setLayout(gl);

> >>>>>>>>here i think the problem
> section3 =
>
toolkit.createSection(sectionClient2,Section.DESCRIPTION|Sec tion.TWISTIE|Section.EXPANDED);




> td = new TableWrapData();

> section3.setLayoutData(td);


you should remove above code.


> section3.addExpansionListener(new ExpansionAdapter() {
> public void expansionStateChanged(ExpansionEvent e) {
> form.reflow(true);
> }
> });
> section3.setText("text3");
> toolkit.createCompositeSeparator(section3);
> section3.setDescription("text4");
> sectionClient3 = toolkit.createComposite(section3);
> section3.setClient(sectionClient3);


> section2.setClient(sectionClient2);
Previous Topic:Virtual Table
Next Topic:Equal Height widgets on PocketPC
Goto Forum:
  


Current Time: Fri Apr 26 18:34:45 GMT 2024

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

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

Back to the top