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 pop-up menu and a view menu


Pop-up and view menus are defined declaratively in the Application.e4xmi file. These are specific to a part, so the option is defined underneath the part declaration.

  1. Open the Application.e4xmi file.

  2. Navigate to the Application | Windows and Dialogs | Trimmed Window | Controls | Perspective Stack | Perspective | Controls | PartSashContainer | Part Stack | Part (Hello) | Menus node.

  3. Right-click on the Menus node and choose Add child | Popup Menu. Set the ID to com.packtpub.e4.application.popupmenu.hello, which will be used in code later.

  4. Right-click on the Popup Menu and choose Add child | Handled Menu Item. This is exactly the same as for other menus; fill in the details as follows:

    1. Label: Hello

    2. Command: helloCommand - com.packtpub.e4.application.command.hello

  5. Right-click on the Menus node again, and choose Add child | View Menu. Give the menu a label View Menu and right-click to choose Add child | Handled Menu Item. Use the same label...