# Themes

###### Identifier:

org.eclipse.e4.ui.css.swt.theme

###### Since:

0.9

###### Description:

This extension point provides the possibility to define themes and/or contribute stylesheets and resources to already defined themes

###### Configuration Markup:

<!ELEMENT extension (stylesheet* , theme* , themeAssociation*)>

<!ATTLIST extension

point CDATA #REQUIRED

id CDATA #IMPLIED

name CDATA #IMPLIED>

<!ELEMENT stylesheet (themeid* , osgiresourcelocator*)>

<!ATTLIST stylesheet

uri CDATA #REQUIRED

os CDATA #IMPLIED

ws CDATA #IMPLIED>

Contribute a stylehsheet to themes

- uri - bundle relative uri to the stylesheet
- os - the operating system the style is applicable for or empty to apply on all
- ws - the windowing system the style is applicable for or empty to apply to all

<!ELEMENT theme EMPTY>

<!ATTLIST theme

id CDATA #REQUIRED

label CDATA #REQUIRED

basestylesheeturi CDATA #REQUIRED

os CDATA #IMPLIED

ws CDATA #IMPLIED

os_version CDATA #IMPLIED>

- id - Id for the theme. It is possible use the same id multiple times but then it has to have distinct OS and WS filter values
- label - the label used when displayed to the user
- basestylesheeturi - the base stylesheet uri relative to the bundle
- os - the operating system the theme is applicable for or empty to apply on all
- ws - the windowing system the theme is applicable for or empty to apply to all
- os_version - the version the operating system the theme is applicable for or empty to apply on all. The value can be a comma-separated string to specify multiple versions.

<!ELEMENT themeid EMPTY>

<!ATTLIST themeid

refid IDREF #IMPLIED>

- refid - a referenced stylesheet

<!ELEMENT osgiresourcelocator EMPTY>

<!ATTLIST osgiresourcelocator

uri CDATA #REQUIRED>

- uri - an url starting with platform:/plugin

<!ELEMENT themeAssociation EMPTY>

<!ATTLIST themeAssociation

themeId IDREF #REQUIRED

colorAndFontId IDREF #REQUIRED

os_version IDREF #IMPLIED>

- themeId - an Eclipse CSS theme id
- colorAndFontId - an Eclipse legacy Color and Font theme id
- os_version - an optional attribute used to better match the themes

###### Examples:

A theme which only applies on Win32/WinXP:

    <theme
      basestylesheeturi="css/e4_default_winxp_blu.css"
      id="org.eclipse.e4.ui.css.theme.e4_default"
      label="e4DefaultWinXPBlue"
      os="win32"
      ws="winxp">
    </theme>

A stylesheet contributed to all Systems:

    <stylesheet
      uri="css/default.css">
    </stylesheet>

The CSS theme and the legacy Colors and Fonts association:

    <themeAssociation
     themeId="org.eclipse.e4.ui.css.theme.e4_classic"
     colorAndFontId="org.eclipse.ui.defaultTheme">
    </themeassociation>

Copyright (c) 2010 Tom Schindl and others.
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html/ SPDX-License-Identifier: EPL-2.0