* Contributors:
* Igor Malinin - initial contribution
*
- * $Id: ColorManager.java,v 1.1 2004-09-02 18:26:49 jsurfer Exp $
+ * $Id: ColorManager.java,v 1.2 2006-10-21 23:13:54 pombredanne Exp $
*/
package net.sourceforge.phpeclipse.ui;
* @author Igor Malinin
*/
public class ColorManager {
- protected Map colors = new HashMap( 10 );
+ protected Map colors = new HashMap(10);
- public void bindColor( String key, RGB rgb ) {
- Object value = colors.get( key );
- if ( value != null ) {
+ public void bindColor(String key, RGB rgb) {
+ Object value = colors.get(key);
+ if (value != null) {
throw new UnsupportedOperationException();
}
- Color color = new Color( Display.getCurrent(), rgb );
+ Color color = new Color(Display.getCurrent(), rgb);
- colors.put( key, color );
+ colors.put(key, color);
}
- public void unbindColor( String key ) {
- Color color = (Color) colors.remove( key );
- if ( color != null ) {
+ public void unbindColor(String key) {
+ Color color = (Color) colors.remove(key);
+ if (color != null) {
color.dispose();
}
}
- public Color getColor( String key ) {
- return (Color) colors.get( key );
+ public Color getColor(String key) {
+ return (Color) colors.get(key);
}
public void dispose() {
Iterator i = colors.values().iterator();
- while ( i.hasNext() ) {
+ while (i.hasNext()) {
((Color) i.next()).dispose();
}
}