intial source from ttp://www.sf.net/projects/wdte
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.css.ui / src / net / sourceforge / phpeclipse / css / ui / text / IColorManager.java
1 /*
2  * Copyright (c) 2003-2004 Christopher Lenz and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *   Christopher Lenz - initial API and implementation
10  * 
11  * $Id: IColorManager.java,v 1.1 2004-09-02 18:11:51 jsurfer Exp $
12  */
13
14 package net.sourceforge.phpeclipse.css.ui.text;
15
16 import org.eclipse.jface.text.source.ISharedTextColors;
17 import org.eclipse.swt.graphics.Color;
18 import org.eclipse.swt.graphics.RGB;
19
20 /**
21  * Extends the <code>ISharedTextColors</code> interface by providing methods
22  * to bind and unbind colors to specific keys, and retrieve the colors by key.
23  * 
24  * TODO Find out whether this can be replaced with the JFace ColorRegistry
25  */
26 public interface IColorManager extends ISharedTextColors {
27
28         /**
29          * Binds a color to the specified key.
30          * 
31          * @param key the key to which the color should be bound
32          * @param rgb the color to bind to the key
33          */
34         void bindColor(String key, RGB rgb);
35
36         /**
37          * Returns the color bound to a specific key.
38          * 
39          * @param key the key to which the color was previously bound
40          * @return the color bound to the specified key, or <code>null</code> if no
41          *         color was bound to that key
42          */
43         Color getColor(String key);
44
45         /**
46          * Unbinds (and disposes) a color.
47          * 
48          * @param key the key to which the color was previously bound
49          */
50         void unbindColor(String key);
51
52 }