Examples of ExpenseProxy


Examples of com.google.gwt.sample.expenses.shared.ExpenseProxy

  }

  @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) {
View Full Code Here

Examples of com.google.gwt.sample.expenses.shared.ExpenseProxy

    // Dialog box to obtain a reason for a denial
    denialPopup.addCloseHandler(new CloseHandler<PopupPanel>() {
      public void onClose(CloseEvent<PopupPanel> event) {
        String reasonDenied = denialPopup.getReasonDenied();
        ExpenseProxy record = denialPopup.getExpenseRecord();
        if (reasonDenied == null || reasonDenied.length() == 0) {
          // Clear the view data.
          final Object key = items.getKey(record);
          approvalCell.clearViewData(key);
View Full Code Here

Examples of com.google.gwt.sample.expenses.shared.ExpenseProxy

            knownExpenseKeys = new HashMap<Object, ExpenseProxy>();
          }
          for (ExpenseProxy value : newValues) {
            Object key = items.getKey(value);
            if (!isInitialData) {
              ExpenseProxy existing = knownExpenseKeys.get(key);
              if (existing == null
                  || !value.getAmount().equals(existing.getAmount())
                  || !value.getDescription().equals(existing.getDescription())
                  || !value.getCategory().equals(existing.getCategory())) {
                (new PhaseAnimation.CellTablePhaseAnimation<ExpenseProxy>(
                    table, value, items)).run();
              }
            }
            knownExpenseKeys.put(key, value);
View Full Code Here

Examples of com.google.gwt.sample.expenses.shared.ExpenseProxy

      }
    }

    // Create a delta and sync with the value store.
    ExpenseRequest editRequest = expensesRequestFactory.expenseRequest();
    ExpenseProxy editableRecord = editRequest.edit(record);
    editableRecord.setApproval(approval);
    editableRecord.setReasonDenied(reasonDenied);
    editRequest.persist().using(editableRecord).fire(new Receiver<Void>() {
      @Override
      public void onSuccess(Void ignore) {
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.