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

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


    // Select the same value.
    NativeEvent nativeEvent = Document.get().createClickEvent(0, 0, 0, 0, 0,
        false, false, false, false);
    CellPreviewEvent<String> event = new CellPreviewEvent<String>(nativeEvent,
        display, new Context(0, 0, null), "test 0", false, false);
    manager.handleSelectionEvent(event, SelectAction.SELECT, model);
    assertEquals("test 0", model.getSelectedObject());

    // Select a different value.
    event = new CellPreviewEvent<String>(nativeEvent, display, new Context(1,
        0, null), "test 1", false, false);
    manager.handleSelectionEvent(event, SelectAction.SELECT, model);
    assertEquals("test 1", model.getSelectedObject());
  }
View Full Code Here


    // Toggle a different value.
    NativeEvent nativeEvent = Document.get().createClickEvent(0, 0, 0, 0, 0,
        false, false, false, false);
    CellPreviewEvent<String> event = new CellPreviewEvent<String>(nativeEvent,
        display, new Context(1, 0, null), "test 1", false, false);
    manager.handleSelectionEvent(event, SelectAction.TOGGLE, model);
    assertEquals("test 1", model.getSelectedObject());

    // Toggle the same value.
    manager.handleSelectionEvent(event, SelectAction.TOGGLE, model);
View Full Code Here

    Cell<T> parentCell = parentNodeInfo.getCell();
    String eventType = event.getType();
    Element cellParent = getCellParent();
    Object key = getValueKey();
    Context context = new Context(getIndex(), 0, key);
    boolean cellWasEditing = parentCell.isEditing(context, cellParent, value);

    // Update selection.
    boolean isSelectionHandled =
        parentCell.handlesSelection()
View Full Code Here

   *
   * @return true of the cell takes focus, false if not
   */
  boolean resetFocusOnCell() {
    if (parentNodeInfo != null) {
      Context context = new Context(getIndex(), 0, getValueKey());
      Cell<T> cell = parentNodeInfo.getCell();
      return cell.resetFocus(context, getCellParent(), value);
    }
    return false;
  }
View Full Code Here

    column.setFieldUpdater(fieldUpdater);

    // Fire the event to the cell.
    delayTestFinish(5000);
    cell.setViewData("test", "oldViewData");
    Context context = new Context(3, 0, null);
    column.onBrowserEvent(context, theElem, "test", theEvent);
  }
View Full Code Here

      }
    };
    column.setFieldUpdater(fieldUpdater);

    cell.setViewData("test", "oldViewData");
    Context context = new Context(3, 0, null);
    column.onBrowserEvent(context, theElem, "test", theEvent);

    fieldUpdater.assertUpdateCalled(true);
    fieldUpdater.assertIndex(3);
    fieldUpdater.assertObject("test");
View Full Code Here

      }
    };
    Column<String, String> column = new IdentityColumn<String>(cell);

    cell.setViewData("test", "oldViewData");
    Context context = new Context(3, 0, null);
    column.onBrowserEvent(context, theElem, "test", theEvent);
  }
View Full Code Here

  public void testRender() {
    TextCell cell = new TextCell();
    Column<String, String> column = new IdentityColumn<String>(cell);

    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    Context context = new Context(0, 0, null);
    column.render(context, "test", sb);
    assertEquals("test", sb.toSafeHtml().asString());
  }
View Full Code Here

          } else {
            image = closedImage;
          }
          // Render cell contents
          SafeHtmlBuilder cellBuilder = new SafeHtmlBuilder();
          Context context = new Context(i, 0, key);
          cell.render(context, value, cellBuilder);
          SafeStyles innerPadding =
              SafeStylesUtils.fromTrustedString("padding-" + paddingDirection + ": " + imageWidth
                  + "px;");
          SafeHtml innerDiv =
View Full Code Here

  public void testRenderViewData() {
    AbstractEditableCell<T, V> cell = createCell();
    T value = createCellValue();
    cell.setViewData(DEFAULT_KEY, createCellViewData());
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    Context context = new Context(0, 0, DEFAULT_KEY);
    cell.render(context, value, sb);
    String expectedInnerHtmlViewData = getExpectedInnerHtmlViewData();
    String asString = sb.toSafeHtml().asString();
    assertEquals(expectedInnerHtmlViewData, asString);
  }
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.