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
9 * Christopher Lenz - initial API and implementation
11 * $Id: IColorManager.java,v 1.1 2004-09-02 18:11:51 jsurfer Exp $
14 package net.sourceforge.phpeclipse.css.ui.text;
16 import org.eclipse.jface.text.source.ISharedTextColors;
17 import org.eclipse.swt.graphics.Color;
18 import org.eclipse.swt.graphics.RGB;
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.
24 * TODO Find out whether this can be replaced with the JFace ColorRegistry
26 public interface IColorManager extends ISharedTextColors {
29 * Binds a color to the specified key.
31 * @param key the key to which the color should be bound
32 * @param rgb the color to bind to the key
34 void bindColor(String key, RGB rgb);
37 * Returns the color bound to a specific key.
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
43 Color getColor(String key);
46 * Unbinds (and disposes) a color.
48 * @param key the key to which the color was previously bound
50 void unbindColor(String key);