org.eclipse.cdt.internal.ui.text.util
Class CColorManager

java.lang.Object
  extended by org.eclipse.cdt.internal.ui.text.util.CColorManager
All Implemented Interfaces:
IColorManager, IColorManagerExtension

public class CColorManager
extends java.lang.Object
implements IColorManager, IColorManagerExtension

CDT color manager.


Constructor Summary
CColorManager()
          Creates a new CDT color manager which automatically disposes the allocated colors when the current display gets disposed.
CColorManager(boolean autoDisposeOnDisplayDispose)
          Creates a new CDT color manager.
 
Method Summary
 void bindColor(java.lang.String key, org.eclipse.swt.graphics.RGB rgb)
          Remembers the given color specification under the given key.
 void dispose()
          Disposes all color objects remembered by this color manager.
 org.eclipse.swt.graphics.Color getColor(org.eclipse.swt.graphics.RGB rgb)
          Returns the color object for the value represented by the given RGB object.
 org.eclipse.swt.graphics.Color getColor(java.lang.String key)
          Returns a color object for the given key.
 void unbindColor(java.lang.String key)
          Forgets the color specification remembered under the given key.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CColorManager

public CColorManager()
Creates a new CDT color manager which automatically disposes the allocated colors when the current display gets disposed.


CColorManager

public CColorManager(boolean autoDisposeOnDisplayDispose)
Creates a new CDT color manager.

Parameters:
autoDisposeOnDisplayDispose - if true the color manager automatically disposes all managed colors when the current display gets disposed and all calls to ISharedTextColors.dispose() are ignored.
Since:
4.0
Method Detail

getColor

public org.eclipse.swt.graphics.Color getColor(org.eclipse.swt.graphics.RGB rgb)
Description copied from interface: IColorManager
Returns the color object for the value represented by the given RGB object.

Specified by:
getColor in interface IColorManager
Parameters:
rgb - the rgb color specification
Returns:
the color object for the given rgb value

dispose

public void dispose()
Description copied from interface: IColorManager
Disposes all color objects remembered by this color manager.

Specified by:
dispose in interface IColorManager

getColor

public org.eclipse.swt.graphics.Color getColor(java.lang.String key)
Description copied from interface: IColorManager
Returns a color object for the given key. The color objects are remembered internally; the same color object is returned for equal keys.

Specified by:
getColor in interface IColorManager
Parameters:
key - the color key
Returns:
the color object for the given key

bindColor

public void bindColor(java.lang.String key,
                      org.eclipse.swt.graphics.RGB rgb)
Description copied from interface: IColorManagerExtension
Remembers the given color specification under the given key.

Specified by:
bindColor in interface IColorManagerExtension
Parameters:
key - the color key
rgb - the color specification

unbindColor

public void unbindColor(java.lang.String key)
Description copied from interface: IColorManagerExtension
Forgets the color specification remembered under the given key.

Specified by:
unbindColor in interface IColorManagerExtension
Parameters:
key - the color key