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 – defining the pop-up view in the fragment


The pop-up menu can be created in an almost identical way to the view menu. As before, it needs to be registered with the menu service but the code can be dramatically simplified by representing it in the fragment.e4xmi file.

  1. Go to the fragment.e4xmi file, and go to the Menus element beneath the Sample View part descriptor. Add a child Popup Menu to the Menus element, either with the context-sensitive menu and by choosing Add child | Popup Menu, or by selecting Popup Menu from the dropdown and clicking on the Add button.

  2. In the newly created Popup Menu, set the ID to com.packtpub.e4.migration.views.SampleView.popup.

  3. Select Handled Menu Item from the dropdown and click on Add.

  4. Add the Action 1 similar to before by setting these:

    1. Label: Action 1

    2. Tooltip: Action 1 tooltip

    3. Icon URI: platform:/plugin/org.eclipse.ui/icons/full/obj16/info_tsk.png or use the Find … button as before

    4. Ensure that the Enabled checkbox is selected

    5. Click on the Find...