コード例 #1
0
 @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();
   }
 }
コード例 #2
0
            @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>");
                }
              }
            }