Changes:
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / ui / text / IColorManager.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2001 International Business Machines Corp. 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  *     IBM Corporation - initial API and implementation
10  ******************************************************************************/
11 package net.sourceforge.phpdt.ui.text;
12
13 import org.eclipse.jface.text.source.ISharedTextColors;
14 import org.eclipse.swt.graphics.Color;
15 import org.eclipse.swt.graphics.RGB;
16
17
18 /**
19  * Manages SWT color objects for given color keys and
20  * given <code>RGB</code> objects. Until the <code>dispose</code> 
21  * method is called, the same color object is returned for
22  * equal keys and equal <code>RGB</code> values.
23  * <p>
24  * This interface may be implemented by clients.
25  * </p>
26  *
27  * @see IJavaColorConstants
28  */
29 public interface IColorManager extends ISharedTextColors {
30         
31         /**
32          * Returns a color object for the given key. The color objects 
33          * are remembered internally; the same color object is returned 
34          * for equal keys.
35          *
36          * @param key the color key
37          * @return the color object for the given key
38          */
39         Color getColor(String key);
40         
41         /**
42          * Returns the color object for the value represented by the given
43          * <code>RGB</code> object.
44          *
45          * @param rgb the rgb color specification
46          * @return the color object for the given rgb value
47          */
48         Color getColor(RGB rgb);        
49         
50         /**
51          * Disposes all color objects remembered by this color manager.
52          */
53         void dispose();
54 }