Пример #1
0
  @Override
  public TooltipInfo getTooltipInfo(Element element) {
    CellReference<JsonObject> cell = getWidget().getCellReference(element);

    if (cell != null) {
      JsonObject row = cell.getRow();
      if (row == null) {
        return null;
      }

      Column<?, JsonObject> column = cell.getColumn();
      if (!(column instanceof CustomGridColumn)) {
        // Selection checkbox column
        return null;
      }
      CustomGridColumn c = (CustomGridColumn) column;

      JsonObject cellDescriptions = row.getObject(GridState.JSONKEY_CELLDESCRIPTION);

      if (cellDescriptions != null && cellDescriptions.hasKey(c.id)) {
        return new TooltipInfo(cellDescriptions.getString(c.id));
      } else if (row.hasKey(GridState.JSONKEY_ROWDESCRIPTION)) {
        return new TooltipInfo(row.getString(GridState.JSONKEY_ROWDESCRIPTION));
      } else {
        return null;
      }
    }

    return super.getTooltipInfo(element);
  }
Пример #2
0
    @Override
    public String getStyle(CellReference<JsonObject> cellReference) {
      JsonObject row = cellReference.getRow();
      if (!row.hasKey(GridState.JSONKEY_CELLSTYLES)) {
        return null;
      }

      Column<?, JsonObject> column = cellReference.getColumn();
      if (!(column instanceof CustomGridColumn)) {
        // Selection checkbox column
        return null;
      }
      CustomGridColumn c = (CustomGridColumn) column;

      JsonObject cellStylesObject = row.getObject(GridState.JSONKEY_CELLSTYLES);
      assert cellStylesObject != null;

      if (cellStylesObject.hasKey(c.id)) {
        return cellStylesObject.getString(c.id);
      } else {
        return null;
      }
    }
Пример #3
0
 private void fireItemClick(CellReference<?> cell, NativeEvent mouseEvent) {
   String rowKey = getRowKey((JsonObject) cell.getRow());
   String columnId = getColumnId(cell.getColumn());
   getRpcProxy(GridServerRpc.class)
       .itemClick(rowKey, columnId, MouseEventDetailsBuilder.buildMouseEventDetails(mouseEvent));
 }
Пример #4
0
 @JsProperty
 Object getData() {
   return cell.getColumn().getValue(cell.getRow());
 }
Пример #5
0
 @JsProperty
 String getColumnName() {
   return ((GridColumn) cell.getColumn()).getJsColumn().getName();
 }
Пример #6
0
 @JsProperty
 int getIndex() {
   return cell.getColumnIndex();
 }
Пример #7
0
 @JsProperty
 Element getElement() {
   return cell.getElement();
 }