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 the view menu


The view menu is the dropdown shown with a triangular icon, and is currently created in the SampleView class in the createView method. This can be recreated in the fragment editor by adding a view menu to the part descriptor.

  1. Open the fragment.e4xmi file and navigate to the Sample View part descriptor. Under that, there is a Menus element and a dropdown choice box. Select View Menu from the list and click on the Add button to add a View Menu.

  2. In the newly created View Menu, there is a drop-down choice box. Choose Handled Menu Item and click on Add.

  3. Add the following to the Handled Menu Item:

    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 … button next to the Command field and choose the Action 1 command from the list

  4. The Handled Menu Item should look like this:

  5. Comment out the createViewMenu...