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 model fragment


Eclipse 4.x applications use a model fragment to define the UI. It is necessary to create a model fragment to define the part descriptors, handlers, and commands to simplify the code shown previously. To start with, the e4view extension will be replaced by a part descriptor in the fragment.

  1. Comment (or delete) the e4view extension from the plugin.xml to prevent it from being loaded.

  2. Select the project, navigate to the File | New... menu, and choose New Model Fragment from the dialog.

  3. In the newly opened fragment.e4xmi file, click on Model Fragments and click on Add to add a new fragment.

  4. Enter org.eclipse.e4.legacy.ide.application as the Extended Element ID and descriptors as the Feature Name.

  5. Select PartDescriptor from the drop-down menu and click on Add to add a new Part Descriptor with the following fields:

    1. ID: com.packtpub.e4.migration.views.SampleView

    2. Label: Sample View

    3. Icon URI: platform:/plugin/com.packtpub.e4.migration/icons/sample.gif ...