01: /*******************************************************************************
02: * Copyright (c) 2004, 2006 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.model;
11:
12: import org.eclipse.swt.graphics.FontData;
13: import org.eclipse.swt.graphics.RGB;
14:
15: /**
16: * Extension interface for <code>IWorkbenchAdapter</code> that allows for color
17: * and font support.
18: * <p>
19: * There is an associate label provider and content provider for showing
20: * elements with a registered workbench adapter in JFace structured viewers.
21: * </p>
22: * @see IWorkbenchAdapter
23: * @see WorkbenchLabelProvider
24: * @see BaseWorkbenchContentProvider
25: * @since 3.0
26: */
27: public interface IWorkbenchAdapter2 {
28:
29: /**
30: * Provides a foreground color for the given element.
31: *
32: * @param element the element
33: * @return the foreground color for the element, or <code>null</code>
34: * to use the default foreground color
35: */
36: public RGB getForeground(Object element);
37:
38: /**
39: * Provides a background color for the given element.
40: *
41: * @param element the element
42: * @return the background color for the element, or <code>null</code>
43: * to use the default background color
44: */
45: public RGB getBackground(Object element);
46:
47: /**
48: * Provides a font the given element.
49: *
50: * @param element the element
51: * @return the font for the element, or <code>null</code>
52: * to use the default font
53: */
54: public FontData getFont(Object element);
55:
56: }
|