KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
14  * FullTextDecoratorRunnable is the decorator that runs the text
15  * decoration.
16  */

17 public class FullTextDecoratorRunnable extends FullDecoratorRunnable {
18     String JavaDoc result = null;
19
20     String JavaDoc start;
21
22     /* (non-Javadoc)
23      * @see org.eclipse.core.runtime.ISafeRunnable#run()
24      */

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

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

46     void setValues(String JavaDoc initialString, Object JavaDoc object,
47             FullDecoratorDefinition definition) {
48         setValues(object, definition);
49         start = initialString;
50         result = null;
51     }
52
53     /**
54      * Clear decorator references.
55      * @since 3.1
56      */

57     void clearReferences() {
58         decorator = null;
59     }
60 }
61
Popular Tags