KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2004, 2007 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.core.runtime.ISafeRunnable;
14 import org.eclipse.core.runtime.IStatus;
15 import org.eclipse.ui.internal.WorkbenchPlugin;
16 import org.eclipse.ui.internal.misc.StatusUtil;
17
18 /**
19  * The FullDecoratorRunnable is the ISafeRunnable that runs
20  * the full decorators
21  */

22 abstract class FullDecoratorRunnable implements ISafeRunnable {
23     protected Object JavaDoc element;
24
25     protected FullDecoratorDefinition decorator;
26
27     /**
28      * Set the values for the element and the decorator.
29      * @param object
30      * @param definition
31      */

32     protected void setValues(Object JavaDoc object, FullDecoratorDefinition definition) {
33         element = object;
34         decorator = definition;
35
36     }
37
38     /*
39      * @see ISafeRunnable.handleException(Throwable).
40      */

41     public void handleException(Throwable JavaDoc exception) {
42         IStatus status = StatusUtil.newStatus(IStatus.ERROR, exception
43                 .getMessage(), exception);
44         WorkbenchPlugin.log("Exception in Decorator", status); //$NON-NLS-1$
45
decorator.crashDisable();
46     }
47
48 }
49
Popular Tags