Book Image

Eclipse 4 Plug-in Development by Example : Beginner's Guide

By : Dr Alex Blewitt
Book Image

Eclipse 4 Plug-in Development by Example : Beginner's Guide

By: Dr Alex Blewitt

Overview of this book

<p>As a highly extensible platform, Eclipse is used by everyone from independent software developers to NASA. Key to this is Eclipse’s plug-in ecosystem, which allows applications to be developed in a modular architecture and extended through its use of plug-ins and features.<br /><br />"Eclipse 4 Plug-in Development by Example Beginner's Guide" takes the reader through the full journey of plug-in development, starting with an introduction to Eclipse plug-ins, continued through packaging and culminating in automated testing and deployment. The example code provides simple snippets which can be developed and extended to get you going quickly.</p> <p>This book covers basics of plug-in development, creating user interfaces with both SWT and JFace, and interacting with the user and execution of long-running tasks in the background.</p> <p>Example-based tasks such as creating and working with preferences and advanced tasks such as well as working with Eclipse’s files and resources. A specific chapter on the differences between Eclipse 3.x and Eclipse 4.x presents a detailed view of the changes needed by applications and plug-ins upgrading to the new model. Finally, the book concludes on how to package plug-ins into update sites, and build and test them automatically.</p>
Table of Contents (19 chapters)
Eclipse 4 Plug-in Development by Example Beginner's Guide
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – showing properties


Instead of every object having to have its own custom information dialog, the Eclipse IDE provides a generic Properties view (in the org.eclipse.ui.views plug-in), which can be used to show information about the currently selected object. The properties are discovered generically from an object and accessed through the IPropertySource interface. This allows an object to provide an abstracted way of computing the fields shown in the property view.

The easiest way to create a property source is to let the object in question implement its own IPropertySource interface. This works when the source code can be modified, but in many cases (such as the TimeZone, or a Map.Entry containing a String key and a TimeZone) the source code cannot be modified.

  1. Open the MANIFEST/META-INF.MF of the plug-in, and add org.eclipse.ui.views as a dependency via the Dependencies tab, or by adding it to the bundles in the Require-Bundle entry. Without this, the IPropertySource interface...