Package com.google.gwt.cell.client.Cell

Examples of com.google.gwt.cell.client.Cell.Context


    for (int i = 0, len = grid.getStore().size(); i < len; i++) {
      Element cell = grid.getView().getCell(i, col);
      if (cell != null) {
        SafeHtmlBuilder sb = new SafeHtmlBuilder();
        M item = grid.getStore().get(i);
        getCell().render(new Context(i, col, kp.getKey(item)), item, sb);
        cell.getFirstChildElement().setInnerHTML(sb.toSafeHtml().asString());
      }
    }
  }
View Full Code Here


    }
  }

  protected String getBodyContent(M model, int rowIndex) {
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    contentCell.render(new Context(rowIndex, 0, grid.getStore().getKeyProvider().getKey(model)), model, sb);
    return sb.toSafeHtml().asString();
  }
View Full Code Here

      if (value != null) {
        text = value.toString();
      }
      sb.append(Util.isEmptyString(text) ? SafeHtmlUtils.fromTrustedString("&#160;") : SafeHtmlUtils.fromString(text));
    } else {
      Context context = new Context(store.indexOf(model), 0, store.getKeyProvider().getKey(model));
      cell.render(context, value, sb);
    }
    return sb.toSafeHtml();
  }
View Full Code Here

    }
    M value = node.getModel();

    Element cellParent = getView().getTextElement(node);
    if (value != null && cellParent != null) {
      Context context = new Context(store.indexOf(value), 0, getStore().getKeyProvider().getKey(value));
      fireEventToCell(event, event.getType(), cellParent, value, context);
    }
  }
View Full Code Here

    M value = getStore().get(rowIndex);
    ColumnConfig<M, ?> config = cm.getColumn(colIndex);
    Element cellParent = getView().getCell(rowIndex, colIndex);
    if (value != null && config != null && cellParent != null) {
      Context context = new Context(rowIndex, colIndex, getStore().getKeyProvider().getKey(value));
      return fireEventToCell(event, event.getType(), cellParent.getFirstChildElement(), value, context, config);
    }
    return null;
  }
View Full Code Here

      val = valueProvider.getValue(m);
    }
    Cell<N> r = cm.getCell(colIndex);
    if (r != null) {
      SafeHtmlBuilder sb = new SafeHtmlBuilder();
      r.render(new Context(rowIndex, colIndex, ds.getKeyProvider().getKey(m)), val, sb);
      return sb.toSafeHtml();
    }

    String text = null;
    if (val != null) {
View Full Code Here

      // Get the cell parent before doing selection in case the list is redrawn.
      boolean isSelectionHandled = cell.handlesSelection()
          || KeyboardSelectionPolicy.BOUND_TO_SELECTION == getKeyboardSelectionPolicy();
      Element cellParent = getCellParent(cellTarget);
      T value = getVisibleItem(indexOnPage);
      Context context = new Context(idx, 0, getValueKey(value));
      CellPreviewEvent<T> previewEvent = CellPreviewEvent.fire(this, event,
          this, context, value, cellIsEditing, isSelectionHandled);
      if (isClick && !cellIsEditing && !isSelectionHandled) {
        doSelection(event, value, indexOnPage);
      }
View Full Code Here

      if (isSelected) {
        classesBuilder.append(selectedItem);
      }

      SafeHtmlBuilder cellBuilder = new SafeHtmlBuilder();
      Context context = new Context(i, 0, getValueKey(value));
      cell.render(context, value, cellBuilder);

      if (i == keyboardSelectedRow) {
        // This is the focused item.
        if (isFocused) {
View Full Code Here

    int row = getKeyboardSelectedRow();
    if (isRowWithinBounds(row)) {
      Element rowElem = getKeyboardSelectedElement();
      Element cellParent = getCellParent(rowElem);
      T value = getVisibleItem(row);
      Context context = new Context(row + getPageStart(), 0, getValueKey(value));
      return cell.resetFocus(context, cellParent, value);
    }
    return false;
  }
View Full Code Here

      val = valueProvider.getValue(m);
    }
    Cell<N> r = cm.getCell(colIndex);
    if (r != null) {
      SafeHtmlBuilder sb = new SafeHtmlBuilder();
      r.render(new Context(rowIndex, colIndex, ds.getKeyProvider().getKey(m)), val, sb);
      return sb.toSafeHtml();
    }

    String text = null;
    if (val != null) {
View Full Code Here

TOP

Related Classes of com.google.gwt.cell.client.Cell.Context

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.