Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Reordering children.
Reordering children. [message #976570] Thu, 08 November 2012 12:30 Go to next message
Mauro Condarelli is currently offline Mauro Condarelli
Messages: 415
Registered: September 2009
Senior Member
Hi, in an RCP application I would like to have a stack of ExpandableComposite (Forms Section is what I'm aiming to, but other equvalents are ok) that fulfills a couple of additional requirements:

1) It should be easy to programmatically add and remove items.
This shouldn't be a problem even with Sections.

2) It should be possible to reorder the items.
Since the list can grow a lot I would like to offer "MRU on top" reordering.
This is where I'm currently stuck.

Completely destroying and re-adding a Composite isn't an option because composites can hold valuable information I'm not in position to safely save at reordering time (i.e.: I can do it, of course, but it would be a major PITA, so I keep it as "last resort").

What is the recommended way to achieve this?

Regards
Mauro
Re: Reordering children. [message #978171 is a reply to message #976570] Fri, 09 November 2012 17:15 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
Hi Mauro,

I think Control.moveAbove()/moveBelow() is what you want, example
snippet:
git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet6.java
.. The snippet creates a new control and then changes its Z-ordering,
but of course this can also be done with existing controls as well.

If this does not help your case then please follow up.

Grant


On 11/8/2012 12:30 PM, Mauro Condarelli wrote:
> Hi, in an RCP application I would like to have a stack of
> ExpandableComposite (Forms Section is what I'm aiming to, but other
> equvalents are ok) that fulfills a couple of additional requirements:
>
> 1) It should be easy to programmatically add and remove items.
> This shouldn't be a problem even with Sections.
>
> 2) It should be possible to reorder the items.
> Since the list can grow a lot I would like to offer "MRU on top"
> reordering.
> This is where I'm currently stuck.
>
> Completely destroying and re-adding a Composite isn't an option because
> composites can hold valuable information I'm not in position to safely
> save at reordering time (i.e.: I can do it, of course, but it would be a
> major PITA, so I keep it as "last resort").
>
> What is the recommended way to achieve this?
>
> Regards
> Mauro
Previous Topic:Build SWT JNI libraries for Windows
Next Topic:regarding implementation of "Run In BackGround" feature in wizard
Goto Forum:
  


Current Time: Tue Jul 22 21:55:13 EDT 2014

Powered by FUDForum. Page generated in 0.01951 seconds