use of com.extjs.gxt.ui.client.widget.button.SplitButton in project activityinfo by bedatadriven.
the class ActionToolBar method addSaveSplitButton.
public void addSaveSplitButton() {
saveSplitButton = new SplitButton(I18N.CONSTANTS.save());
saveSplitButton.setIcon(IconImageBundle.ICONS.save());
saveSplitButton.setItemId(UIActions.SAVE);
saveSplitButton.addListener(Events.Select, this);
Menu menu = new Menu();
MenuItem saveItem = new MenuItem(I18N.CONSTANTS.save(), IconImageBundle.ICONS.save(), new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent ce) {
if (listener != null) {
listener.onUIAction(UIActions.SAVE);
}
}
});
menu.add(saveItem);
MenuItem discardItem = new MenuItem(I18N.CONSTANTS.discardChanges(), IconImageBundle.ICONS.cancel(), new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent ce) {
listener.onUIAction(UIActions.DISCARD_CHANGES);
}
});
menu.add(discardItem);
saveSplitButton.setMenu(menu);
add(saveSplitButton);
}
Aggregations