Refine search
/** * Apply a style to a row and all cells in the row. * * @param tr the row element * @param rowStyle the style to apply to the row * @param cellStyle the style to apply to the cells * @param add true to add the style, false to remove */ private void setRowStyleName(TableRowElement tr, String rowStyle, String cellStyle, boolean add) { setStyleName(tr, rowStyle, add); NodeList<TableCellElement> cells = tr.getCells(); for (int i = 0; i < cells.getLength(); i++) { setStyleName(cells.getItem(i), cellStyle, add); } }
int rowCount = rows.getLength(); if (rowCount == 0) { return null; int domIndex = Math.min(relRow, frameEnd); while (domIndex >= frameStart && domIndex <= frameEnd) { TableRowElement curRow = rows.getItem(domIndex); int rowValueIndex = tableBuilder.getRowValueIndex(curRow); if (rowValueIndex == absRow) { if (subrowIndex >= rows.getLength()) { curRow = rows.getItem(subrowIndex); if (tableBuilder.getRowValueIndex(curRow) != absRow) {
/** * Get the {@link TableCellElement} that is currently keyboard selected. * * @return the table cell element, or null if not selected */ private TableCellElement getKeyboardSelectedTableCellElement() { int colIndex = getKeyboardSelectedColumn(); if (colIndex < 0) { return null; } // Do not use getRowElement() because that will flush the presenter. int rowIndex = getKeyboardSelectedRow(); if (rowIndex < 0 || rowIndex >= getTableBodyElement().getRows().getLength()) { return null; } TableRowElement tr = getSubRowElement(rowIndex + getPageStart(), keyboardSelectedSubrow); if (tr != null) { int cellCount = tr.getCells().getLength(); if (cellCount > 0) { int column = Math.min(colIndex, cellCount - 1); return tr.getCells().getItem(column); } } return null; }
private void updateVisibility(Element container) { // If this element has an associated layer, re-run layout for it. Layer layer = getLayer(container); if (layer != null) { layout(layer); } // Walk all children, looking for elements with a '__layer' property. If one // exists, call layout() for that element. This is not cheap, but it's the // only way to correctly ensure that layout units get translated correctly. NodeList<Node> nodes = container.getChildNodes(); for (int i = 0; i < nodes.getLength(); ++i) { Node node = nodes.getItem(i); if (node.getNodeType() == Node.ELEMENT_NODE) { updateVisibility(node.<Element>cast()); } } } }
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);
private List<TableCellElement> getCells(NodeList<TableRowElement> rows, int columnIndex) { List<TableCellElement> result = new ArrayList<>(); for (int i = 0; i < rows.getLength(); i++) { TableCellElement cell = rows.getItem(i).getCells().getItem(columnIndex); if (cell != null) { result.add(cell); } } return result; }
public List<OptionElement> getOptions() { SelectElement selElt = select.getElement().cast(); NodeList<OptionElement> opts = selElt.getOptions(); List<OptionElement> rslt = new ArrayList<OptionElement>(opts != null ? opts.getLength() : 0); if (opts != null) { for (int i = 0; i < opts.getLength(); i++) { OptionElement opt = opts.getItem(i); rslt.add(opt); } } return rslt; }
public List<OptionElement> getOptions() { SelectElement selElt = select.getElement().cast(); NodeList<OptionElement> opts = selElt.getOptions(); List<OptionElement> rslt = new ArrayList<OptionElement>(opts != null ? opts.getLength() : 0); if (opts != null) { for (int i = 0; i < opts.getLength(); i++) { OptionElement opt = opts.getItem(i); rslt.add(opt); } } return rslt; }