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 – aligning field editors with a grid


The preference values weren't lined up as might be expected. This is because the default preference field editor uses a FLAT style of rendering, which simply lays out the fields similar to a vertical RowLayout.

  1. Change it to be a more natural look by specifying a GRID style of rendering:

    public ClockPreferencePage() {
      super(GRID);
    }
  2. Now, when the preference page is displayed, it will look more natural:

What just happened?

The default FLAT style does not render well. It was added in 2007 before the popularity of the grid layout increased and typically needs to be overridden to provide a decent user interface experience. Switching to GRID does this, by working out the label length and field lengths and setting up the split accordingly. Furthermore, the view is resizable, with the fields taking up additional stretch space.

If the layout needs further customization or the widget set needs to be extended, then it is possible to create a plain...