Book Image

Mastering Eclipse Plug-in Development

By : Alex Blewitt, Bandlem Limited
Book Image

Mastering Eclipse Plug-in Development

By: Alex Blewitt, Bandlem Limited

Overview of this book

Table of Contents (18 chapters)
Mastering Eclipse Plug-in Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Plugging in to JFace and the Common Navigator Framework
Index

Events and E4


The E4 Eclipse application uses events internally to manage the state of the user interface. The decoupling allows the user interface mechanisms to be separated from the user interface renderer, which allows different user interfaces to be presented (such as JavaFX).

There is an E4-specific wrapper for the EventAdmin service called the IEventBroker. This provides a simple mechanism to post or send objects to a particular topic, as well as frontends to register event listeners. It has specific ties to E4 and is present in the UI package. Create a plug-in named com.packtpub.e4.advanced.event.e4.

Tip

To write portable code that processes events headlessly, consider using EventAdmin directly.

Sending events with E4

The IEventBroker can be injected into an E4 component using standard injection techniques, and from that, events can be posted synchronously or asynchronously. Create a class named E4Sender in the com.packtpub.e4.advanced.event.e4 plugin.

Obtaining the service in E4 is done...