Ejemplo n.º 1
0
  private void displayReport() {
    errorText.setInnerText("");
    purposeText.setText(report.getPurpose());
    notesText.setText(report.getNotes());
    String department = report.getDepartment();
    departmentList.setSelectedIndex(0);
    for (int i = 0; i < Expenses.DEPARTMENTS.length; i++) {
      if (Expenses.DEPARTMENTS[i].equals(department)) {
        departmentList.setSelectedIndex(i);
      }
    }

    Date d = report.getCreated();
    showCreationDate(d);
  }
Ejemplo n.º 2
0
 public void create(EmployeeProxy reporter) {
   request = requestFactory.reportRequest();
   report = request.create(ReportProxy.class);
   request.persist().using(report);
   report.setReporter(reporter);
   displayReport();
 }
Ejemplo n.º 3
0
  @SuppressWarnings("deprecation")
  public void onCustom() {
    ReportProxy editableReport = request.edit(report);
    editableReport.setPurpose(purposeText.getText());
    editableReport.setNotes(notesText.getText());
    editableReport.setDepartment(departmentList.getValue(departmentList.getSelectedIndex()));

    // TODO(jgw): Use non-deprecated date methods for this.
    Date date =
        new Date(
            dateYear.getSelectedIndex() + 100,
            dateMonth.getSelectedIndex(),
            dateDay.getSelectedIndex() + 1);
    editableReport.setCreated(date);

    // TODO: wait throbber
    request.fire(
        new Receiver<Void>() {
          @Override
          public void onSuccess(Void ignore) {}

          // use onViolations to check for ConstraintViolations.
        });
  }
Ejemplo n.º 4
0
 public String getPageTitle() {
   return report != null ? report.getPurpose() : "";
 }