TableCell newTableCell( HTMLTableCellElement element ) { return new TableCell( _response, _frameName, element, _url, _baseTarget, _characterSet ); }
cell.getProperties().put("deferToParentPrefWidth", Boolean.TRUE);//the change is here, only the first parameter, since the original constant is not accessible outside package Node n = cell.getSkin() == null ? null : cell.getSkin().getNode(); if (n instanceof Region) { Region r = (Region) n; double maxWidth = 0; for (int row = 0; row < rows; row++) { cell.updateTableColumn(col); cell.updateTableView(tblView); cell.updateIndex(row); if ((cell.getText() != null && !cell.getText().isEmpty()) || cell.getGraphic() != null) { getChildren().add(cell); cell.impl_processCSS(false); maxWidth = Math.max(maxWidth, cell.prefWidth(-1)); getChildren().remove(cell);
MyRow er = (MyRow) getTableRow().getItem(); TableCell cell = er.get(getTableView().getColumns().indexOf(getTableColumn())); this.setText(cell.getText()); if (cell.getUserData() instanceof MyTableCellEnum) { MyTableCellEnumcellType = (MyTableCellEnum) cell.getUserData(); if (null != cellType && !hasEventHandler) { switch (cellType) {
private void readTable() { TableRow[] rows = getRows(); int[] columnsRequired = new int[ rows.length ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { columnsRequired[ i+k ]+= cells[j].getColSpan(); } } } int numColumns = 0; for (int i = 0; i < columnsRequired.length; i++) { numColumns = Math.max( numColumns, columnsRequired[i] ); } _cells = new TableCell[ columnsRequired.length ][ numColumns ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { for (int l = 0; l < cells[j].getColSpan(); l++) { placeCell( i+k, j+l, cells[j] ); } } } } }
/** * Returns the text value of this cell. * @deprecated as of 1.6, use #getText() */ public String asText() { return getText(); }
TableCell cell = tables[i].getTableCell(j, k); if (cell != null) { WebTable[] innerTables = cell.getTables(); if (innerTables.length != 0) { WebTable[] result = getTablesSatisfyingPredicate(innerTables, predicate, value);
/** * Returns the contents of the specified table cell with a given ID * @return TableCell with given ID or null if ID is not found. **/ public TableCell getTableCellWithID( String id ) { for (int i = 0; i < getRowCount(); i++) { for (int j = 0; j < getColumnCount(); j++) { final TableCell tableCell = getCells()[i][j]; if (tableCell!=null && tableCell.getID().equals( id )) return tableCell; } } return null; }
protected Object scrape() throws IOException, SAXException, ProcessingException { WebResponse response = goTo(_getURL()+"/servlets/ProjectApproval"); WebTable table = response.getTableStartingWith("Project"); int rows = table.getRowCount(); boolean found = false; String approveElementName = null; for (int r = 1; r < rows && !found; r++ ) { TableCell c1 = table.getTableCell(r, 0); if (c1.getLinks().length > 0) { String link = c1.getLinks()[0].getURLString(); if (link.equals(_getURL()+'/')) { TableCell c2 = table.getTableCell(r, 3); String[] names = c2.getElementNames(); if (names.length > 0) { approveElementName = names[0]; found = true; } } } } if (!found) throw new ProcessingException("Unable to find project "+projectName+" in the approval page"); // we already have the info we need to approve the project, now, do it WebForm form = Util.getFormWithAction(response,"ProjectApproval"); form.setParameter(approveElementName, approve ? "Approve" : "Disapprove"); form.setParameter("disapprovalReason",reason); checkError(form.submit()); return null; } }
Element input = Util.getFirstElementChild((Element)opCell.getDOM()); if(!input.getTagName().equalsIgnoreCase("input")) throw new ProcessingException("expected input tag but found "+input.getTagName());
private void readTable() { TableRow[] rows = getRows(); int[] columnsRequired = new int[ rows.length ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { columnsRequired[ i+k ]+= cells[j].getColSpan(); } } } int numColumns = 0; for (int i = 0; i < columnsRequired.length; i++) { numColumns = Math.max( numColumns, columnsRequired[i] ); } _cells = new TableCell[ columnsRequired.length ][ numColumns ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { for (int l = 0; l < cells[j].getColSpan(); l++) { placeCell( i+k, j+l, cells[j] ); } } } } }
/** * Returns the text value of this cell. * @deprecated as of 1.6, use #getText() */ public String asText() { return getText(); }
TableCell cell = tables[i].getTableCell(j, k); if (cell != null) { WebTable[] innerTables = cell.getTables(); if (innerTables.length != 0) { WebTable[] result = getTablesSatisfyingPredicate(innerTables, predicate, value);
/** * Returns the contents of the specified table cell with a given ID * @return TableCell with given ID or null if ID is not found. **/ public TableCell getTableCellWithID( String id ) { for (int i = 0; i < getRowCount(); i++) { for (int j = 0; j < getColumnCount(); j++) { final TableCell tableCell = getCells()[i][j]; if (tableCell!=null && tableCell.getID().equals( id )) return tableCell; } } return null; }
private void readTable() { TableRow[] rows = getRows(); int[] columnsRequired = new int[ rows.length ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { columnsRequired[ i+k ]+= cells[j].getColSpan(); } } } int numColumns = 0; for (int i = 0; i < columnsRequired.length; i++) { numColumns = Math.max( numColumns, columnsRequired[i] ); } _cells = new TableCell[ columnsRequired.length ][ numColumns ]; for (int i = 0; i < rows.length; i++) { TableCell[] cells = rows[i].getCells(); for (int j = 0; j < cells.length; j++) { int spannedRows = Math.min( columnsRequired.length-i, cells[j].getRowSpan() ); for (int k = 0; k < spannedRows; k++) { for (int l = 0; l < cells[j].getColSpan(); l++) { placeCell( i+k, j+l, cells[j] ); } } } } }
cell.addEventFilter(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { if (event.getClickCount() > 1) { System.out.println("double clicked!"); // TODO GET THE OBJECT AND MAKE SQL QUERY IN ORDER TO MAKE NEW DIALOG WITH TableCell c = (TableCell) event.getSource(); System.out.println("Cell text: " + c.getText()); } } }); **return new EditingCell(); // replace this with return cell;** } };
TableCell newTableCell( HTMLTableCellElement element ) { return new TableCell( _response, _frameName, element, _url, _baseTarget, _characterSet ); }
/** * Returns the table with the specified text in its summary attribute. **/ private WebTable getTableSatisfyingPredicate( WebTable[] tables, HTMLElementPredicate predicate, Object value ) { for (int i = 0; i < tables.length; i++) { if (predicate.matchesCriteria( tables[i], value )) { return tables[i]; } else { for (int j = 0; j < tables[i].getRowCount(); j++) { for (int k = 0; k < tables[i].getColumnCount(); k++) { TableCell cell = tables[i].getTableCell(j,k); if (cell != null) { WebTable[] innerTables = cell.getTables(); if (innerTables.length != 0) { WebTable result = getTableSatisfyingPredicate( innerTables, predicate, value ); if (result != null) return result; } } } } } } return null; }
for (int col = 0; col < columnHasText.length; col++) { if (getCellAsText(row,col).trim().length() == 0) continue; if (getTableCell(row,col).getColSpan() == 1 && getTableCell(row,col).getRowSpan() == 1) { if (!rowHasText[row]) numRowsWithText++; if (!columnHasText[col]) numColumnsWithText++; boolean neededInRow = true; boolean neededInCol = true; for (int i = coords[0]; neededInRow && (i < rowHasText.length) && (i < coords[0] + cell.getRowSpan()); i++) { neededInRow = !rowHasText[i]; for (int j = coords[1]; neededInCol && (j < columnHasText.length) && (j < coords[1] + cell.getColSpan()); j++) { neededInCol = !columnHasText[j];
/** * Returns the contents of the specified table cell as text. * The row and column numbers are zero-based. * @throws IndexOutOfBoundsException if the specified cell numbers are not valid **/ public String getCellAsText( int row, int column ) { TableCell cell = getTableCell( row, column ); return (cell == null) ? "" : cell.getText(); }
TableCell newTableCell( HTMLTableCellElement element ) { return new TableCell( _response, _frameName, element, _url, _baseTarget, _characterSet ); }