List of usage examples for com.google.gwt.dom.client TableRowElement setClassName
@Override public void setClassName(String className)
From source file:com.google.speedtracer.client.visualizations.view.RequestDetails.java
License:Apache License
/** * Appends a TableRowElement and populates it with two cells. * //from www. j ava2s.c o m * @param summaryTable * @param title * @param value */ private static void addRowPair(Table dataTable, Css css, boolean isEven, String title, String value) { TableRowElement row = dataTable.appendRow(); if (isEven) { row.setClassName(css.rowEven()); } final TableCellElement nameCell = row.insertCell(-1); nameCell.setClassName(css.nameCell()); nameCell.setInnerText(title); final TableCellElement valueCell = row.insertCell(-1); valueCell.setClassName(css.valueCell()); valueCell.setInnerText(value); }
From source file:com.google.speedtracer.client.visualizations.view.RequestDetails.java
License:Apache License
/** * Appends a TableRowElement and populates it with two cells. * //w w w . j a va 2 s. c om * @param summaryTable * @param title * @param value */ private static void addRowPairByClass(Table dataTable, Css css, String rowClass, String title, String value) { TableRowElement row = dataTable.appendRow(); row.setClassName(rowClass); final TableCellElement nameCell = row.insertCell(-1); nameCell.setClassName(css.nameCell()); nameCell.setInnerText(title); final TableCellElement valueCell = row.insertCell(-1); valueCell.setClassName(css.valueCell()); valueCell.setInnerText(value); }
From source file:org.drools.guvnor.client.widgets.decoratedgrid.VerticalMergableGridWidget.java
License:Apache License
@Override public 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);/*from ww w .j av a 2s.c o m*/ } // Update table to DOM table.replaceChild(nbody, tbody); tbody = nbody; }
From source file:org.drools.guvnor.client.widgets.decoratedgrid.VerticalMergableGridWidget.java
License:Apache License
private void fixRowStyles(int iRow) { while (iRow < tbody.getChildCount()) { Element e = Element.as(tbody.getChild(iRow)); TableRowElement tre = TableRowElement.as(e); tre.setClassName(getRowStyle(iRow)); iRow++;//from w w w . j a v a 2s. com } }
From source file:org.drools.guvnor.client.widgets.drools.decoratedgrid.AbstractVerticalMergableGridWidget.java
License:Apache License
@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);/*from w w w . ja v a 2s .co m*/ } // Update table to DOM table.replaceChild(nbody, tbody); tbody = nbody; }
From source file:org.rstudio.studio.client.common.compile.errorlist.CompileErrorItemCodec.java
License:Open Source License
@Override protected int addBreak(TableRowElement row) { TableRowElement headerRow = Document.get().createTRElement(); headerRow.setClassName(resources_.styles().headerRow()); TableCellElement cell = Document.get().createTDElement(); cell.setColSpan(3);//from w w w . j a va 2s . c o m String path = row.getAttribute(DATA_PATH); if (fileHeaderBasePath_ != null) { if (path.startsWith(fileHeaderBasePath_)) path = path.substring(fileHeaderBasePath_.length()); } cell.setInnerText(path); headerRow.appendChild(cell); row.getParentElement().insertBefore(headerRow, row); return 1; }
From source file:org.rstudio.studio.client.common.compilepdf.CompilePdfErrorItemCodec.java
License:Open Source License
@Override protected int addBreak(TableRowElement row) { TableRowElement headerRow = Document.get().createTRElement(); headerRow.setClassName(resources_.styles().headerRow()); TableCellElement cell = Document.get().createTDElement(); cell.setColSpan(3);/*from w w w.j a va 2 s .co m*/ cell.setInnerText(row.getAttribute(DATA_PATH)); headerRow.appendChild(cell); row.getParentElement().insertBefore(headerRow, row); return 1; }
From source file:org.rstudio.studio.client.common.sourcemarkers.SourceMarkerItemCodec.java
License:Open Source License
@Override protected int addBreak(TableRowElement row) { TableRowElement headerRow = Document.get().createTRElement(); headerRow.setClassName(resources_.styles().headerRow()); TableCellElement cell = Document.get().createTDElement(); cell.setColSpan(3);//from ww w .j a va 2s . c o m String path = row.getAttribute(DATA_PATH); if (!StringUtil.isNullOrEmpty(fileHeaderBasePath_)) { if (path.startsWith(fileHeaderBasePath_)) path = path.substring(fileHeaderBasePath_.length()); } cell.setInnerText(path); headerRow.appendChild(cell); row.getParentElement().insertBefore(headerRow, row); return 1; }
From source file:org.rstudio.studio.client.workbench.views.output.find.FindOutputCodec.java
License:Open Source License
@Override protected int addBreak(TableRowElement row) { TableRowElement tr = Document.get().createTRElement(); tr.setClassName(styles_.headerRow()); TableCellElement td = Document.get().createTDElement(); td.setColSpan(2);// w ww .jav a 2 s . c o m td.setInnerText(row.getAttribute(DATA_FILE)); tr.appendChild(td); row.getParentElement().insertBefore(tr, row); return 1; }
From source file:org.ssgwt.client.ui.datagrid.SSDataGrid.java
License:Apache License
/** * Sets the style of a selected row at a certain index * * @param rowIndex - The index of the row that needs to change * @param selected - Whether or not the row is selected *//* ww w .j a va 2 s.c o m*/ private void setRowSelectedStyle(int rowIndex, boolean selected) { TableRowElement tableRow = dataGrid.getRowElement(rowIndex); String styleNames = tableRow.getClassName(); String newStyles = styleNames; boolean containsStyle = styleNames.contains("selectedRow"); if (containsStyle && !selected) { newStyles = ""; String[] styles = styleNames.split(" "); for (int i = 0; i < styles.length; i++) { if (!styles[i].equals("selectedRow")) { newStyles += " " + styles[i]; } } } else if (!containsStyle && selected) { if (!newStyles.equals("")) { newStyles += " "; } newStyles += "selectedRow "; } tableRow.setClassName(newStyles); Label l = new Label(" "); if (Window.Navigator.getAppName().equals("Microsoft Internet Explorer")) { tableRow.appendChild(l.getElement()); tableRow.removeChild(l.getElement()); } }