Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » [SWT] Remove children from a composite (special case)
[SWT] Remove children from a composite (special case) [message #560118] Tue, 21 September 2010 09:15 Go to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
Hello,

I know that this question has already been asked very often but none of the solutions could be applied in my case.

Let me first explain what I am trying to do: I would like to create a widget that display graphical elements (to simplify, it will be a "list" of images, all images are put next to each other). This content of the list will of course change at runtime (some images will be added, other will be removed, an image can be moved inside the list, ...). I made this list a ScrolledComposite with a single composite as content. Then I add the images (a Label for now, but it will probably be a custom composite later) to this composite. I made my own layout in order to position the images properly (according to a specific size for instance).

Now, how could I manage the removal of images on the list ? I tried to call the dispose method of the Label. This works only partially because the composite is not visible anymore but it is still taken into account by my layout (so, I have a blank image instead). I need to remove the composite from the list of children, is there a way to do that ? Or am I abusing SWT here ? How would you implement something like that ?

Thanks
Re: [SWT] Remove children from a composite (special case) [message #560121 is a reply to message #560118] Tue, 21 September 2010 09:27 Go to previous messageGo to next message
Francis Upton IV is currently offline Francis Upton IVFriend
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
If you are using the GridLayout, set the 'exluded' field in the GridData to true.

Re: [SWT] Remove children from a composite (special case) [message #560125 is a reply to message #560118] Tue, 21 September 2010 09:34 Go to previous message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
No, as I said I created my own layout manager.
And I don't really want to use the same technique because the images will be updated regularly and I don't want to end up with a huge list of children in which only a couple are still valid. It feels very wrong.
But maybe, as I said, I am abusing SWT here. How would you implement something like that ?
Previous Topic:Editor maximize shortcut for RCP apps
Next Topic:ViewPart and ViewPane
Goto Forum:
  


Current Time: Fri Mar 29 00:10:00 GMT 2024

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

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

Back to the top