0

A Javadoc from MMenuElement says:

String org.eclipse.e4.ui.model.application.ui.menu.MMenuElement.getMnemonics()

Returns the value of the 'Mnemonics' attribute.

If the meaning of the 'Mnemonics' attribute isn't clear, there really should be more of a description here...

Returns:
the value of the 'Mnemonics' attribute.

I strongly suspect, that Mnemonics attribute has something to do with hot-key shortcuts, like in Swing or AWT. But still, it is not quite clear, how to use them on Eclipse4 platform correctly. For example, how to assign Alt+F to a "File" menu item?

Can anyone provide me with a clue, example or HOWTO on this topic?

manuna
  • 729
  • 14
  • 37

1 Answers1

1

This is only the default javadoc as set by the EMF generator. So there was no real documentation done up to now.

You're right, mnemnoics got to do with shortcuts, but not the way you describe it. You are talking about key bindings, mnemonics are this:

&Open leads to a menu text with an underlined O which indicates keyboard accessibility. This shows to the user that the command is reachable using the platform specific accelerator. It is however platform dependent on how you see them, on OS X for example the accelerator is shown next to the label and hence has no effect.

see the javadoc of org.eclipse.swt.widgets.MenuItem.setText(String string) for a detailed explanation. The e4 model simply results in this call on the element, which happens in org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem:499

OS X information Mnemonics are not shown on Mac by definition, see Java Development Guide for OS X for the design definition.

col.panic
  • 2,944
  • 4
  • 25
  • 31
  • Thanks, that clears things a bit. Anyway, though I've tried both setting mnenonics to a character and adding "&" to text, neither worked in my case. Perhaps I missed something important... – manuna Nov 14 '12 at 15:22