Time for action – migrating the commands and handlers
Menu items are typically decoupled from the code that is executed to promote flexibility and re-use. In both Eclipse 3.x and Eclipse 4.x, commands are used to represent logical operations whilst handlers are used to execute the code. In order to create menus, the handlers and commands must be defined in the fragment.
- Open the
fragment.e4xmi
file and go to the Model Fragments element in the tree. Click on Add to add a new Model Fragment, and then useorg.eclipse.e4.legacy.ide.application
as the Extended Element ID andcommands
as the Feature Name. - Select Command from the drop-down menu and click on Add to add new commands. Create a command with the ID
com.packtpub.e4.migration.command.one
and ...
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.