How do I add a dynamic toolbar item?
I can add a dynamic Menu item via the 'Add Child->Dynamic Menu Contribution' option in the Application.e4xmi file, and pointing to my own file which does:
@AboutToShow
public void aboutToShow(final List<MMenuElement> items) {
final MDirectMenuItem dynamicItem = MMenuFactory.INSTANCE.createDirectMenuItem();
...
}
However, there is no 'Add Child->Dynamic Toolbar contribution' option in the Application.e4xmi file. If there was I assume I could do:
@AboutToShow
public void aboutToShow(final List<MToolBarElement> toolItems) {
final MDirectToolItem dynamicToolItem = MMenuFactory.INSTANCE.createDirectToolItem();
...
}
So does anyone know how I'm supposed to hook into my class from the Application.e4.xmi file to dynamically create toolbar items?
The reason that I'm doing this is to be able to dynamically set the icons and label text using values from a properties file. If there's an easier way to do this through the Application.e4xmi file, please let me know!