KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > decorators > FullImageDecoratorRunnable


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 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.ui.internal.decorators;
12
13 import org.eclipse.swt.graphics.Image;
14
15 /**
16  * The FullImageDecoratorRunnable is the runnable for decorating
17  * images
18  */

19 class FullImageDecoratorRunnable extends FullDecoratorRunnable {
20     Image result = null;
21
22     Image start;
23
24     /* (non-Javadoc)
25      * @see org.eclipse.core.runtime.ISafeRunnable#run()
26      */

27     public void run() throws Exception JavaDoc {
28         result = decorator.decorateImage(start, element);
29     }
30
31     /**
32      * Get the result of the decoration or <code>null</code>
33      * if there was a failure.
34      * @return Image
35      */

36     Image getResult() {
37         return result;
38     }
39
40     /**
41      * Set the values of the initialString and the decorator
42      * and object that are going to be used to determine the
43      * result.
44      * @param initialImage
45      * @param object
46      * @param definition
47      */

48     void setValues(Image initialImage, Object JavaDoc object,
49             FullDecoratorDefinition definition) {
50         setValues(object, definition);
51         start = initialImage;
52         result = null;
53     }
54
55
56     /**
57      * Clear decorator references.
58      * @since 3.1
59      */

60     void clearReferences() {
61         decorator = null;
62     }
63 }
64
Popular Tags