I want to simulate a click on a menu item but found no method. I'm thinking of something like doClick() of JMenu.
At the moment my very stupid solution looks like this:
private void performClick(MenuItem source, Event event) {
source.notifyListeners(SWT.Selection, event);
}
But maybe there's a better way to fire the event?
A MenuItem in SWT can be controlled by the method
addSelectionListener(SelectionListener listener)
The SelectionListener provides the method
where you can include the desired functionality.
For a documentation to the Class Menu Item see:
http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fswt%2Fwidgets%2FMenuItem.html