コード例 #1
0
 @Override
 public Object getColumnData(SalesByCustomerDetail record, int columnIndex) {
   switch (columnIndex) {
     case 2:
       return Utility.getTransactionName(record.getType());
     case 1:
       return getDateByCompanyType(record.getDate());
     case 3:
       return record.getNumber();
     case 0:
       return "";
       // case 4:
       // return record.getDueDate();
     case 4:
       return record.getAmount();
   }
   return null;
 }
コード例 #2
0
 @Override
 public void processRecord(SalesByCustomerDetail record) {
   // if (sectionDepth == 0) {
   // addSection(new String[] { "", "" }, new String[] { "", "", "",
   // getMessages().total() }, new int[] { 4 });
   // } else
   if (sectionDepth == 0) {
     this.sectionName = record.getName();
     addSection(
         new String[] {sectionName},
         new String[] {"", "", "", getMessages().total()},
         new int[] {4});
     // addSection(sectionName, "", new int[] { 5 });
   } else if (sectionDepth == 1) {
     // No need to do anything, just allow adding this record
     if (!sectionName.equals(record.getName())) {
       endSection();
     } else {
       return;
     }
   }
   // Go on recursive calling if we reached this place
   processRecord(record);
 }
コード例 #3
0
  public int sort(SalesByCustomerDetail obj1, SalesByCustomerDetail obj2, int col) {

    int ret = obj1.getName().toLowerCase().compareTo(obj2.getName().toLowerCase());
    if (ret != 0) {
      return ret;
    }
    switch (col) {
      case 2:
        return UIUtils.compareInt(obj1.getType(), obj2.getType());
      case 1:
        return obj1.getDate().compareTo(obj2.getDate());
      case 3:
        return UIUtils.compareInt(
            Integer.parseInt(obj1.getNumber()), Integer.parseInt(obj2.getNumber()));
      case 0:
        return obj1.getName().toLowerCase().compareTo(obj2.getName().toLowerCase());
      case 4:
        return obj1.getDueDate().compareTo(obj2.getDueDate());
      case 5:
        return UIUtils.compareDouble(obj1.getAmount(), obj2.getAmount());
    }
    return 0;
  }
コード例 #4
0
 @Override
 public ClientFinanceDate getStartDate(SalesByCustomerDetail obj) {
   return obj.getStartDate();
 }