Search in sources :

Example 1 with LabelToolItem

use of com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem 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<>();
    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() + 2; 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);
    toolBar.setDirty(false);
    setTopComponent(toolBar);
}
Also used : LabelToolItem(com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem) Month(org.activityinfo.model.type.time.Month) FieldEvent(com.extjs.gxt.ui.client.event.FieldEvent) DateWrapper(com.extjs.gxt.ui.client.util.DateWrapper) ActionToolBar(org.activityinfo.ui.client.page.common.toolbar.ActionToolBar) DateTimeFormat(com.google.gwt.i18n.client.DateTimeFormat)

Example 2 with LabelToolItem

use of com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem in project activityinfo by bedatadriven.

the class IndicatorTreePanel method createFilterBar.

private void createFilterBar() {
    toolBar = new ToolBar();
    toolBar.add(new LabelToolItem(I18N.CONSTANTS.search()));
    filter = new FilterField();
    filter.addListener(Events.Blur, event -> {
        if (filter.getRawValue() == null || filter.getRawValue().length() == 0) {
            toolBar.setVisible(false);
        }
    });
    toolBar.add(filter);
    toolBar.setVisible(false);
    filter.bind(store);
    setTopComponent(toolBar);
}
Also used : LabelToolItem(com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem) ToolBar(com.extjs.gxt.ui.client.widget.toolbar.ToolBar) StoreFilterField(com.extjs.gxt.ui.client.widget.form.StoreFilterField)

Example 3 with LabelToolItem

use of com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem 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.ui.client.page.common.toolbar.ActionToolBar)

Aggregations

LabelToolItem (com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem)3 ActionToolBar (org.activityinfo.ui.client.page.common.toolbar.ActionToolBar)2 FieldEvent (com.extjs.gxt.ui.client.event.FieldEvent)1 DateWrapper (com.extjs.gxt.ui.client.util.DateWrapper)1 StoreFilterField (com.extjs.gxt.ui.client.widget.form.StoreFilterField)1 ToolBar (com.extjs.gxt.ui.client.widget.toolbar.ToolBar)1 DateTimeFormat (com.google.gwt.i18n.client.DateTimeFormat)1 Month (org.activityinfo.model.type.time.Month)1