Search in sources :

Example 6 with ActionToolBar

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

the class DataEntryPage method createToolBar.

private ActionToolBar createToolBar() {
    toolBar = new ActionToolBar(this);
    groupingComboBox = new GroupingComboBox(dispatcher);
    groupingComboBox.withSelectionListener(new Listener<FieldEvent>() {

        @Override
        public void handleEvent(FieldEvent be) {
            eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, currentPlace.copy().setGrouping(groupingComboBox.getGroupingModel())));
        }
    });
    toolBar.add(new Label(I18N.CONSTANTS.grouping()));
    toolBar.add(groupingComboBox);
    toolBar.addButton(UIActions.ADD, I18N.CONSTANTS.newSite(), IconImageBundle.ICONS.add());
    toolBar.addButton(UIActions.EDIT, I18N.CONSTANTS.edit(), IconImageBundle.ICONS.edit());
    toolBar.addDeleteButton(I18N.CONSTANTS.deleteSite());
    toolBar.add(new SeparatorToolItem());
    toolBar.addButton("IMPORT", "Import", IconImageBundle.ICONS.importIcon());
    toolBar.addExcelExportButton();
    toolBar.addPrintButton();
    toolBar.addButton("EMBED", I18N.CONSTANTS.embed(), IconImageBundle.ICONS.embed());
    return toolBar;
}
Also used : NavigationEvent(org.activityinfo.client.event.NavigationEvent) FieldEvent(com.extjs.gxt.ui.client.event.FieldEvent) SeparatorToolItem(com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem) Label(com.extjs.gxt.ui.client.widget.Label) ActionToolBar(org.activityinfo.client.page.common.toolbar.ActionToolBar) GroupingComboBox(org.activityinfo.client.page.entry.grouping.GroupingComboBox)

Example 7 with ActionToolBar

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

the class MonthlyReportsPanel method addToolBar.

private void addToolBar() {
    toolBar = new ActionToolBar();
    toolBar.setListener(this);
    toolBar.addSaveSplitButton();
    toolBar.add(new LabelToolItem(I18N.CONSTANTS.month() + ": "));
    monthCombo = new MappingComboBox<Month>();
    monthCombo.setEditable(false);
    monthCombo.addListener(Events.Select, new Listener<FieldEvent>() {

        @Override
        public void handleEvent(FieldEvent be) {
            selectStartMonth(monthCombo.getMappedValue());
        }
    });
    DateWrapper today = new DateWrapper();
    DateTimeFormat monthFormat = DateTimeFormat.getFormat("MMM yyyy");
    for (int year = today.getFullYear(); year != today.getFullYear() - 3; --year) {
        for (int month = 12; month != 0; --month) {
            DateWrapper d = new DateWrapper(year, month, 1);
            Month m = new Month(year, month);
            monthCombo.add(m, monthFormat.format(d.asDate()));
        }
    }
    toolBar.add(monthCombo);
    setTopComponent(toolBar);
}
Also used : LabelToolItem(com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem) Month(org.activityinfo.shared.command.Month) FieldEvent(com.extjs.gxt.ui.client.event.FieldEvent) DateWrapper(com.extjs.gxt.ui.client.util.DateWrapper) ActionToolBar(org.activityinfo.client.page.common.toolbar.ActionToolBar) DateTimeFormat(com.google.gwt.i18n.client.DateTimeFormat)

Example 8 with ActionToolBar

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

the class ChartEditor method createToolBar.

private void createToolBar() {
    toolBar = new ActionToolBar();
    typeGroup = new ChartTypeGroup(eventBus);
    toolBar.add(new LabelToolItem(I18N.CONSTANTS.chartType()));
    toolBar.add(typeGroup.getButtons());
    center.setTopComponent(toolBar);
}
Also used : LabelToolItem(com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem) ActionToolBar(org.activityinfo.client.page.common.toolbar.ActionToolBar)

Aggregations

ActionToolBar (org.activityinfo.client.page.common.toolbar.ActionToolBar)8 FieldEvent (com.extjs.gxt.ui.client.event.FieldEvent)2 LabelToolItem (com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem)2 SeparatorToolItem (com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem)2 DateWrapper (com.extjs.gxt.ui.client.util.DateWrapper)1 Label (com.extjs.gxt.ui.client.widget.Label)1 DateTimeFormat (com.google.gwt.i18n.client.DateTimeFormat)1 NavigationEvent (org.activityinfo.client.event.NavigationEvent)1 ActionListener (org.activityinfo.client.page.common.toolbar.ActionListener)1 GroupingComboBox (org.activityinfo.client.page.entry.grouping.GroupingComboBox)1 Month (org.activityinfo.shared.command.Month)1