Package com.google.gwt.dom.client

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


    }
  }
 
  @Override
  protected void onFocus() {
    TableCellElement td = getKeyboardSelectedTableCellElement();
    if (td != null) {
      TableRowElement tr = td.getParentElement().cast();
      td.addClassName(style.keyboardSelectedCell());
      setRowStyleName(tr, style.keyboardSelectedRow(), style.keyboardSelectedRowCell(), true);
    }
  }
View Full Code Here


    boolean updatedSelection = !selected || isFocused || stealFocus;
    setRowStyleName(tr, style.keyboardSelectedRow(), style.keyboardSelectedRowCell(), selected);
    NodeList<TableCellElement> cells = tr.getCells();
    int keyboardColumn = Math.min(getKeyboardSelectedColumn(), cells.getLength() - 1);
    for (int i = 0; i < cells.getLength(); i++) {
      TableCellElement td = cells.getItem(i);
      boolean isKeyboardSelected = (i == keyboardColumn);

      // Update the selected style.
      setStyleName(td, cellStyle, updatedSelection && selected && isKeyboardSelected);
View Full Code Here

     */
    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 setColWidth(int colIndex, int w) {
            NodeList<TableRowElement> rows2 = tBodyElement.getRows();
            final int rows = rows2.getLength();
            for (int i = 0; i < rows; i++) {
                TableRowElement row = rows2.getItem(i);
                TableCellElement cell = row.getCells().getItem(colIndex);
                cell.getFirstChildElement().getStyle()
                        .setPropertyPx("width", w);
                cell.getStyle().setPropertyPx("width", w);
            }
        }
View Full Code Here

                detectExtrawidth();
                tBodyElement.removeChild(scrollTableRow.getElement());
            } else {
                boolean noCells = false;
                TableRowElement item = rows.getItem(0);
                TableCellElement firstTD = item.getCells().getItem(0);
                if (firstTD == null) {
                    // content is currently empty, we need to add a fake cell
                    // for measuring
                    noCells = true;
                    VScrollTableRow next = (VScrollTableRow) iterator().next();
                    next.addCell("", ALIGN_LEFT, "", true);
                    firstTD = item.getCells().getItem(0);
                }
                com.google.gwt.dom.client.Element wrapper = firstTD
                        .getFirstChildElement();
                cellExtraWidth = firstTD.getOffsetWidth()
                        - wrapper.getOffsetWidth();
                if (noCells) {
                    firstTD.getParentElement().removeChild(firstTD);
                }
            }
        }
View Full Code Here

      // always squelch default handling (when there is a handler)
      event.stopPropagation();
      event.preventDefault();
     
      // find the table cell element then get its parent and cast to row
      TableCellElement tableCell = findNearestParentCell(target);
      if (tableCell == null)
         return;        
      Element trElem = tableCell.getParentElement();
      if (trElem == null)
        return;
      TableRowElement tr = TableRowElement.as(trElem);
     
      // get the section of the row and confirm it is a tbody (as opposed
View Full Code Here

    // BISERVER-9965
    table.addCellPreviewHandler( new CellPreviewEvent.Handler<JsJob>() {
      @Override
      public void onCellPreview( CellPreviewEvent<JsJob> event ) {
        if ( "mouseover".equals( event.getNativeEvent().getType() ) ) {
          final TableCellElement cell = table.getRowElement( event.getIndex() ).getCells().getItem( event.getColumn() );
          cell.setTitle( cell.getInnerText() );
        }
      }
    } );

    SimplePager.Resources pagerResources = GWT.create( SimplePager.Resources.class );
View Full Code Here

     * No alignment. Some browsers (FF) return a default value when alignment is
     * not specified, others (IE/HtmlUnit) return an empty string.
     */
    table.setRowData(0, createData(0, 1));
    table.getPresenter().flush();
    TableCellElement td = getBodyElement(table, 0, 2);
    String hAlign = td.getAlign();
    String vAlign = td.getVAlign();
    assertTrue("".equals(hAlign) || "left".equals(hAlign));
    assertTrue("".equals(vAlign) || "middle".equals(vAlign));

    // Horizontal alignment.
    column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    table.setRowData(0, createData(0, 1));
    table.getPresenter().flush();
    td = getBodyElement(table, 0, 2);
    hAlign = td.getAlign();
    vAlign = td.getVAlign();
    assertTrue("right".equals(hAlign));
    assertTrue("".equals(vAlign) || "middle".equals(vAlign));

    // Vertical alignment.
    column.setHorizontalAlignment(null);
    column.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
    table.setRowData(0, createData(0, 1));
    table.getPresenter().flush();
    td = getBodyElement(table, 0, 2);
    hAlign = td.getAlign();
    vAlign = td.getVAlign();
    assertTrue("".equals(hAlign) || "left".equals(hAlign));
    assertTrue("bottom".equals(vAlign));

    // Horizontal and vertical alignment.
    column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    table.setRowData(0, createData(0, 1));
    table.getPresenter().flush();
    td = getBodyElement(table, 0, 2);
    hAlign = td.getAlign();
    vAlign = td.getVAlign();
    assertTrue("right".equals(hAlign));
    assertTrue("bottom".equals(vAlign));
  }
View Full Code Here

    assertEquals("four", fooReceiver.secondExtraParam);
  }

  public void testDispatchWithInheritedRenderer() {

    TableCellElement th3 = UiRendererUi.getInheritedRenderer().getTh3(uiRoot);
    NativeEvent eventAtTh3 = createMockNativeEvent(th3, "click");

    UiRendererUi.getInheritedRenderer().onBrowserEvent(bazReceiver, eventAtTh3, uiRoot);

    assertEquals(1, bazReceiver.handlerCalled);
View Full Code Here

        tr.addClassName("evenRow");
      } else {
        tr.addClassName("oddRow");
      }
      for (int column = 0; column < Util.TABLE_COLUMN_COUNT; column++) {
        TableCellElement td = Document.get().createTDElement();
        td.setAlign("center");
        td.setVAlign("middle");
        td.appendChild(createCellContents(row, column));
        tr.appendChild(td);
      }
    }
  }
View Full Code Here

TOP

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

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.