@Override
 public ImageResource getValue(PrecioItemProxy object) {
   if (object.getEstadoColor().equalsIgnoreCase("A1")) {
     return MyResource.INSTANCE.getImgGreen20();
   } else if (object.getEstadoColor().equalsIgnoreCase("A0")) {
     return MyResource.INSTANCE.getImgOrange20();
   } else {
     return MyResource.INSTANCE.getImgGray20();
   }
 }
 @Override
 public boolean isValid(PrecioItemProxy value, String filter) {
   if (filter == null || value == null) {
     return true;
   } else {
     String values =
         value.getId().toString().toLowerCase()
             + " "
             + value.getCodigo().toLowerCase()
             + " "
             + value.getMarca().toLowerCase()
             + " "
             + value.getDescripcion().toLowerCase();
     return values.contains(filter.toLowerCase());
   }
 }
            @Override
            public void render(Cell.Context context, String value, SafeHtmlBuilder sb) {
              // Get the view data.
              Object key = context.getKey();
              TextInputCell.ViewData viewData = getViewData(key);
              if (viewData != null && viewData.getCurrentValue().equals(value)) {
                clearViewData(key);
                viewData = null;
              }

              String s = (viewData != null) ? viewData.getCurrentValue() : value;
              if (s != null) {
                if (modo.equalsIgnoreCase(GridPrecioItem.E)) {
                  PrecioItemProxy object = (PrecioItemProxy) key;
                  if (object.getEstadoColor().equalsIgnoreCase("A1")) {
                    sb.appendHtmlConstant(
                        "<input type=\"text\" "
                            + "value=\""
                            + value
                            + "\" "
                            + " tabindex=\"-1\"></input>");
                  } else {
                    sb.appendHtmlConstant(
                        "<input type=\"text\" "
                            + "value=\""
                            + value
                            + "\" "
                            + " tabindex=\"-1\" DISABLED></input>");
                  }
                } else if (modo.equalsIgnoreCase(GridPrecioItem.L)) {
                  sb.appendHtmlConstant(
                      "<input type=\"text\" "
                          + "value=\""
                          + value
                          + "\" "
                          + " tabindex=\"-1\" DISABLED></input>");
                }
              }
            }
  private void calcularDescuento(int index, PrecioItemProxy object, String value) {
    if (!FieldVerifier.notIsNumberPositivo(value, "Descuento")) {
      ContextMantenimientoPrecioItem context = FACTORY.contextMantenimientoPrecioItem();
      FACTORY.initialize(EVENTBUS);
      PrecioItemProxy beanEdit = context.edit(object);
      BigDecimal valPrecioSd = object.getPrecioSD();
      BigDecimal valDescuento = BigDecimal.valueOf(Double.parseDouble(value));
      BigDecimal valPrecioVenta = object.getPrecioSD().subtract(valDescuento);
      BigDecimal valValorVenta =
          valPrecioVenta.divide(
              UISesionImpl.beanInitParam
                  .getIgv()
                  .divide(BigDecimal.valueOf(100), 5, RoundingMode.HALF_UP)
                  .add(BigDecimal.ONE),
              5,
              RoundingMode.HALF_UP);
      BigDecimal igv = valPrecioVenta.subtract(valValorVenta);
      beanEdit.setPrecioSD(valPrecioSd);
      beanEdit.setDescuento(valDescuento);
      beanEdit.setPrecioVenta(valPrecioVenta);
      beanEdit.setValorVenta(valValorVenta);
      beanEdit.setIgv(igv);
      // GWT.log("Index Vista: " + index);
      // index = dataProvider.getList().indexOf(object);
      int indexModel = data.indexOf(object);
      // GWT.log("Index Modelo: " + indexModel);
      data.set(indexModel, beanEdit);
      indexUpdates.add(indexModel);
      context.fire();
      dataProvider.refresh();
      // Update the row and subrow.
      setKeyboardSelectedRow(index, 0, true);
      // Update the column index.
      setKeyboardSelectedColumn(6, true);
    } else {

    }
  }
 @Override
 public String getValue(PrecioItemProxy object) {
   return object.getDescripcion();
 }
 @Override
 public String getValue(PrecioItemProxy object) {
   return object.getMarca();
 }
 @Override
 public Number getValue(PrecioItemProxy object) {
   return object.getPrecioVenta();
 }
 @Override
 public String getValue(PrecioItemProxy object) {
   return object.getDescuento().toString();
 }
 @Override
 public Date getValue(PrecioItemProxy object) {
   return object.getFechaFin();
 }