01: /*******************************************************************************
02: * Copyright (c) 2004, 2007 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.core.runtime.ISafeRunnable;
13: import org.eclipse.core.runtime.IStatus;
14: import org.eclipse.ui.internal.WorkbenchPlugin;
15: import org.eclipse.ui.internal.misc.StatusUtil;
16:
17: /**
18: * The FullDecoratorRunnable is the ISafeRunnable that runs
19: * the full decorators
20: */
21: abstract class FullDecoratorRunnable implements ISafeRunnable {
22: protected Object element;
23:
24: protected FullDecoratorDefinition decorator;
25:
26: /**
27: * Set the values for the element and the decorator.
28: * @param object
29: * @param definition
30: */
31: protected void setValues(Object object,
32: FullDecoratorDefinition definition) {
33: element = object;
34: decorator = definition;
35:
36: }
37:
38: /*
39: * @see ISafeRunnable.handleException(Throwable).
40: */
41: public void handleException(Throwable 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: }
|