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: * Initial implementation - Gunnar Ahlberg (IBS AB, www.ibs.net)
10: * IBM Corporation - further revisions
11: *******************************************************************************/package org.eclipse.jface.viewers;
12:
13: import org.eclipse.swt.graphics.Color;
14:
15: /**
16: * Interface to provide color representation for a given cell within
17: * the row for an element in a table.
18: * @since 3.1
19: */
20: public interface ITableColorProvider {
21:
22: /**
23: * Provides a foreground color for the given element.
24: *
25: * @param element the element
26: * @param columnIndex the zero-based index of the column in which
27: * the color appears
28: * @return the foreground color for the element, or <code>null</code> to
29: * use the default foreground color
30: */
31: Color getForeground(Object element, int columnIndex);
32:
33: /**
34: * Provides a background color for the given element at the specified index
35: *
36: * @param element the element
37: * @param columnIndex the zero-based index of the column in which the color appears
38: * @return the background color for the element, or <code>null</code> to
39: * use the default background color
40: *
41: */
42: Color getBackground(Object element, int columnIndex);
43: }
|