KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > viewers > ITableColorProvider


1 /*******************************************************************************
2  * Copyright (c) 2004, 2006 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  * Initial implementation - Gunnar Ahlberg (IBS AB, www.ibs.net)
10  * IBM Corporation - further revisions
11  *******************************************************************************/

12
13 package org.eclipse.jface.viewers;
14
15 import org.eclipse.swt.graphics.Color;
16
17 /**
18  * Interface to provide color representation for a given cell within
19  * the row for an element in a table.
20  * @since 3.1
21  */

22 public interface ITableColorProvider {
23
24     /**
25      * Provides a foreground color for the given element.
26      *
27      * @param element the element
28      * @param columnIndex the zero-based index of the column in which
29      * the color appears
30      * @return the foreground color for the element, or <code>null</code> to
31      * use the default foreground color
32      */

33     Color getForeground(Object JavaDoc element, int columnIndex);
34
35     /**
36      * Provides a background color for the given element at the specified index
37      *
38      * @param element the element
39      * @param columnIndex the zero-based index of the column in which the color appears
40      * @return the background color for the element, or <code>null</code> to
41      * use the default background color
42      *
43      */

44     Color getBackground(Object JavaDoc element, int columnIndex);
45 }
46
Popular Tags