KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > resource > DeviceResourceDescriptor


1 /*******************************************************************************
2  * Copyright (c) 2004, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.resource;
12
13 import org.eclipse.swt.graphics.Device;
14
15 /**
16  * Instances of this class can allocate and dispose SWT resources. Each
17  * instance describes a particular resource (such as a Color, Font, or Image)
18  * and can create and destroy that resource on demand. DeviceResourceDescriptors
19  * are managed by a ResourceRegistry.
20  *
21  * @see org.eclipse.jface.resource.ResourceManager
22  *
23  * @since 3.1
24  */

25 public abstract class DeviceResourceDescriptor {
26     /**
27      * Creates the resource described by this descriptor
28      *
29      * @since 3.1
30      *
31      * @param device the Device on which to allocate the resource
32      * @return the newly allocated resource (not null)
33      * @throws DeviceResourceException if unable to allocate the resource
34      */

35     public abstract Object JavaDoc createResource(Device device);
36     
37     /**
38      * Undoes everything that was done by a previous call to create(...), given
39      * the object that was returned by create(...).
40      *
41      * @since 3.1
42      *
43      * @param previouslyCreatedObject an object that was returned by an equal
44      * descriptor in a previous call to createResource(...).
45      */

46     public abstract void destroyResource(Object JavaDoc previouslyCreatedObject);
47 }
48
Popular Tags