Pregunta

¿Alguien tiene una idea sobre cómo implementar un GWT CellTable con un ImageResourceCell de GWT 2.1M3?

Tengo el siguiente, pero parece que no puede averiguar la forma correcta de añadir una ImageResourceCell

CellTable<DeviceInfo> ct = new CellTable<DeviceInfo>();
  // ct.setSelectionEnabled(true);

  ct.setSelectionModel(setSelectionModel(ct));
  ct.setPageSize(50);
  // listData.addView(ct);
  listData.addDataDisplay(ct);


  ct.addColumn(new TextColumn<DeviceInfo>() {

   @Override
   public String getValue(DeviceInfo devInfo) {
    return devInfo.getDeviceName();
   }
  }, "Name");

// Esto no funciona

       ct.addColumn(new IdentityColumn<DeviceInfo>(new ImageResourceCell()) {

       @Override
       public String getValue(DeviceInfo devInfo) {
        return <Some imageResource>;
       }
      }, "Status");

Cualquier ayuda en esto sería el rock! Gracias.

¿Fue útil?

Solución

Estoy solucionar esto a mí mismo, pero aquí hay un ejemplo que tengo obras:

CellTable<Entity> dataTable = new CellTable<Entity>();
Column<Entity, ImageResource> status = new Column<Entity, ImageResource>(new ImageResourceCell()) {
          @Override
          public ImageResource getValue(Entity entity) {
            ...ImageResource lookup stuff...
            return imgRsrc;
          }
       };

dataTable.addColumn(status, "Status");
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top