Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Eclipse forms question: How do I swap in/out a Section or a SectionPart
Eclipse forms question: How do I swap in/out a Section or a SectionPart [message #305924] Mon, 17 July 2006 04:35 Go to next message
Alex Le is currently offline Alex LeFriend
Messages: 649
Registered: July 2009
Senior Member
Hi,

I have a form editor. Depending on the user's choice, I can swap out a
Section and swap in another Section to take place of the swapped out
Section.

I can't seem to make that work...I use
IManagedForm.addPart()/removePart(). But, that does not work.

I have noticed that creating a SectionPart will immediately put in my
form, one after another.

Please advise.

Thanks
Re: Eclipse forms question: How do I swap in/out a Section or a SectionPart [message #305987 is a reply to message #305924] Mon, 17 July 2006 14:46 Go to previous messageGo to next message
Sunny Sun is currently offline Sunny SunFriend
Messages: 12
Registered: July 2009
Junior Member
Have you tried to call some layout method to revalidate those sections'
parent?

Sunny Sun

"AL" <unbonnevie@yahoo.com> ??????:e9f42k$r7p$1@utils.eclipse.org...
> Hi,
>
> I have a form editor. Depending on the user's choice, I can swap out a
> Section and swap in another Section to take place of the swapped out
> Section.
>
> I can't seem to make that work...I use
> IManagedForm.addPart()/removePart(). But, that does not work.
>
> I have noticed that creating a SectionPart will immediately put in my
> form, one after another.
>
> Please advise.
>
> Thanks
Re: Eclipse forms question: How do I swap in/out a Section or a SectionPart [message #305990 is a reply to message #305924] Mon, 17 July 2006 15:11 Go to previous messageGo to next message
Curtis d'Entremont is currently offline Curtis d'EntremontFriend
Messages: 42
Registered: July 2009
Member
Try doing a reflow();
Re: Eclipse forms question: How do I swap in/out a Section or a SectionPart [message #305997 is a reply to message #305990] Mon, 17 July 2006 16:55 Go to previous messageGo to next message
Alex Le is currently offline Alex LeFriend
Messages: 649
Registered: July 2009
Senior Member
curtispd@ca.ibm.com wrote:
> Try doing a reflow();

I did the above after doing IManagedForm.removePart(myPart). Still does
not work. :-(
Re: Eclipse forms question: How do I swap in/out a Section or a SectionPart [message #306003 is a reply to message #305987] Mon, 17 July 2006 21:33 Go to previous messageGo to next message
Alex Le is currently offline Alex LeFriend
Messages: 649
Registered: July 2009
Senior Member
sunnyawake wrote:

> Have you tried to call some layout method to revalidate those sections'
> parent?
>
> Sunny Sun
>
> "AL" <unbonnevie@yahoo.com> ??????:e9f42k$r7p$1@utils.eclipse.org...
>
>>Hi,
>>
>>I have a form editor. Depending on the user's choice, I can swap out a
>>Section and swap in another Section to take place of the swapped out
>>Section.
>>
>>I can't seem to make that work...I use
>>IManagedForm.addPart()/removePart(). But, that does not work.
>>
>>I have noticed that creating a SectionPart will immediately put in my
>>form, one after another.
>>
>>Please advise.
>>
>>Thanks
>
>
>

I also tried section.getParent().redraw()...No help. Any more idea?
Thanks.
Re: Eclipse forms question: How do I swap in/out a Section or a SectionPart [message #306004 is a reply to message #305997] Mon, 17 July 2006 22:34 Go to previous messageGo to next message
Alex Le is currently offline Alex LeFriend
Messages: 649
Registered: July 2009
Senior Member
AL wrote:

> curtispd@ca.ibm.com wrote:
>
>> Try doing a reflow();
>
>
> I did the above after doing IManagedForm.removePart(myPart). Still does
> not work. :-(

Ok, the swapped out Section MUST be disposed as well to get the things
work correctly...Urggg....Took me a lot of time to find out, unfortunately.
Re: Eclipse forms question: How do I swap in/out a Section or a SectionPart [message #306175 is a reply to message #306004] Mon, 24 July 2006 18:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: denpark.cisco.com

An alternative solution would be to set the form's content onto a set of
composites,..these composites can then be hosted on a CTabFolder, and
CTabItems... then based on some selection condition, you can swap using a
stacklayout.

"AL" <unbonnevie@yahoo.com> wrote in message
news:e9h38p$12n$1@utils.eclipse.org...
> AL wrote:
>
>> curtispd@ca.ibm.com wrote:
>>
>>> Try doing a reflow();
>>
>>
>> I did the above after doing IManagedForm.removePart(myPart). Still does
>> not work. :-(
>
> Ok, the swapped out Section MUST be disposed as well to get the things
> work correctly...Urggg....Took me a lot of time to find out,
> unfortunately.
Re: Eclipse forms question: How do I swap in/out a Section or a SectionPart [message #536395 is a reply to message #306175] Fri, 28 May 2010 01:24 Go to previous message
Hemant Singh is currently offline Hemant SinghFriend
Messages: 24
Registered: January 2010
Junior Member
If because of some reason, you can't use the CTabFolder or ScrolledPageBook, than another alternative solution can be search for the Composite in which the section have formpart's and manually dispose all the controls there like

//Get all the controls in the section
// It will be usually 3
Control[] children = getSection().getChildren();
for (Control child:children)
{
// One child control will be composite in which all the formpart components are present.
if (child instanceof Composite) {
Control[] subChildren = ((Composite)child).getChildren();
for (Control subChild:subChildren)
{
// dispose all the component.
subChild.dispose();
}
}
}


This approach is definitely very raw, and not suggested and should be used only if you don't have any other work around.
Previous Topic:info ...
Next Topic:attach eclipse source
Goto Forum:
  


Current Time: Sat Nov 22 03:18:28 GMT 2014

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

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