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

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


  @Override
  public void testRender() {
    Cell<String> cell = createCell();
    String value = createCellValue();
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    Context context = new Context(0, 0, null);
    cell.render(context, value, sb);

    // Render the html.
    Element elem = Document.get().createDivElement();
    elem.setInnerSafeHtml(sb.toSafeHtml());
View Full Code Here


  @Override
  public void testRenderNegativeIndex() {
    Cell<String> cell = createCell();
    String value = createCellValue();
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    Context context = new Context(-1, -1, null);
    cell.render(context, value, sb);
    // Render the html.
    Element elem = Document.get().createDivElement();
    elem.setInnerSafeHtml(sb.toSafeHtml());
View Full Code Here

      }
    };

    // Render the cell.
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    Context context = new Context(0, 0, null);
    cell.render(context, "helloworld", sb);

    // Compare the expected render string.
    String expected = "<div style=\"padding-left: 64px;position:relative;zoom:1;\">";
    expected += cell.getImageHtml(Resources.prettyPiccy(),
View Full Code Here

    Cell<String> cell = createCell();
    Element parent = Document.get().createDivElement();
    parent.setInnerHTML(getExpectedInnerHtml());
    assertEquals("helloworld",
        Element.as(parent.getFirstChildElement().getChild(1)).getInnerHTML());
    Context context = new Context(0, 0, null);
    cell.setValue(context, parent, "test");
    assertEquals("test",
        Element.as(parent.getFirstChildElement().getChild(1)).getInnerHTML());
  }
View Full Code Here

   */
  public void testRender() {
    Cell<T> cell = createCell();
    T value = createCellValue();
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    Context context = new Context(0, 0, null);
    cell.render(context, value, sb);
    assertEquals(getExpectedInnerHtml(), sb.toSafeHtml().asString());
  }
View Full Code Here

   */
  public void testRenderNegativeIndex() {
    Cell<T> cell = createCell();
    T value = createCellValue();
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    Context context = new Context(-1, -1, null);
    cell.render(context, value, sb);
    assertEquals(getExpectedInnerHtml(), sb.toSafeHtml().asString());
  }
View Full Code Here

   * Test rendering the cell with a null value and no view data.
   */
  public void testRenderNull() {
    Cell<T> cell = createCell();
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    Context context = new Context(0, 0, null);
    cell.render(context, null, sb);
    assertEquals(getExpectedInnerHtmlNull(), sb.toSafeHtml().asString());
  }
View Full Code Here

    Event.setEventListener(parent, new EventListener() {
      @Override
      public void onBrowserEvent(Event event) {
        try {
          DOM.setEventListener(parent, null);
          Context context = new Context(0, 0, DEFAULT_KEY);
          cell.onBrowserEvent(context, parent, value, event, valueUpdater);
          parent.removeFromParent();
        } catch (Exception e) {
          // We are in an event loop, so events may not propagate out to JUnit.
          fail("An exception occured while handling the event: " + e.getMessage());
View Full Code Here

  public void testSetValue() {
    Cell<String> cell = createCell();
    String value = createCellValue();
    Element parent = Document.get().createDivElement();
    Context context = new Context(0, 0, null);
    cell.setValue(context, parent, value);
    assertEquals(getExpectedInnerHtml(), parent.getInnerHTML());
  }
View Full Code Here

        Cell<CellValue< ? extends Comparable< ? >>> cellWidget = columns.get( eventPhysicalCoordinate.getCol() ).getCell();

        // Implementations of AbstractCell aren't forced to initialise consumed events
        Set<String> consumedEvents = cellWidget.getConsumedEvents();
        if ( consumedEvents != null && consumedEvents.contains( eventType ) ) {
            Context context = new Context( eventPhysicalCoordinate.getRow(),
                                           eventPhysicalCoordinate.getCol(),
                                           eventPhysicalCoordinate );

            //The element containing the cell's HTML is nested inside two DIVs
            Element parent = eventTableCell.getFirstChildElement().getFirstChildElement();
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.