use of jgnash.engine.recurring.DailyReminder in project jgnash by ccavanaugh.
the class EngineTest method testReminders.
@Test
public void testReminders() throws IOException {
assertEquals(0, e.getReminders().size());
assertEquals(0, e.getPendingReminders().size());
Reminder r = new DailyReminder();
r.setIncrement(1);
r.setEndDate(null);
assertTrue(e.addReminder(r));
assertEquals(1, e.getReminders().size());
assertEquals(1, e.getPendingReminders().size());
// close and reopen to force check for persistence
closeEngine();
e = EngineFactory.bootLocalEngine(testFile, EngineFactory.DEFAULT, EngineFactory.EMPTY_PASSWORD);
assertEquals(e.getReminders().size(), 1);
// remove a reminder
e.removeReminder(e.getReminders().get(0));
assertEquals(0, e.getReminders().size());
assertEquals(0, e.getPendingReminders().size());
// close and reopen to force check for persistence
closeEngine();
e = EngineFactory.bootLocalEngine(testFile, EngineFactory.DEFAULT, EngineFactory.EMPTY_PASSWORD);
assertEquals(0, e.getReminders().size());
assertEquals(0, e.getPendingReminders().size());
}
use of jgnash.engine.recurring.DailyReminder in project jgnash by ccavanaugh.
the class DayTab method getReminder.
/**
* @see jgnash.ui.recurring.RecurringTab#getReminder()
*/
@Override
public Reminder getReminder() {
DailyReminder r = (DailyReminder) reminder;
int inc = ((Number) numberSpinner.getValue()).intValue();
LocalDate endDate = null;
if (endButton.isSelected()) {
endDate = endDateField.getLocalDate();
}
r.setIncrement(inc);
r.setEndDate(endDate);
return reminder;
}
use of jgnash.engine.recurring.DailyReminder in project jgnash by ccavanaugh.
the class DayTab method setReminder.
/**
* @see jgnash.ui.recurring.RecurringTab#setReminder(jgnash.engine.recurring.Reminder)
*/
@Override
public void setReminder(final Reminder reminder) {
assert reminder instanceof DailyReminder;
this.reminder = reminder;
DailyReminder r = (DailyReminder) reminder;
numberSpinner.setValue(r.getIncrement());
if (r.getEndDate() != null) {
endDateField.setDate(r.getEndDate());
endButton.setSelected(true);
}
updateForm();
}
use of jgnash.engine.recurring.DailyReminder in project jgnash by ccavanaugh.
the class DayTabController method initialize.
@FXML
void initialize() {
super.initialize();
reminder = new DailyReminder();
numberSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 365, 1, 1));
}
Aggregations