Adding section in a section ? [message #455933] |
Mon, 23 May 2005 13:12 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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);
|
|
|
|
Powered by
FUDForum. Page generated in 0.03226 seconds