Since the Action
class is deprecated, the supported mechanism is to create a command, a handler, and a menu to display the command in the menu bar.
Open the plug-in manifest for the project, or double-click on the plugin.xml file.
Edit the source on the plugin.xml tab, and add a definition of a
Hello
command as follows:<extension point="org.eclipse.ui.commands"> <command name="Hello" description="Says Hello World" id="com.packtpub.e4.clock.ui.command.hello"/> </extension>
This creates a command, which is just an identifier and a name. To specify what it does, it must be connected to a handler, which is done by adding the following extension:
<extension point="org.eclipse.ui.handlers"> <handler class= "com.packtpub.e4.clock.ui.handlers.HelloHandler" commandId="com.packtpub.e4.clock.ui.command.hello"/> </extension>
The handler joins the processing of the command to a class that implements
IHandler...