Package com.google.gwt.widgetideas.table.client.overrides.HTMLTable

Examples of com.google.gwt.widgetideas.table.client.overrides.HTMLTable.RowFormatter


    // Visable Styles.
    t.getCellFormatter().setVisible(0, 0, false);
    assertTrue(t.getCellFormatter().isVisible(2, 2));
    assertFalse(t.getCellFormatter().isVisible(0, 0));
    RowFormatter formatter = t.getRowFormatter();
    formatter.setVisible(3, false);
    assertFalse(formatter.isVisible(3));
    assertTrue(formatter.isVisible(2));
    assertTrue(t.getCellFormatter().isVisible(2, 0));

    // Style name.
    assertEquals("goodbye hello", t.getCellFormatter().getStyleName(2, 2));
    t.getRowFormatter().setStyleName(3, "newStyle");
View Full Code Here


        // Visable Styles.
        t.getCellFormatter().setVisible(0, 0, false);
        assertTrue(t.getCellFormatter().isVisible(2, 2));
        assertFalse(t.getCellFormatter().isVisible(0, 0));
        RowFormatter formatter = t.getRowFormatter();
        formatter.setVisible(3, false);
        assertFalse(formatter.isVisible(3));
        assertTrue(formatter.isVisible(2));
        assertTrue(t.getCellFormatter().isVisible(2, 0));

        // Style name.
        assertEquals("goodbye hello", t.getCellFormatter().getStyleName(2, 2));
        t.getRowFormatter().setStyleName(3, "newStyle");
View Full Code Here

   */
  public void testCheckboxSelection() {
    // Initialize the grid
    SelectionGrid testGrid = getSelectionGrid();
    testGrid.resize(3, 4);
    RowFormatter rowFormatter = testGrid.getRowFormatter();
    CellFormatter cellFormatter = testGrid.getCellFormatter();

    // Verify the column count before setting the checkbox policy
    assertEquals(4, testGrid.getColumnCount());
    for (int i = 0; i < 3; i++) {
      Element tr = rowFormatter.getElement(i);
      assertEquals(4, tr.getChildNodes().getLength());
    }

    // Verify the column count after setting the checkbox policy
    testGrid.setSelectionPolicy(SelectionPolicy.CHECKBOX);
    assertEquals(4, testGrid.getColumnCount());
    for (int i = 0; i < 3; i++) {
      Element tr = rowFormatter.getElement(i);
      assertEquals(5, tr.getChildNodes().getLength());
    }

    // Set html and verify
    testGrid.setText(0, 0, "test");
    assertEquals("test", testGrid.getText(0, 0));
    assertEquals("test", cellFormatter.getElement(0, 0).getInnerText());
    assertEquals("test",
        DOM.getChild(rowFormatter.getElement(0), 1).getInnerText());
  }
View Full Code Here

   * Test that hovering a cell correctly sets the style.
   */
  public void testHover() {
    // Initialize the grid
    SelectionGrid testGrid = getSelectionGrid();
    RowFormatter rowFormatter = testGrid.getRowFormatter();
    CellFormatter cellFormatter = testGrid.getCellFormatter();

    // Hover a cell
    assertEquals(rowFormatter.getStyleName(1), "");
    assertEquals(cellFormatter.getStyleName(1, 1), "");
    testGrid.hoverCell(cellFormatter.getElement(1, 1));
    assertEquals(rowFormatter.getStyleName(1), "hovering");
    assertEquals(cellFormatter.getStyleName(1, 1), "hovering");

    // Hover a cell in the same row
    testGrid.hoverCell(cellFormatter.getElement(1, 3));
    assertEquals(rowFormatter.getStyleName(1), "hovering");
    assertEquals(cellFormatter.getStyleName(1, 1), "");
    assertEquals(cellFormatter.getStyleName(1, 3), "hovering");

    // Hover a cell in a different row
    testGrid.hoverCell(cellFormatter.getElement(2, 4));
    assertEquals(rowFormatter.getStyleName(1), "");
    assertEquals(cellFormatter.getStyleName(1, 3), "");
    assertEquals(rowFormatter.getStyleName(2), "hovering");
    assertEquals(cellFormatter.getStyleName(2, 4), "hovering");

    // Unhover the cell
    testGrid.hoverCell(null);
    assertEquals(rowFormatter.getStyleName(2), "");
    assertEquals(cellFormatter.getStyleName(2, 4), "");
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.widgetideas.table.client.overrides.HTMLTable.RowFormatter

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.