}
private void addActionContribution(final IActionContribution actionContribution) {
final Application application = this;
Button button = new Button(actionContribution.getText());
button.setIcon(new ThemeResource(actionContribution.getIcon()));
button.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
actionContribution.execute(application);
}
});
getToolbar().addComponent(button);
buttonActionMap.put(actionContribution, button);
@SuppressWarnings("serial")
MenuItem menuItem = actionMenu.addItem(actionContribution.getText(), new Command() {
@Override
public void menuSelected(MenuItem selectedItem) {
actionContribution.execute(application);
}
});
menuItem.setIcon(new ThemeResource(actionContribution.getIcon()));
menuActionMap.put(actionContribution, menuItem);
}