01: /*******************************************************************************
02: * Copyright (c) 2004, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.decorators;
11:
12: import org.eclipse.swt.graphics.Image;
13:
14: /**
15: * The FullImageDecoratorRunnable is the runnable for decorating
16: * images
17: */
18: class FullImageDecoratorRunnable extends FullDecoratorRunnable {
19: Image result = null;
20:
21: Image start;
22:
23: /* (non-Javadoc)
24: * @see org.eclipse.core.runtime.ISafeRunnable#run()
25: */
26: public void run() throws Exception {
27: result = decorator.decorateImage(start, element);
28: }
29:
30: /**
31: * Get the result of the decoration or <code>null</code>
32: * if there was a failure.
33: * @return Image
34: */
35: Image getResult() {
36: return result;
37: }
38:
39: /**
40: * Set the values of the initialString and the decorator
41: * and object that are going to be used to determine the
42: * result.
43: * @param initialImage
44: * @param object
45: * @param definition
46: */
47: void setValues(Image initialImage, Object object,
48: FullDecoratorDefinition definition) {
49: setValues(object, definition);
50: start = initialImage;
51: result = null;
52: }
53:
54: /**
55: * Clear decorator references.
56: * @since 3.1
57: */
58: void clearReferences() {
59: decorator = null;
60: }
61: }
|