当前位置: 首页>>代码示例>>Java>>正文


Java TableRowElement类代码示例

本文整理汇总了Java中com.google.gwt.dom.client.TableRowElement的典型用法代码示例。如果您正苦于以下问题:Java TableRowElement类的具体用法?Java TableRowElement怎么用?Java TableRowElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TableRowElement类属于com.google.gwt.dom.client包,在下文中一共展示了TableRowElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setParents

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
private void setParents(JsArray<CommitInfo> commits) {
  setVisible(firstParent, true);
  TableRowElement next = firstParent;
  TableRowElement previous = null;
  for (CommitInfo c : Natives.asList(commits)) {
    if (next == firstParent) {
      CopyableLabel copyLabel = getCommitLabel(c);
      parentCommits.add(copyLabel);
      setWebLinks(parentWebLinks, c);
    } else {
      next.appendChild(DOM.createTD());
      Element td1 = DOM.createTD();
      td1.appendChild(getCommitLabel(c).getElement());
      next.appendChild(td1);
      FlowPanel linksPanel = new FlowPanel();
      linksPanel.addStyleName(style.parentWebLink());
      setWebLinks(linksPanel, c);
      Element td2 = DOM.createTD();
      td2.appendChild(linksPanel.getElement());
      next.appendChild(td2);
      previous.getParentElement().insertAfter(next, previous);
    }
    previous = next;
    next = DOM.createTR().cast();
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:27,代码来源:CommitBox.java

示例2: resetFocusOnCell

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
@Override
protected boolean resetFocusOnCell() {
    boolean focused = false;
    if (hasFilterHeaders() && filterFocusedCellColumn > -1 && filterFocusedCellRow > -1) {
        TableSectionElement thead = getTableHeadElement();
        NodeList<TableRowElement> rows = thead.getRows();
        if (filterFocusedCellRow < rows.getLength()) {
            TableRowElement row = rows.getItem(filterFocusedCellRow);
            NodeList<TableCellElement> cells = row.getCells();
            if (filterFocusedCellColumn < cells.getLength()) {
                TableCellElement cell = cells.getItem(filterFocusedCellColumn);
                if (getHeaderBuilder().isHeader(cell)) {
                    Header<?> header = getHeaderBuilder().getHeader(cell);
                    Context context = new Context(0, 0, header.getKey());
                    focused = resetFocusOnFilterCellImpl(context, header, cell);
                }
            }
        }
    }
    if (!focused) {
        focused = super.resetFocusOnCell();
    }
    return focused;
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:25,代码来源:AvroUiDataGrid.java

示例3: redraw

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
@Override
protected void redraw() {

    TableSectionElement nbody = Document.get().createTBodyElement();

    for ( int iRow = 0; iRow < data.size(); iRow++ ) {

        DynamicDataRow rowData = data.get( iRow );

        TableRowElement tre = Document.get().createTRElement();
        tre.setClassName( getRowStyle( iRow ) );
        populateTableRowElement( tre,
                                 rowData );
        nbody.appendChild( tre );
    }

    // Update table to DOM
    table.replaceChild( nbody,
                        tbody );
    tbody = nbody;

}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:23,代码来源:AbstractVerticalMergableGridWidget.java

示例4: populateTableRowElement

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
private TableRowElement populateTableRowElement( TableRowElement tre,
                                                 DynamicDataRow rowData ) {

    tre.getStyle().setHeight( resources.rowHeight(),
                              Unit.PX );
    for ( int iCol = 0; iCol < columns.size(); iCol++ ) {
        DynamicColumn<T> column = columns.get( iCol );
        if ( column.isVisible() ) {
            TableCellElement tce = makeTableCellElement( iCol,
                                                         rowData );
            if ( tce != null ) {
                tre.appendChild( tce );
            }
        }
    }

    return tre;

}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:20,代码来源:AbstractVerticalMergableGridWidget.java

示例5: hideColumn

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
@Override
void hideColumn( int index ) {
    if ( index < 0 ) {
        throw new IllegalArgumentException( "index cannot be less than zero" );
    }
    if ( index > columns.size() ) {
        throw new IllegalArgumentException( "index cannot be greater than the number of rows" );
    }

    for ( int iRow = 0; iRow < data.size(); iRow++ ) {
        DynamicDataRow rowData = data.get( iRow );
        CellValue<? extends Comparable<?>> cell = rowData.get( index );

        if ( cell.getRowSpan() > 0 ) {
            Coordinate hc = cell.getHtmlCoordinate();
            TableRowElement tre = tbody.getRows().getItem( hc.getRow() );
            TableCellElement tce = tre.getCells().getItem( hc.getCol() );
            tre.removeChild( tce );
        }
    }
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:AbstractVerticalMergableGridWidget.java

示例6: selectCell

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
@Override
void selectCell( CellValue<? extends Comparable<?>> cell ) {
    if ( cell == null ) {
        throw new IllegalArgumentException( "cell cannot be null" );
    }

    Coordinate hc = cell.getHtmlCoordinate();
    TableRowElement tre = tbody.getRows().getItem( hc.getRow() )
            .<TableRowElement>cast();
    TableCellElement tce = tre.getCells().getItem( hc.getCol() )
            .<TableCellElement>cast();

    //Cell selected style takes precedence
    String cellSelectedStyle = resources.cellTableCellSelected();
    String cellOtherwiseStyle = resources.cellTableCellOtherwise();
    String cellMultipleValuesStyle = resources.cellTableCellMultipleValues();

    tce.removeClassName( cellMultipleValuesStyle );
    tce.removeClassName( cellOtherwiseStyle );
    tce.addClassName( cellSelectedStyle );
    tce.focus();
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:23,代码来源:AbstractVerticalMergableGridWidget.java

示例7: showColumn

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
@Override
void showColumn( int index ) {
    if ( index < 0 ) {
        throw new IllegalArgumentException( "index cannot be less than zero" );
    }
    if ( index > columns.size() ) {
        throw new IllegalArgumentException( "index cannot be greater than the number of rows" );
    }

    for ( int iRow = 0; iRow < data.size(); iRow++ ) {
        DynamicDataRow rowData = data.get( iRow );
        TableCellElement tce = makeTableCellElement( index,
                                                     rowData );
        if ( tce != null ) {

            CellValue<? extends Comparable<?>> cell = rowData.get( index );
            Coordinate hc = cell.getHtmlCoordinate();

            TableRowElement tre = tbody.getRows().getItem( hc.getRow() );
            TableCellElement ntce = tre.insertCell( hc.getCol() );
            tre.replaceChild( tce,
                              ntce );
        }
    }
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:26,代码来源:AbstractVerticalMergableGridWidget.java

示例8: getSelectedCellExtents

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
/**
 * Retrieve the extents of a cell
 * @param cv The cell for which to retrieve the extents
 * @return
 */
CellSelectionDetail getSelectedCellExtents( CellValue<? extends Comparable<?>> cv ) {

    if ( cv == null ) {
        throw new IllegalArgumentException( "cv cannot be null" );
    }

    // Cells in hidden columns do not have extents
    if ( !columns.get( cv.getCoordinate().getCol() ).isVisible() ) {
        return null;
    }

    Coordinate hc = cv.getHtmlCoordinate();
    TableRowElement tre = tbody.getRows().getItem( hc.getRow() ).<TableRowElement>cast();
    TableCellElement tce = tre.getCells().getItem( hc.getCol() ).<TableCellElement>cast();
    int offsetX = tce.getOffsetLeft();
    int offsetY = tce.getOffsetTop();
    int w = tce.getOffsetWidth();
    int h = tce.getOffsetHeight();
    CellSelectionDetail e = new CellSelectionDetail( cv.getCoordinate(),
                                                     offsetX,
                                                     offsetY,
                                                     h,
                                                     w );
    return e;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:31,代码来源:AbstractMergableGridWidget.java

示例9: displayQuireItem

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
private void displayQuireItem(com.google.gwt.dom.client.Document htmldoc,
		TableElement table, Element item) {
	TableRowElement tr = table.insertRow(-1);

	TableCellElement td1 = tr.insertCell(-1);
	TableCellElement td2 = tr.insertCell(-1);
	TableCellElement td3 = tr.insertCell(-1);

	td1.setInnerText(item.getAttribute("n"));

	NodeList l = item.getElementsByTagName("locus");

	if (l.getLength() > 0) {
		Element locus = (Element) l.item(0);

		td2.appendChild(displayLocus(htmldoc, locus));

		for (Node n = locus.getNextSibling(); n != null; n = n
				.getNextSibling()) {
			td3.appendChild(displayDescription(htmldoc, n));
		}
	}
}
 
开发者ID:jhu-digital-manuscripts,项目名称:rosa,代码行数:24,代码来源:Book.java

示例10: onViewLoaded

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
@Override
protected void onViewLoaded(TableRowView view) {
  TableRowElement rowElement = view.getRootElement();
  for (int i = 0; i < columns; i++) {
    rowElement.appendChild(rowElement.getOwnerDocument().createTDElement());
  }
}
 
开发者ID:turnsk,项目名称:gwtmvp,代码行数:8,代码来源:TableRowAdapter.java

示例11: getMaxColsAmongRows

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
private static NodeList<TableCellElement> getMaxColsAmongRows(NodeList<TableRowElement> rows) {
    NodeList<TableCellElement> cols = null;
    int maxCols = 0;
    for (int i = 0; i < rows.getLength(); i++) {
        NodeList<TableCellElement> currCols = rows.getItem(i).getCells();
        if (currCols.getLength() > maxCols) {
            maxCols = currCols.getLength();
            cols = currCols;
        }
    }
    return cols;
}
 
开发者ID:chromium,项目名称:dom-distiller,代码行数:13,代码来源:TableClassifier.java

示例12: appendRow

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
private void appendRow(String title, JsArrayString l) {
  TableRowElement row = table.insertRow(-1);
  TableCellElement th = Document.get().createTHElement();
  th.setInnerText(title);
  row.appendChild(th);
  row.insertCell(-1).setInnerSafeHtml(formatList(l));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:8,代码来源:IncludedInBox.java

示例13: getCell

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
public TableCellElement getCell(int aRow, int aCol) {
	NodeList<TableRowElement> rows = getTableBodyElement().getRows();
	if (aRow >= 0 && aRow < rows.getLength()) {
		TableRowElement row = rows.getItem(aRow);
		NodeList<TableCellElement> cells = row.getCells();
		if (aCol >= 0 && aCol < cells.getLength()) {
			return cells.getItem(aCol);
		}
	}
	return null;
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:12,代码来源:GridSection.java

示例14: redrawAllRowsInColumn

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
public <C> void redrawAllRowsInColumn(int aIndex, ListDataProvider<T> aDataProvider) {
	if (aIndex >= 0 && aIndex < getColumnCount()) {
		int start = getVisibleRange().getStart();
		Column<T, C> column = (Column<T, C>) getColumn(aIndex);
		Cell<C> cell = column.getCell();
		List<T> data = aDataProvider.getList();
		ProvidesKey<T> keys = getKeyProvider();
		NodeList<TableRowElement> rows = getTableBodyElement().getRows();
		for (int i = 0; i < rows.getLength(); i++) {
			TableRowElement row = rows.getItem(i);
			NodeList<TableCellElement> cells = row.getCells();
			if (aIndex >= 0 && aIndex < cells.getLength()) {
				TableCellElement toRerender = cells.getItem(aIndex);
				if (toRerender != null) {
					SafeHtmlBuilder sb = new SafeHtmlBuilder();
					int dataIdx = start + i;
					if (dataIdx >= 0 && dataIdx < data.size()) {
						T object = data.get(dataIdx);
						Cell.Context cx = new Cell.Context(start + i, aIndex, keys.getKey(object));
						cell.render(cx, column.getValue(object), sb);
						// Take into account, that cell builder supports
						// some
						// maps
						// to cells' divs
						// and generates them. So we have to work with first
						// <div>
						// in <td>.
						toRerender.getFirstChildElement().setInnerSafeHtml(sb.toSafeHtml());
					}
				}
			}
		}
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:35,代码来源:GridSection.java

示例15: getCellForEvent

import com.google.gwt.dom.client.TableRowElement; //导入依赖的package包/类
/**
 * Given a click event, return the Cell that was clicked, or null if the event
 * did not hit this table.  The cell can also be null if the click event does
 * not occur on a specific cell.
 *
 * @param event A click event of indeterminate origin
 * @return The appropriate cell, or null
 */
public Cell getCellForEvent(MouseEvent<? extends EventHandler> event) {
  Element td = getEventTargetCell(Event.as(event.getNativeEvent()));
  if (td == null) {
    return null;
  }

  int row = TableRowElement.as(td.getParentElement()).getSectionRowIndex();
  int column = TableCellElement.as(td).getCellIndex();
  return new Cell(row, column);
}
 
开发者ID:waynedyck,项目名称:gwt-gantt,代码行数:19,代码来源:HTMLTable.java


注:本文中的com.google.gwt.dom.client.TableRowElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。