|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.resource.ResourceManager
org.eclipse.jface.resource.AbstractResourceManager
org.eclipse.jface.resource.LocalResourceManager
A local registry that shares its resources with some global registry. NestedSWTRegistry is typically used to safeguard against leaks. Clients can use a nested registry to allocate and deallocate resources in the global registry. Calling dispose() on the nested registry will deallocate everything allocated for the nested registry without affecting the rest of the global registry.
A nested registry can be used to manage the resources for, say, a dialog box.
Constructor Summary | |
---|---|
LocalResourceManager(ResourceManager parentRegistry)
Creates a local registry that delegates to the given global registry for all resource allocation and deallocation. |
|
LocalResourceManager(ResourceManager parentRegistry,
Control owner)
Creates a local registry that wraps the given global registry. |
Method Summary | |
---|---|
protected Object |
allocate(DeviceResourceDescriptor descriptor)
Called the first time a resource is requested. |
Object |
create(DeviceResourceDescriptor descriptor)
Returns the resource described by the given descriptor. |
protected void |
deallocate(Object resource,
DeviceResourceDescriptor descriptor)
Called the last time a resource is dereferenced. |
void |
destroy(DeviceResourceDescriptor descriptor)
Deallocates a resource previously allocated by create(...). |
void |
dispose()
Deallocates any resources allocated by this registry that have not yet been deallocated. |
Object |
find(DeviceResourceDescriptor descriptor)
Returns a previously allocated resource associated with the given descriptor, or null if none exists yet. |
protected Image |
getDefaultImage()
Returns the default image that will be returned in the event that the intended image is missing. |
Device |
getDevice()
Returns the Device for which this ResourceManager will create resources |
Methods inherited from class org.eclipse.jface.resource.ResourceManager |
---|
cancelDisposeExec, createColor, createColor, createFont, createImage, createImageWithDefault, destroyColor, destroyColor, destroyFont, destroyImage, disposeExec |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LocalResourceManager(ResourceManager parentRegistry)
parentRegistry
- global registrypublic LocalResourceManager(ResourceManager parentRegistry, Control owner)
parentRegistry
- global registry that handles resource allocationowner
- control whose disposal will trigger cleanup of everything
in the registry.Method Detail |
public Device getDevice()
ResourceManager
getDevice
in class ResourceManager
protected Object allocate(DeviceResourceDescriptor descriptor) throws DeviceResourceException
org.eclipse.jface.resource.AbstractResourceManager
descriptor
- identifier for the resource to allocate
DeviceResourceException
protected void deallocate(Object resource, DeviceResourceDescriptor descriptor)
org.eclipse.jface.resource.AbstractResourceManager
resource
- resource being deallocateddescriptor
- identifier for the resourceprotected Image getDefaultImage()
ResourceManager
getDefaultImage
in class ResourceManager
public final Object create(DeviceResourceDescriptor descriptor) throws DeviceResourceException
ResourceManager
create
in class ResourceManager
descriptor
- descriptor for the resource to allocate
DeviceResourceException
- if unable to allocate the resourcepublic final void destroy(DeviceResourceDescriptor descriptor)
ResourceManager
destroy
in class ResourceManager
descriptor
- identifier for the resourcepublic void dispose()
dispose
in class ResourceManager
public Object find(DeviceResourceDescriptor descriptor)
ResourceManager
find
in class ResourceManager
descriptor
- descriptor to find
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.