Book Image

Eclipse Plug-in Development Beginner's Guide - Second Edition

By : Alex Blewitt
Book Image

Eclipse Plug-in Development Beginner's Guide - Second Edition

By: Alex Blewitt

Overview of this book

Eclipse is used by everyone from indie devs to NASA engineers. Its popularity is underpinned by its impressive plug-in ecosystem, which allows it to be extended to meet the needs of whoever is using it. This book shows you how to take full advantage of the Eclipse IDE by building your own useful plug-ins from start to finish. Taking you through the complete process of plug-in development, from packaging to automated testing and deployment, this book is a direct route to quicker, cleaner Java development. It may be for beginners, but we're confident that you'll develop new skills quickly. Pretty soon you'll feel like an expert, in complete control of your IDE. Don't let Eclipse define you - extend it with the plug-ins you need today for smarter, happier, and more effective development.
Table of Contents (24 chapters)
Eclipse Plug-in Development Beginner's Guide Second Edition
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – adding themes


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.

  1. Add the org.eclipse.e4.ui.css.swt.theme plug-in to the Dependencies tab of the plugin.xml file of the com.packtpub.e4.application project.

  2. 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>
  3. Create a text file with the name blue.css...