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 – creating a preference page


Although preferences can be stored programmatically, users will typically change them through the user interface. The canonical way of presenting preferences is through a preference page in Eclipse, which can be accessed through the Preferences menu. A preference page implements the IPreferencePage interface, but the easiest way is to use the FieldEditorPreferencePage as a superclass, which provides most of the standard plug-in behavior needed, along with the IWorkbenchPreferencePage interface.

  1. Open the plugin.xml of the com.packtpub.e4.clock.ui plug-in. To declare a new preference page, use the org.eclipse.ui.preferencePages extension point. Add the following:

    <extension point="org.eclipse.ui.preferencePages">
      <page name="Clock"
            class="com.packtpub.e4.clock.ui.ClockPreferencePage"
            id="com.packtpub.e4.clock.ui.preference.page"/>
    </extension>

    Note

    The same effect can be achieved by editing plugin.xml in the editor...