コード例 #1
0
  /*
   * @see
   * com.vimukti.accounter.web.client.ui.grids.ListGrid#getColumnValue(java
   * .lang.Object, int)
   */
  @Override
  protected Object getColumnValue(ClientTAXCode taxCode, int index) {
    switch (index) {
      case 0:
        return taxCode.isActive();
      case 1:
        return taxCode.getName() != null ? taxCode.getName() : "";
      case 2:
        return taxCode.getDescription() != null ? taxCode.getDescription() : "";
      case 3:
        if (taxCode.isTaxable())
          // return FinanceApplication.getFinanceImages().tickMark()
          // .getURL();
          return Accounter.getFinanceImages().tickMark();
        else
          // return FinanceApplication.getFinanceImages().balnkImage()
          // .getURL();
          return Accounter.getFinanceImages().balnkImage();
      case 4:
        return Accounter.getFinanceMenuImages().delete();
        // return "/images/delete.png";

    }
    return "";
  }
コード例 #2
0
 @Override
 protected int sort(ClientTAXCode obj1, ClientTAXCode obj2, int index) {
   switch (index) {
     case 1:
       return obj1.getName().compareTo(obj2.getName());
     case 2:
       String desc1 = obj1.getDescription() != null ? obj1.getDescription() : "";
       String desc2 = obj2.getDescription() != null ? obj2.getDescription() : "";
       return desc1.toLowerCase().compareTo(desc2.toLowerCase());
     case 3:
       Boolean taxable1 = obj1.isTaxable();
       Boolean taxable2 = obj2.isTaxable();
       return taxable1.compareTo(taxable2);
   }
   return 0;
 }