Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

E4/EAS/Resource Management

< E4‎ | EAS
Revision as of 14:11, 24 October 2009 by Remysuen.ca.ibm.com (Talk | contribs) (New page: Components should be able to have resource allocation and deallocation performed for them transparently and the allocated resources should be shared amongst other components where possible...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Components should be able to have resource allocation and deallocation performed for them transparently and the allocated resources should be shared amongst other components where possible to keep memory footprint low.

Eclipse 3.x API

JFace exposes a resource manager that can assist with the management of SWT resources such as Colors, Fonts, and Images.

Allocation

LocalResourceManager resourceManager = new LocalResourceManager();
Image image = resourceManager.createImage(imageDescriptor);
button.setImage(image);

Deallocation

resourceManager.dispose();

Copyright © Eclipse Foundation, Inc. All Rights Reserved.