Eclipse 4 ships with a theme manager which can be used to swap between themes (in essence, separate CSS files). The theme manager is available for inclusion in Eclipse 4-based applications by adding the org.eclipse.e4.ui.css.swt
plug-in as a dependency to the application, and by adding one or more org.eclipse.e4.ui.css.swt.theme
extension points.
Add the
org.eclipse.e4.ui.css.swt.theme
plug-in to the Dependencies tab of theplugin.xml
file of thecom.packtpub.e4.application
project.Go to the plugin.xml tab of the
plugin.xml
file (or edit the file as text) and add the following content to add blue and green themes:<extension point="org.eclipse.e4.ui.css.swt.theme"> <theme label="Blue Theme" id="com.packtpub.e4.ui.css.theme.blue" basestylesheeturi="css/blue.css"/> <theme label="Green Theme" id="com.packtpub.e4.ui.css.theme.green" basestylesheeturi="css/green.css"/> </extension>
Create a text file with the name
blue.css...