I have created a tool bar with few Tool bar items in my Application.
Menu:
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="toolbar:main">
<command
commandId="com.test.myapp.ui.commands.TestCommand"
style="push"
tooltip="My Tool Items 1">
</command>
Command configuration:
<extension point="org.eclipse.ui.commands">
<command
defaultHandler="com.test.myapp.ui.commands.TestCommand"
helpContextId="test"
id="com.test.myapp.ui.commands.TestCommand"
name="Open Test View">
</command>
Below is my TestCommand class.
public class TestCommand extends AbstractHandler{
//Overridden the execute method here....
}
So now if I click on my Tool bar this will execute my Command class. I would like to know how can I add mouse listener to this Tool bar item so that we can do some stuff when mouse over on the tool bar item (Ex:Mouse over to tool bar item, it generally shows tool tip, So now if I press some key it should open some other page for this. So to do that if I can get the control of this event I can add some stuff to it)