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 – updating to e4view


The e4view extension point allows a view to be loaded into an Eclipse 4.x application without the need of a specific superclass. This allows existing Eclipse 3.x views to be upgraded to an Eclipse 4.x view as follows.

  1. Open the SampleView class and remove the extends ViewPart superclass definition. This will introduce some errors in the code, which will be fixed shortly.

  2. Add a @PostConstruct annotation to the createPartControl method. Use Cmd + Shift + O on macOS or Ctrl + Shift + O on other platforms to automatically add the import javax.annotation.PostConstruct statement.

  3. Add a @Focus annotation to the setFocus method. This time, the automatic import won't work, but a quick fix will suggest adding the dependency. Alternatively open the MANIFEST.MF file, go to the Dependencies tab, and add org.eclipse.e4.ui.di bundle as a dependency. Now switch back to the SampleView class, perform the organize imports with the previous keystroke, and import org.eclipse...