/** * Creates an HTML TD element. * * @return the newly-created element */ public static com.google.gwt.user.client.Element createTD() { return Document.get().createTDElement().cast(); }
/** * Creates an HTML TH element. * * @return the newly-created element */ public static com.google.gwt.user.client.Element createTH() { return Document.get().createTHElement().cast(); }
/** * Creates an HTML TH element. * * @return the newly-created element */ public static com.google.gwt.user.client.Element createTH() { return Document.get().createTHElement().cast(); }
/** * Creates an HTML TD element. * * @return the newly-created element */ public static com.google.gwt.user.client.Element createTD() { return Document.get().createTDElement().cast(); }
/** * Creates an HTML TH element. * * @return the newly-created element */ public static com.google.gwt.user.client.Element createTH() { return Document.get().createTHElement().cast(); }
/** * Creates an HTML TD element. * * @return the newly-created element */ public static com.google.gwt.user.client.Element createTD() { return Document.get().createTDElement().cast(); }
/** * Creates the thead and th elements, with the given labels. * @param labels */ public void setColumnLabels(String ... labels) { this.columnCount = labels.length; for (String label : labels) { Element thElement = Document.get().createTHElement().cast(); thElement.setInnerText(label); DOM.appendChild(thead, thElement); } }
/** * Ensure that a td cell exists for the row at the given column * index. * @param tr the row * @param colIndex the column index (0 based) * @return the new or already existing td */ private Element ensureCell(Element tr, int colIndex) { NodeList<Node> tds = tr.getChildNodes(); int numTDs = tds.getLength(); if (colIndex < numTDs) { return tds.getItem(colIndex).cast(); } Element td = null; for (int c = numTDs; c <= colIndex; c++) { td = Document.get().createTDElement().cast(); if (this.columnClasses.containsKey(colIndex)) { td.setAttribute("class", this.columnClasses.get(colIndex)); //$NON-NLS-1$ } DOM.appendChild(tr, td); } return td; }
@Override protected void initCellWithText(String text, char align, String style, boolean textIsHTML, boolean sorted, String description, TableCellElement td) { super.initCellWithText(text, align, style, textIsHTML, sorted, description, td); Element tdElement = td.cast(); Tools.textSelectionEnable(tdElement, _delegate.textSelectionEnabled); if (_delegate.clickableColumns != null && _delegate.clickableColumns.contains(currentColumnKey)) { Element wrapperElement = tdElement.getFirstChildElement(); final Element clickableSpan = DOM.createSpan().cast(); clickableSpan.setClassName(CUBA_TABLE_CLICKABLE_CELL_STYLE); clickableSpan.setInnerText(wrapperElement.getInnerText()); wrapperElement.removeAllChildren(); DOM.appendChild(wrapperElement, clickableSpan); } if (_delegate.multiLineCells) { Style wrapperStyle = tdElement.getFirstChildElement().getStyle(); wrapperStyle.setWhiteSpace(Style.WhiteSpace.PRE_LINE); } }
@Override protected void initCellWithText(String text, char align, String style, boolean textIsHTML, boolean sorted, String description, TableCellElement td) { super.initCellWithText(text, align, style, textIsHTML, sorted, description, td); final Element tdElement = td.cast(); Tools.textSelectionEnable(tdElement, _delegate.textSelectionEnabled); if (_delegate.clickableColumns != null && _delegate.clickableColumns.contains(currentColumnKey)) { Element wrapperElement = tdElement.getFirstChildElement(); final Element clickableSpan = DOM.createSpan().cast(); clickableSpan.setClassName(CUBA_TABLE_CLICKABLE_CELL_STYLE); clickableSpan.setInnerText(wrapperElement.getInnerText()); wrapperElement.removeAllChildren(); DOM.appendChild(wrapperElement, clickableSpan); } if (_delegate.multiLineCells) { Style wrapperStyle = tdElement.getFirstChildElement().getStyle(); wrapperStyle.setWhiteSpace(Style.WhiteSpace.PRE_LINE); } }
return td.cast();