IButton customButton = new EnhancedIButton(MSG.common_buttonbar_custom());
customButton.setWidth(60);
customButton.setActionType(SelectionType.RADIO);
customButton.setRadioGroup(TIMERANGE);
customButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
CustomDateRangeWindow customDateRangeWindow = new CustomDateRangeWindow(MSG
.common_buttonbar_custom_window_title(), MSG.common_buttonbar_custom_window_subtitle(), self,
new Date(CustomDateRangeState.getInstance().getStartTime()), new Date(CustomDateRangeState
.getInstance().getEndTime()));
CustomDateRangeState.getInstance().setCustomDateRangeActive(true);
customDateRangeWindow.show();
}
});
toolStrip.addMember(customButton);
toolStrip.addSpacer(30);
dateRangeLabel = new Label();
dateRangeLabel.setWidth(400);
dateRangeLabel.addStyleName("graphDateTimeRangeLabel");
showUserFriendlyTimeRange(CustomDateRangeState.getInstance().getStartTime(), CustomDateRangeState.getInstance()
.getEndTime());
toolStrip.addMember(dateRangeLabel);
// Only allow auto refresh rate change in views actually performing auto refresh, otherwise offer only refresh
toolStrip.addSpacer(20);
if (isAutoRefresh) {
refreshIntervalMenu = new RefreshIntervalMenu((AutoRefresh)refreshable);
toolStrip.addMember(refreshIntervalMenu);
} else {
this.refreshButton = new EnhancedIButton(MSG.common_button_refresh());
refreshButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
redrawGraphs();
}
});
toolStrip.addMember(refreshButton);