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.
- Open the
SampleView
class and remove theextends ViewPart
superclass definition. This will introduce some errors in the code, which will be fixed shortly. - Add a
@PostConstruct
annotation to thecreatePartControl
method. Use Cmd + Shift + O on macOS or Ctrl + Shift + O on other platforms to automatically add theimport javax.annotation.PostConstruct
statement. - Add a
@Focus
annotation to thesetFocus
method. This time, the automatic import won't work, but a quick fix will suggest adding the dependency. ...
Get Eclipse Plug-in Development Beginner's Guide - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.