|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.forms.FormColors
Manages colors that will be applied to forms and form widgets. The colors are chosen to make the widgets look correct in the editor area. If a different set of colors is needed, subclass this class and override 'initialize' and/or 'initializeColors'.
Field Summary | |
protected Color |
background
|
protected Color |
border
|
static String |
BORDER
Key for the tree/table border color. |
protected Map |
colorRegistry
|
protected Display |
display
|
protected Color |
foreground
|
static String |
SEPARATOR
Key for the section separator color. |
static String |
TB_BG
|
static String |
TB_BORDER
|
static String |
TB_FG
|
static String |
TB_GBG
|
static String |
TB_TOGGLE
|
static String |
TITLE
Key for the form title foreground color. |
Constructor Summary | |
FormColors(Display display)
Creates form colors using the provided display. |
Method Summary | |
Color |
createColor(String key,
int r,
int g,
int b)
Creates the color for the specified key using the provided RGB values. |
Color |
createColor(String key,
RGB rgb)
Creates the color for the specified key using the provided RGB object. |
void |
dispose()
Disposes all the colors in the registry. |
Color |
getBackground()
Returns the current background color. |
Color |
getBorderColor()
Returns the computed border color. |
Color |
getColor(String key)
Returns the color object for the provided key or null if not in the registry. |
Display |
getDisplay()
Returns the display used to create colors. |
Color |
getForeground()
Returns the current foreground color. |
RGB |
getSystemColor(int code)
|
protected void |
initialize()
Initializes the colors. |
protected void |
initializeColorTable()
Allocates colors for the following keys: BORDER, COMPOSITE_SEPARATOR and DEFAULT_HEADER. |
void |
initializeSectionToolBarColors()
Allocates colors for the section tool bar (all the keys that start with TB). |
boolean |
isShared()
Tests if the colors are shared. |
boolean |
isWhiteBackground()
Tests if the background is white. |
void |
markShared()
Marks the colors shared. |
void |
setBackground(Color bg)
Sets the background color. |
void |
setForeground(Color fg)
Sets the foreground color. |
protected void |
updateBorderColor()
Computes the border color relative to the background. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String TITLE
public static final String BORDER
public static final String SEPARATOR
public static final String TB_BG
public static final String TB_FG
public static final String TB_GBG
public static final String TB_BORDER
public static final String TB_TOGGLE
protected Map colorRegistry
protected Color background
protected Color foreground
protected Display display
protected Color border
Constructor Detail |
public FormColors(Display display)
display
- the display to useMethod Detail |
public Display getDisplay()
protected void initialize()
initializeColorTable()
.
initializeColorTable()
protected void initializeColorTable()
public void initializeSectionToolBarColors()
public RGB getSystemColor(int code)
public Color createColor(String key, RGB rgb)
key
- the unique color keyrgb
- the RGB object
public Color createColor(String key, int r, int g, int b)
key
- the unique color keyr
- red valueg
- green valueb
- blue value
protected void updateBorderColor()
public void setBackground(Color bg)
bg
- background colorpublic void setForeground(Color fg)
fg
- foreground colorpublic Color getBackground()
public Color getForeground()
public Color getBorderColor()
public boolean isWhiteBackground()
public Color getColor(String key)
key
- the color key
public void dispose()
public void markShared()
public boolean isShared()
true
if shared, false
otherwise.
|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.