Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.TableElement


    return tr.getCells().getLength();
  }

  @Override
  protected TableCellElement getHeaderElement(CellTable<String> table, int column) {
    TableElement tableElem = table.getElement().cast();
    TableSectionElement thead = tableElem.getTHead();
    TableRowElement tr = thead.getRows().getItem(0);
    return tr.getCells().getItem(column);
  }
View Full Code Here


     */
    private void replaceTableSection(AbstractCellTable<?> table, TableSectionElement section,
        SafeHtml html) {
      String sectionName = StringCase.toLower(section.getTagName());
      TableSectionElement newSection = convertToSectionElement(table, sectionName, html);
      TableElement tableElement = table.getElement().cast();
      tableElement.replaceChild(newSection, section);
      if ("tbody".equals(sectionName)) {
        ((TableSectionChangeHandler) table).onTableBodyChange(newSection);
      } else if ("thead".equals(sectionName)) {
        ((TableSectionChangeHandler) table).onTableHeadChange(newSection);
      } else if ("tfoot".equals(sectionName)) {
View Full Code Here

    Resources res = GWT.create(Resources.class);
    DataGrid<String> dataGrid = new DataGrid<String>(20, res);
   
    String dataGridWidgetStyle = res.dataGridStyle().dataGridWidget();
   
    TableElement tableElem = dataGrid.getElement().cast();
    assertTrue(tableElem.getClassName().contains(dataGridWidgetStyle));
  }
View Full Code Here

    return new DataGrid<String>();
  }

  @Override
  protected TableCellElement getBodyElement(DataGrid<String> table, int row, int column) {
    TableElement tableElem = table.tableData.getElement().cast();
    TableSectionElement tbody = tableElem.getTBodies().getItem(0);
    TableRowElement tr = tbody.getRows().getItem(row);
    return tr.getCells().getItem(column);
  }
View Full Code Here

    return tr.getCells().getItem(column);
  }

  @Override
  protected int getHeaderCount(DataGrid<String> table) {
    TableElement tableElem = table.tableHeader.getElement().cast();
    TableSectionElement thead = tableElem.getTHead();
    if (thead.getRows().getLength() == 0) {
      return 0;
    }
    TableRowElement tr = thead.getRows().getItem(0);
    return tr.getCells().getLength();
View Full Code Here

    return tr.getCells().getLength();
  }

  @Override
  protected TableCellElement getHeaderElement(DataGrid<String> table, int column) {
    TableElement tableElem = table.tableHeader.getElement().cast();
    TableSectionElement thead = tableElem.getTHead();
    TableRowElement tr = thead.getRows().getItem(0);
    return tr.getCells().getItem(column);
  }
View Full Code Here

     * @param parent the parent element
     * @return the checkbox
     */
    private InputElement getInputElement(Element parent) {
      // We need to navigate down to our input element.
      TableElement table = parent.getFirstChildElement().cast();
      TableRowElement tr = table.getRows().getItem(0);
      TableCellElement td = tr.getCells().getItem(0);
      InputElement input = td.getFirstChildElement().cast();
      return input;
    }
View Full Code Here

   public void addDirectory(FileSystemItem directory)
   {
      int rowNum = addItem(directory, null, null);

      TableElement table = (TableElement) table_.getElement().cast();
      TableRowElement row = table.getRows().getItem(rowNum);
      row.scrollIntoView();
      scrollPanel_.setHorizontalScrollPosition(0);
      setSelectedRow(rowNum);
   }
View Full Code Here

      child = next;
    }

    // Convert the row html to child elements.
    tmpElem.setInnerHTML("<table><tbody>" + rowHtml + "</tbody></table>");
    TableElement tableElem = tmpElem.getFirstChildElement().cast();
    TableSectionElement newRows = tableElem.getTBodies().getItem(0);

    // Add new child elements.
    child = newRows.getFirstChildElement();
    while (child != null) {
      Element next = child.getNextSiblingElement();
View Full Code Here

    }
    tbody.endTBody();
    tableBuilder.endTable();

    // Check the rendered element.
    TableElement table = tableBuilder.finish().cast();
    assertEquals(5, table.getRows().getLength());
    for (int r = 0; r < 5; r++) {
      TableRowElement tr = table.getRows().getItem(r);
      assertEquals(3, tr.getCells().getLength());
      for (int c = 0; c < 3; c++) {
        TableCellElement td = tr.getCells().getItem(c);
        assertEquals(r + ":" + c, td.getInnerText());
      }
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.TableElement

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.