public final class LocalResourceManager extends ResourceManager
A nested registry can be used to manage the resources for, say, a dialog box.
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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
|
cancelDisposeExec, createColor, createColor, createFont, createImage, createImageWithDefault, destroyColor, destroyColor, destroyFont, destroyImage, disposeExecpublic 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.public Device getDevice()
ResourceManagergetDevice in class ResourceManagerprotected Object allocate(DeviceResourceDescriptor descriptor) throws DeviceResourceException
descriptor - identifier for the resource to allocateDeviceResourceExceptionprotected void deallocate(Object resource, DeviceResourceDescriptor descriptor)
resource - resource being deallocateddescriptor - identifier for the resourceprotected Image getDefaultImage()
ResourceManagergetDefaultImage in class ResourceManagerpublic final Object create(DeviceResourceDescriptor descriptor) throws DeviceResourceException
ResourceManagercreate in class ResourceManagerdescriptor - descriptor for the resource to allocateDeviceResourceException - if unable to allocate the resourcepublic final void destroy(DeviceResourceDescriptor descriptor)
ResourceManagerdestroy in class ResourceManagerdescriptor - identifier for the resourcepublic void dispose()
dispose in class ResourceManagerpublic Object find(DeviceResourceDescriptor descriptor)
ResourceManagerfind in class ResourceManagerdescriptor - descriptor to findGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.