Chapter 8. Migrating to Eclipse 4.x

In the last chapter, we looked at the way Eclipse 4 RCP applications are built. We'll now look at how to migrate an existing solution based on Eclipse 3.x APIs to Eclipse 4.x, and the pros and cons of migrating to the new infrastructure.

In this chapter, we shall:

  • Migrate an existing Eclipse 3.x view to an Eclipse 4.x view using the e4view extension
  • Replace deprecated Action classes with generic classes
  • Create code to show a toolbar, view menu, and pop-up menu
  • Create an e4xmi fragment to migrate to Eclipse 4.x models
  • Define commands, handlers, toolbars, view menus, and pop-up menus in the model
  • Do forward selection between Eclipse 3.x views and Eclipse 4.x parts

Why Eclipse 4.x?

The first question that needs to be asked when migrating an application from the Eclipse 3.x APIs is "Why migrate to Eclipse 4.x at all?" If the goal is to provide plug-ins for an Eclipse IDE, then there may be little benefit from migrating existing plug-ins to the new APIs. Under the covers, Eclipse provides a compatibility layer that implements the Eclipse 3.x APIs, which will continue to work for some time; this allows plug-ins developed and tested against previous versions of Eclipse to work as before.

There are significant benefits from a rich client platform perspective; there really is little need to build Eclipse 3.x-based RCP applications any more. Since RCP applications tend to be self-contained units (and often do not support the same extensibility that the IDE does), it should be easy to move over to using it. This can be done piece by piece as the views or other functionality is migrated. The reasons for migrating to the Eclipse 4.x model for plug-ins for an Eclipse 3.x IDE are much more limited, and there are some compatibility issues with regard to selection and pop-up menus that need to be addressed. These will be uncovered in this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.186.164