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();
}
Aggregations