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: /**
13: * FullTextDecoratorRunnable is the decorator that runs the text
14: * decoration.
15: */
16: public class FullTextDecoratorRunnable extends FullDecoratorRunnable {
17: String result = null;
18:
19: String start;
20:
21: /* (non-Javadoc)
22: * @see org.eclipse.core.runtime.ISafeRunnable#run()
23: */
24: public void run() throws Exception {
25: result = decorator.decorateText(start, element);
26: }
27:
28: /**
29: * Get the result of the decoration or <code>null</code>
30: * if there was a failure.
31: * @return the result
32: */
33: String getResult() {
34: return result;
35: }
36:
37: /**
38: * Set the values of the initialString and the decorator
39: * and object that are going to be used to determine the
40: * result.
41: * @param initialString
42: * @param object
43: * @param definition
44: */
45: void setValues(String initialString, Object object,
46: FullDecoratorDefinition definition) {
47: setValues(object, definition);
48: start = initialString;
49: result = null;
50: }
51:
52: /**
53: * Clear decorator references.
54: * @since 3.1
55: */
56: void clearReferences() {
57: decorator = null;
58: }
59: }
|