Time for action – wiring a menu to a command with a handler

As with Eclipse 3.x, a command has an identifier and an associated handler class, which can be bound to menus. Unlike Eclipse 3.x, it is not specified in the plugin.xml file; instead, it is specified in the Application.e4xmi file.

  1. Open the Application.e4xmi file in the com.packtpub.e4.application project.
  2. Navigate to the Application | Commands node in the tree, and click on Add child to add a new Command:
    1. ID: com.packtpub.e4.application.command.hello
    2. Name: helloCommand
    3. Description: Says Hello
    Time for action – wiring a menu to a command with a handler
  3. Create a class HelloHandler in the com.packtpub.e4.application.handlers package. It doesn't need to have ...

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.