|
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.DeviceResourceDescriptor
org.eclipse.jface.resource.ColorDescriptor
Lightweight descriptor for an SWT color. Each ColorDescriptor will create a particular SWT Color on demand. This object will be compared so hashCode(...) and equals(...) must return meaningful values.
Constructor Summary | |
---|---|
ColorDescriptor()
|
Method Summary | |
---|---|
abstract Color |
createColor(Device device)
Returns the Color described by this descriptor. |
static ColorDescriptor |
createFrom(Color toCreate)
Creates a ColorDescriptor from an existing color. |
static ColorDescriptor |
createFrom(Color toCreate,
Device originalDevice)
Creates a ColorDescriptor from an existing Color, given the Device associated with the original Color. |
static ColorDescriptor |
createFrom(RGB toCreate)
Returns a color descriptor for the given RGB values |
Object |
createResource(Device device)
Creates the resource described by this descriptor |
abstract void |
destroyColor(Color toDestroy)
Undoes whatever was done by createColor. |
void |
destroyResource(Object previouslyCreatedObject)
Undoes everything that was done by a previous call to create(...), given the object that was returned by create(...). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ColorDescriptor()
Method Detail |
public static ColorDescriptor createFrom(Color toCreate, Device originalDevice)
toCreate
- Color to convert into a ColorDescriptor.originalDevice
- this must be the same Device that was passed into the
original Color's constructor.
public static ColorDescriptor createFrom(Color toCreate)
This is less efficient than createFrom(Color, Device)
, so this
version should only be used in situations where the device associated
with the color is unknown.
toCreate
- Color to generate a ColorDescriptor from
public static ColorDescriptor createFrom(RGB toCreate)
toCreate
- RGB values to create
public abstract Color createColor(Device device) throws DeviceResourceException
device
- SWT device on which to allocate the Color
DeviceResourceException
- if unable to allocate the Colorpublic abstract void destroyColor(Color toDestroy)
toDestroy
- a Color that was previously allocated by an equal ColorDescriptorpublic final Object createResource(Device device) throws DeviceResourceException
DeviceResourceDescriptor
createResource
in class DeviceResourceDescriptor
device
- the Device on which to allocate the resource
DeviceResourceException
- if unable to allocate the resourcepublic final void destroyResource(Object previouslyCreatedObject)
DeviceResourceDescriptor
destroyResource
in class DeviceResourceDescriptor
previouslyCreatedObject
- an object that was returned by an equal
descriptor in a previous call to createResource(...).
|
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.