Jump to: navigation, search

Difference between revisions of "RAP Theming"

(New page: This article describes the themeing functionality of RWT, the RAP Widget Toolkit. This themeing defines the default look and feel of the basic RWT controls like Shell, Button, Text etc. It...)
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This article describes the themeing functionality of RWT, the RAP Widget Toolkit.
+
| [[RAP|RAP wiki home]] | [http://eclipse.org/rap RAP project home] |
This themeing defines the default look and feel of the basic RWT controls like Shell, Button, Text etc.
+
It must not be mixed up with the themeing of the Eclipse workbench. Instead, it can be compared to the themeing functionality of a desktop system that allows the user to set custom colors for title bars, text background and the like.
+
  
=== State of Development ===
+
Please refer to the related articles in the RAP Developer Guide:
 +
* [http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.rap.help/help/html/advanced/theming.html RWT Theming]
 +
* [http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.rap.help/help/html/advanced/theming-custom.html Prepare Custom Widgets for Theming]
  
The RWT themeing mechanism, as introduced with the M4 milestone, is still in an early state of development.
+
[[Category:RAP]]
Some details are still likely to change, as our experience with this approach grows.
+
Your comments and suggestions are welcome.
+
 
+
Currently, the RWT themeing only allows to define colors.
+
Themeing of icons, fonts, borders, margins etc. will follow shortly.
+
 
+
=== How to define a custom RWT Theme ===
+
 
+
==== 1. Create a custom theme file ====
+
 
+
RWT theme files are simple Java Property files.
+
A template named <code>theme-template.properties</code> can be found in the <code>src/</code> directory of the RWT plugin (<code>org.eclipse.rap.rwt</code>).
+
You only have to specify those properties that are relevant for you, undefined properties will stay at their default value.
+
Note that some property names are likely to be changed in the future, other properties will emerge and a few properties will even be dropped.
+
Please refer to the template file shipped with your current version.
+
 
+
==== 2. Register the new theme with the extension point <code>org.eclipse.rap.swt.themes</code> ====
+
 
+
In the <code>plugin.xml</code> of your application project, add an extension like this:
+
 
+
<pre>
+
  <extension
+
      id="my.application.themes"
+
      point="org.eclipse.rap.swt.themes">
+
    <theme
+
        id="my.application.aquablue"
+
        name="Aqua Blue Test Theme"
+
        file="aqua-blue.properties"
+
        default="true"/>
+
  </extension>
+
</pre>
+
 
+
==== 3. Activate the theme ====
+
 
+
The extension parameter <code>default</code> specifies whether the theme should be active by default.
+
Currently, this is the only way to activate a custom theme.
+
Support for programmatic activation of custom themes is planned for future versions.
+

Revision as of 08:20, 1 September 2008

| RAP wiki home | RAP project home |

Please refer to the related articles in the RAP Developer Guide: