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 direct menu and keybindings


Although using commands and handlers provides a generic way for reusing content, it is possible to provide a shorter route to implementing menus with a Direct Menu Item. The difference between this and a Handled Menu Item is that Direct Menu Item contains a direct reference to the @Executable class, instead of indirect through a handler.

  1. To add a new direct menu item, open the Application.e4xmi file and navigate to the Application | Windows and Dialogs | Trimmed Window | Main Menu | Menu (File). Right-click on the menu and choose Add child | Direct Menu Item. In the dialog shown, fill in the following details, including the class URI link to the HelloHandler, defined previously:

    1. ID: com.packtpub.e4.application.directmenuitem.hello

    2. Label: Direct Hello

    3. Class URI: bundleclass://com.packtpub.e4.application/com.packtpub.e4.application.handlers.HelloHandler

  2. Run the application, and navigate to the File | Direct Hello menu, which shows the...