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 – binding commands to keys


Hooking up the command to a keystroke requires a KeyBinding. This allows a key (or series of keys) to be used to invoke the command instead of only via the menu. KeyBindings are set up inside a Binding Table and associated with a Binding Context.

  1. Open the fragment.e4xmi in the clock.ui project.

  2. In the imports, select the Binding Context from the dropdown and click on Add. In the Reference-ID, click on Find… and a dialog will be shown with the contexts. Choose the org.eclipse.ui.contexts.dialogAndWindow context:

  3. Once the binding context has been imported, it can be used within a binding table. Click on Model Fragments and select Add to create a new fragment. Fill in the details as follows:

    1. Extended Element ID: org.eclipse.e4.legacy.ide.application

    2. Feature Name: bindingTables

  4. In the BindingTable element, choose the org.eclipse.ui.contexts.dialogAndWindow context. This will ensure that the key binding is available in all windows and dialogs:

  5. Click on...