<!ELEMENT extension (theme* , colorDefinition* , fontDefinition* , themeElementCategory* , data* , categoryPresentationBinding*)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED
><!ELEMENT theme (colorOverride* , fontOverride* , description? , data*)>
<!ATTLIST theme
id CDATA #REQUIRED
name CDATA #IMPLIED
>A collection of font, color and data overrides. Such a collection may be used to alter the appearance of the workbench. Many theme elements may exist with the same id. This allows component authors to contribute to existing themes.
<!ELEMENT themeElementCategory (description?)>
<!ATTLIST themeElementCategory
id CDATA #REQUIRED
parentId IDREF #IMPLIED
class CDATA #IMPLIED
label CDATA #IMPLIED
>A logical grouping of theme element definitions. This category may include colors and fonts.
org.eclipse.ui.themes.IThemePreview<!ELEMENT colorDefinition (colorFactory? , colorValue* , description?)>
<!ATTLIST colorDefinition
id CDATA #REQUIRED
label CDATA #REQUIRED
defaultsTo CDATA #IMPLIED
value CDATA #IMPLIED
categoryId IDREF #IMPLIED
colorFactory CDATA #IMPLIED
isEditable (true | false)
>A symbolic color definition.
defaultsTo, value or colorFactory may be defined.defaultsTo, value or colorFactory may be defined. If value is specified, additional value definitions may be specified on a per platform/windowing system basis via the colorValue element.themeElementCategory this color belongs to.org.eclipse.ui.themes.IColorFactory. This may be used instead of value to specify the default value of the color. Please be advised that this should be used with caution - usage of this attribute will cause plugin activation on workbench startup.false then the contribution is not shown to the user.<!ELEMENT fontDefinition (fontValue* , description?)>
<!ATTLIST fontDefinition
id CDATA #REQUIRED
label CDATA #REQUIRED
value CDATA #IMPLIED
categoryId IDREF #IMPLIED
defaultsTo CDATA #IMPLIED
isEditable (true | false)
>A symbolic font definition.
the font value. This is in the form: fontname-style-height where fontname is the name of a font, style is a font style (one of "regular", "bold", "italic", or "bold italic") and height is an integer representing the font height.
Example: Times New Roman-bold-36.
Only one (or neither) of value or defaultsTo may be used.
value is specified, additional value definitions may be specified on a per platform/windowing system basis via the fontValue element.themeElementCategory this font belongs to.
Only one (or neither) of value or defaultsTo may be used.
false then the contribution is not shown to the user.<!ELEMENT colorOverride (colorFactory? , colorValue*)>
<!ATTLIST colorOverride
id IDREF #REQUIRED
value CDATA #IMPLIED
colorFactory CDATA #IMPLIED
>
Allows overriding of colors defined in colorDefinition elements. These colors will be applied when the theme is in use. The colors that are defined by workbench are:
colorDefinitions that have isEditable set to false.value or colorFactory may be defined.
Unlike a colorDefinition, you may not supply a defaultsTo for an override.org.eclipse.ui.themes.IColorFactory. This may be used instead of value to specify the default value of the color. Please be advised that this should be used with caution - usage of this attribute will cause plugin activation on workbench startup.<!ELEMENT fontOverride (fontValue*)>
<!ATTLIST fontOverride
id IDREF #REQUIRED
value CDATA #IMPLIED
>
Allows overriding of fonts defined in fontDefinition elements. These fonts will be applied when the theme is in use. The fonts that are defined by workbench are:
fontDefinitions that have isEditable set to false.the overriding value of this font. This is in the form: fontname-style-height where fontname is the name of a font, style is a font style (one of "regular", "bold", "italic", or "bold italic") and height is an integer representing the font height.
Example: Times New Roman-bold-36.
value must be defined for a font override.
Unlike a fontDefinition, you may not supply a defaultsTo for a fontOverride.
If this value is not specified the default font will be used
<!ELEMENT description (#PCDATA)>
A short description of the elements usage.
<!ELEMENT colorFactory (parameter*)>
<!ATTLIST colorFactory
class CDATA #REQUIRED
plugin CDATA #IMPLIED
>
The element version of the colorFactory attribute. This is used when the colorFactory implements org.eclipse.core.runtime.IExecutableExtension and there is parameterized data that you wish used in its initialization.
org.eclipse.ui.themes.IColorFactory. It may also implement org.eclipse.core.runtime.IExecutableExtension.<!ELEMENT parameter EMPTY>
<!ATTLIST parameter
name CDATA #REQUIRED
value CDATA #REQUIRED
>A parameter element to be used within the colorFactory element. This will be passed as initialization data to the colorFactory class.
<!ELEMENT data EMPTY>
<!ATTLIST data
name CDATA #REQUIRED
value CDATA #REQUIRED
>An element that allows arbitrary data to be associated with a theme or the default theme. This data may be gradient directions or percentages, labels, author information, etc.
This element has behavior similar to definitions and overrides. If a key is present in both the default theme and an identified theme, then the identified themes value will be used when that theme is accessed. If the identified theme does not supply a value then the default is used.
<!ELEMENT colorValue (colorFactory?)>
<!ATTLIST colorValue
os CDATA #IMPLIED
ws CDATA #IMPLIED
value CDATA #IMPLIED
colorFactory CDATA #IMPLIED
>This element allows specification of a color value on a per-platform basis.
value or colorFactory may be defined.org.eclipse.ui.themes.IColorFactory. This may be used instead of value to specify the value of the color. Please be advised that this should be used with caution - usage of this attribute will cause plugin activation on workbench startup.<!ELEMENT fontValue EMPTY>
<!ATTLIST fontValue
os CDATA #IMPLIED
ws CDATA #IMPLIED
value CDATA #REQUIRED
>This element allows specification of a font value on a per-platform basis.
the font value. This is in the form: fontname-style-height where fontname is the name of a font, style is a font style (one of "regular", "bold", "italic", or "bold italic") and height is an integer representing the font height.
Example: Times New Roman-bold-36.
<!ELEMENT categoryPresentationBinding EMPTY>
<!ATTLIST categoryPresentationBinding
categoryId IDREF #REQUIRED
presentationId IDREF #REQUIRED
>
This element allows a category to be bound to a specific presentation as described by the org.eclipse.ui.presentationFactory extension point. If a category has any presentation bindings then it (and its children) is only configurable by the user if it is bound to the active presentation. This is useful for removing unused items from user consideration.
<extension point="org.eclipse.ui.themes"> <themeElementCategory id="com.xyz.ThemeCategory" class="com.xyz.XYZPreview" label="XYZ Elements"/> <colorDefinition id="com.xyz.Forground" categoryId="com.xyz.ThemeCategory" label="XYZ Foreground Color" value="COLOR_BLACK"> <!-- white should be used on GTK --> <colorValue value="COLOR_WHITE" os="linux" ws="gtk"/> <description> This color is used for the foreground color of the XYZ plugin editor. </description> </colorDefinition> <colorDefinition id="com.xyz.Background" categoryId="com.xyz.ThemeCategory" label="XYZ Background Color"> <colorFactory class="org.eclipse.ui.themes.RGBBlendColorFactory" plugin="org.eclipse.ui"> <parameter name="color1" value="COLOR_WHITE"/> <parameter name="color2" value="COLOR_BLUE"/> </colorFactory> <!-- black should be used on GTK --> <colorValue value="COLOR_BLACK" os="linux" ws="gtk"/> <description> This color is used for the background color of the XYZ plugin editor. </description> </colorDefinition> <fontDefinition id="com.xyz.TextFont" categoryId="com.xyz.ThemeCategory" label="XYZ Editor Font" defaultsTo="org.eclipse.jface.textfont"> <description> This font is used by the XYY plugin editor. </description> </fontDefinition> <data name="com.xyz.EditorMarginWidth" value="5"/> <theme id="com.xyz.HarshTheme" label="Harsh Colors for XYZ"> <colorOverride id="com.xyz.Forground" value="COLOR_CYAN"/> <colorOverride id="com.xyz.Background" value="COLOR_MAGENTA"/> <data name="com.xyz.EditorMarginWidth" value="1"/> </theme> </extension>
org.eclipse.ui.IWorkbench.getThemeManager() provides an instance of org.eclipse.ui.themes.IThemeManager that may be used to obtain a named theme (by id, including the default theme which has an id of IThemeManager.DEFAULT_THEME) or the current theme. From an org.eclipse.ui.themes.ITheme you may obtain a org.eclipse.jface.resources.ColorRegistry, an org.eclipse.jface.resources.FontRegistry and the arbitrary data associated with a theme.
Copyright (c) 2003, 2011 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which accompanies
this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html