}
@SuppressWarnings("deprecation")
public void onCustom() {
request = requestFactory.expenseRequest();
ExpenseProxy editableExpense = request.edit(expense);
editableExpense.setDescription(nameText.getText());
editableExpense.setCategory(categoryText.getText());
request.persist().using(editableExpense);
// TODO(jgw): validate amount (in dollars -- database is in pennies)
String amountText = priceText.getText();
double amount = Double.parseDouble(amountText);
editableExpense.setAmount(amount);
// TODO(jgw): Use non-deprecated date methods for this.
Date date = new Date(
dateYear.getSelectedIndex() + 100,
dateMonth.getSelectedIndex(),
dateDay.getSelectedIndex() + 1
);
editableExpense.setCreated(date);
// TODO: wait throbber
request.fire(new Receiver<Void>() {
@Override
public void onSuccess(Void ignore) {