Add option to display one day of data

This commit is contained in:
Ann Priestman 2018-05-09 12:54:43 -04:00
parent 5f4149901c
commit 8a8484db68

View File

@ -212,7 +212,7 @@ public class HealthMonitorDashboard {
// Create the combo box for selecting how much data to display // Create the combo box for selecting how much data to display
String[] dateOptionStrings = Arrays.stream(DateRange.values()).map(e -> e.getLabel()).toArray(String[]::new); String[] dateOptionStrings = Arrays.stream(DateRange.values()).map(e -> e.getLabel()).toArray(String[]::new);
dateComboBox = new JComboBox<>(dateOptionStrings); dateComboBox = new JComboBox<>(dateOptionStrings);
dateComboBox.setSelectedItem(DateRange.TWO_WEEKS.getLabel()); dateComboBox.setSelectedItem(DateRange.ONE_DAY.getLabel());
// Set up the listener on the date combo box // Set up the listener on the date combo box
dateComboBox.addActionListener(new ActionListener() { dateComboBox.addActionListener(new ActionListener() {
@ -401,11 +401,13 @@ public class HealthMonitorDashboard {
*/ */
@NbBundle.Messages({"HealthMonitorDashboard.DateRange.all=All", @NbBundle.Messages({"HealthMonitorDashboard.DateRange.all=All",
"HealthMonitorDashboard.DateRange.twoWeeks=Two weeks", "HealthMonitorDashboard.DateRange.twoWeeks=Two weeks",
"HealthMonitorDashboard.DateRange.oneWeek=One week"}) "HealthMonitorDashboard.DateRange.oneWeek=One week",
"HealthMonitorDashboard.DateRange.oneDay=One day"})
private enum DateRange { private enum DateRange {
ALL(Bundle.HealthMonitorDashboard_DateRange_all(), 0), ALL(Bundle.HealthMonitorDashboard_DateRange_all(), 0),
TWO_WEEKS(Bundle.HealthMonitorDashboard_DateRange_twoWeeks(), 14), TWO_WEEKS(Bundle.HealthMonitorDashboard_DateRange_twoWeeks(), 14),
ONE_WEEK(Bundle.HealthMonitorDashboard_DateRange_oneWeek(), 7); ONE_WEEK(Bundle.HealthMonitorDashboard_DateRange_oneWeek(), 7),
ONE_DAY(Bundle.HealthMonitorDashboard_DateRange_oneDay(), 1);
private final String label; private final String label;
private final long numberOfDays; private final long numberOfDays;