Dispose of an image within a Draw2D Label [message #214415] |
Mon, 17 April 2006 17:44 |
Eclipse User |
|
|
|
Originally posted by: aczerwonka.3esi.com
What's the best practice for disposing system resources when using a Draw2D
label? My model element knows what color and what image, but my controller
(EditPart) creates them as I don't want my model to manage system resources
and I wanted testable in headless mode. The EditPart interface doesn't
support a dispose method, so I'm looking for a "best practice".
-andy
|
|
|
Re: Dispose of an image within a Draw2D Label [message #214441 is a reply to message #214415] |
Mon, 17 April 2006 19:05 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
The best practice is to use a resource manager scoped at your editor.
Editparts do have a lifecycle. deactivate is always called. removeNotify()
is called when deleted.
Use a global resource manager for your entire plug-in. Use a nested local
manager for each editor instance. get the images using getImage, and clear
them using destroyImage().
"Andy Czerwonka" <aczerwonka@3esi.com> wrote in message
news:e20k54$ng4$1@utils.eclipse.org...
> What's the best practice for disposing system resources when using a
> Draw2D label? My model element knows what color and what image, but my
> controller (EditPart) creates them as I don't want my model to manage
> system resources and I wanted testable in headless mode. The EditPart
> interface doesn't support a dispose method, so I'm looking for a "best
> practice".
>
> -andy
>
|
|
|
Powered by
FUDForum. Page generated in 0.03211 seconds