Search in sources :

Example 1 with DateRangeSelectorListener

use of org.eclipse.kapua.app.console.client.widget.DateRangeSelectorListener in project kapua by eclipse.

the class DeviceTabHistory method initToolBar.

private void initToolBar() {
    m_toolBar = new ToolBar();
    // 
    // Refresh Button
    m_refreshButton = new Button(MSGS.refreshButton(), AbstractImagePrototype.create(Resources.INSTANCE.refresh()), new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent ce) {
            if (!refreshProcess) {
                m_refreshButton.setEnabled(false);
                refreshProcess = true;
                reload();
                refreshProcess = false;
                m_refreshButton.setEnabled(true);
            }
        }
    });
    m_refreshButton.setEnabled(true);
    m_toolBar.add(m_refreshButton);
    m_toolBar.add(new SeparatorToolItem());
    m_export = new SplitButton(MSGS.export());
    m_export.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.download()));
    Menu menu = new Menu();
    menu.add(new MenuItem(MSGS.exportToExcel(), AbstractImagePrototype.create(Resources.INSTANCE.exportExcel()), new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            export("xls");
        }
    }));
    menu.add(new MenuItem(MSGS.exportToCSV(), AbstractImagePrototype.create(Resources.INSTANCE.exportCSV()), new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            export("csv");
        }
    }));
    m_export.setMenu(menu);
    m_toolBar.add(m_export);
    m_toolBar.add(new SeparatorToolItem());
    m_dateRangeSelector = new DateRangeSelector();
    m_dateRangeSelector.setListener(new DateRangeSelectorListener() {

        public void onUpdate() {
            m_dirty = true;
            refresh();
        }
    });
    m_toolBar.add(new FillToolItem());
    m_toolBar.add(new LabelToolItem(MSGS.dataDateRange()));
    m_toolBar.add(m_dateRangeSelector);
    m_toolBar.disable();
}
Also used : DateRangeSelectorListener(org.eclipse.kapua.app.console.client.widget.DateRangeSelectorListener) SeparatorToolItem(com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem) DateRangeSelector(org.eclipse.kapua.app.console.client.widget.DateRangeSelector) MenuItem(com.extjs.gxt.ui.client.widget.menu.MenuItem) LabelToolItem(com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem) SplitButton(com.extjs.gxt.ui.client.widget.button.SplitButton) Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent) SplitButton(com.extjs.gxt.ui.client.widget.button.SplitButton) ToolBar(com.extjs.gxt.ui.client.widget.toolbar.ToolBar) PagingToolBar(com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar) Menu(com.extjs.gxt.ui.client.widget.menu.Menu) FillToolItem(com.extjs.gxt.ui.client.widget.toolbar.FillToolItem) SelectionListener(com.extjs.gxt.ui.client.event.SelectionListener) MenuEvent(com.extjs.gxt.ui.client.event.MenuEvent)

Aggregations

ButtonEvent (com.extjs.gxt.ui.client.event.ButtonEvent)1 MenuEvent (com.extjs.gxt.ui.client.event.MenuEvent)1 SelectionListener (com.extjs.gxt.ui.client.event.SelectionListener)1 Button (com.extjs.gxt.ui.client.widget.button.Button)1 SplitButton (com.extjs.gxt.ui.client.widget.button.SplitButton)1 Menu (com.extjs.gxt.ui.client.widget.menu.Menu)1 MenuItem (com.extjs.gxt.ui.client.widget.menu.MenuItem)1 FillToolItem (com.extjs.gxt.ui.client.widget.toolbar.FillToolItem)1 LabelToolItem (com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem)1 PagingToolBar (com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar)1 SeparatorToolItem (com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem)1 ToolBar (com.extjs.gxt.ui.client.widget.toolbar.ToolBar)1 DateRangeSelector (org.eclipse.kapua.app.console.client.widget.DateRangeSelector)1 DateRangeSelectorListener (org.eclipse.kapua.app.console.client.widget.DateRangeSelectorListener)1