Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Dispose of an image within a Draw2D Label
Dispose of an image within a Draw2D Label [message #214415] Mon, 17 April 2006 17:44 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:Removing children reference
Next Topic:simple gef example, select figure
Goto Forum:
  


Current Time: Sun Dec 04 15:17:06 GMT 2022

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

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

Back to the top