use of jgnash.engine.recurring.MonthlyReminder in project jgnash by ccavanaugh.
the class MonthTab method getReminder.
/**
* @see jgnash.ui.recurring.RecurringTab#getReminder()
*/
@Override
public Reminder getReminder() {
int inc = ((Number) numberSpinner.getValue()).intValue();
LocalDate endDate = null;
if (endButton.isSelected()) {
endDate = endDateField.getLocalDate();
}
reminder.setIncrement(inc);
reminder.setEndDate(endDate);
((MonthlyReminder) reminder).setType(typeComboBox.getSelectedIndex());
return reminder;
}
use of jgnash.engine.recurring.MonthlyReminder in project jgnash by ccavanaugh.
the class Engine method createDefaultReminder.
/**
* Creates a default reminder given a transaction and the primary account. The Reminder will need to persisted.
*
* @param transaction Transaction for the reminder. The transaction wil be cloned
* @param account primary account
* @return new default {@code MonthlyReminder}
*/
public Reminder createDefaultReminder(final Transaction transaction, final Account account) {
final Reminder reminder = new MonthlyReminder();
try {
reminder.setAccount(account);
reminder.setStartDate(transaction.getLocalDate().plusMonths(1));
reminder.setTransaction((Transaction) transaction.clone());
reminder.setDescription(transaction.getPayee());
reminder.setNotes(transaction.getMemo());
} catch (final CloneNotSupportedException e) {
logSevere(e.getLocalizedMessage());
}
return reminder;
}
use of jgnash.engine.recurring.MonthlyReminder in project jgnash by ccavanaugh.
the class MonthTabController method initialize.
@FXML
void initialize() {
super.initialize();
reminder = new MonthlyReminder();
numberSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 24, 1, 1));
typeComboBox.getItems().addAll(resources.getString("Column.Date"), resources.getString("Column.Day"));
typeComboBox.getSelectionModel().select(0);
}
Aggregations