|
Eclipse Platform Release 3.7 |
|||||||||
| 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
public abstract class 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)
Deprecated. use createFrom(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)
createFrom(Color)
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)
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 ColorDescriptor
public final Object createResource(Device device)
throws DeviceResourceException
DeviceResourceDescriptor
createResource in class DeviceResourceDescriptordevice - the Device on which to allocate the resource
DeviceResourceException - if unable to allocate the resourcepublic final void destroyResource(Object previouslyCreatedObject)
DeviceResourceDescriptor
destroyResource in class DeviceResourceDescriptorpreviouslyCreatedObject - an object that was returned by an equal
descriptor in a previous call to createResource(...).
|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.