Search in sources :

Example 1 with ActionListener

use of org.activityinfo.client.page.common.toolbar.ActionListener in project activityinfo by bedatadriven.

the class LockedPeriodGrid method createActionToolbar.

private void createActionToolbar() {
    actionToolbar = new ActionToolBar(new ActionListener() {

        @Override
        public void onUIAction(String actionId) {
            if (actionId.equals(UIActions.ADD)) {
                eventBus.fireEvent(new StartCreateEvent());
            } else if (actionId.equals(UIActions.DELETE)) {
                eventBus.fireEvent(new RequestDeleteEvent());
            } else if (actionId.equals(UIActions.SAVE)) {
                eventBus.fireEvent(new UpdateEvent());
            } else if (actionId.equals(UIActions.DISCARD_CHANGES)) {
                eventBus.fireEvent(new CancelUpdateEvent());
            // } else if (actionId.equals(UIActions.refresh)) {
            // eventBus.fireEvent(new RefreshEvent());
            }
        }
    });
    actionToolbar.addDeleteButton();
    actionToolbar.addCreateButton();
    actionToolbar.addSaveSplitButton();
    // actionToolbar.addRefreshButton();
    actionToolbar.setDeleteEnabled(false);
    actionToolbar.setUpdateEnabled(false);
    this.setTopComponent(actionToolbar);
}
Also used : ActionListener(org.activityinfo.client.page.common.toolbar.ActionListener) ActionToolBar(org.activityinfo.client.page.common.toolbar.ActionToolBar)

Aggregations

ActionListener (org.activityinfo.client.page.common.toolbar.ActionListener)1 ActionToolBar (org.activityinfo.client.page.common.toolbar.ActionToolBar)1