Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Disposing wizard page resources
Disposing wizard page resources [message #537396] Wed, 02 June 2010 10:16 Go to next message
Fadjer is currently offline Fadjer
Messages: 7
Registered: July 2009
Junior Member
Hello,

I was learning some tutorials about Wizard in Eclipse RCP. I see many examples and I noticed that we do not dispose top composite in a wizard page.

For example :
public void createControl(Composite parent) {
    // create the composite to hold the widgets   
  Composite topComposite = new Composite(parent, SWT.NONE);
  .....
  .....
  setControl(topComposite);		
}



In the rest of code, the topComposite is not disposed. So my question is : Should I disposing this composite ? wht is the exact role of setControl method ?

Thanks in advance.
Re: Disposing wizard page resources [message #537743 is a reply to message #537396] Thu, 03 June 2010 14:12 Go to previous messageGo to next message
Fadjer is currently offline Fadjer
Messages: 7
Registered: July 2009
Junior Member
Please help, I still looking for an answer ....
Re: Disposing wizard page resources [message #538014 is a reply to message #537743] Fri, 04 June 2010 13:50 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2151
Registered: July 2009
Senior Member
Controls are automatically disposed when their parent Control is disposed.
So you don't need to dispose your Composite because it will be auto-disposed
at the latest when the wizard Shell is disposed. It's primarily SWT
Graphics resources (GC, Image, Region, etc.) that you are responsible for
disposing after you create them, since they do not have a containment
hierarchy which would result in them being auto-disposed by a parent's
disposal.

For a more formal statement of these rules see
http://www.eclipse.org/articles/swt-design-2/swt-design-2.ht ml .

Grant


"Fadjer" <issam_sabir@yahoo.fr> wrote in message
news:hu8d8i$ecm$1@build.eclipse.org...
> Please help, I still looking for an answer ....
Previous Topic:Retrieving Menu Contributions programmatically
Next Topic:"Extract" the property view
Goto Forum:
  


Current Time: Fri Sep 19 13:55:09 GMT 2014

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

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