/** * Returns a rendering of this table with all cells converted to text. **/ public String[][] asText() { String[][] result = new String[ getRowCount() ][ getColumnCount() ]; for (int i = 0; i < result.length; i++) { for (int j= 0; j < result[0].length; j++) { result[i][j] = getCellAsText( i, j ); } } return result; }
/** * Returns a rendering of this table with all cells converted to text. **/ public String[][] asText() { String[][] result = new String[ getRowCount() ][ getColumnCount() ]; for (int i = 0; i < result.length; i++) { for (int j= 0; j < result[0].length; j++) { result[i][j] = getCellAsText( i, j ); } } return result; }
/** * Returns a rendering of this table with all cells converted to text. **/ public String[][] asText() { String[][] result = new String[ getRowCount() ][ getColumnCount() ]; for (int i = 0; i < result.length; i++) { for (int j= 0; j < result[0].length; j++) { result[i][j] = getCellAsText( i, j ); } } return result; }
public boolean matchesCriteria( Object htmlElement, Object criteria ) { WebTable table = ((WebTable) htmlElement); for (int row = 0; row < table.getRowCount(); row++) { for (int col = 0; col < table.getColumnCount(); col++) { if (HttpUnitUtils.hasPrefix( table.getCellAsText( row, col ).trim(), (String) criteria)) return true; } } return false; } };
/** * 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; }
public boolean matchesCriteria( Object htmlElement, Object criteria ) { WebTable table = ((WebTable) htmlElement); for (int row = 0; row < table.getRowCount(); row++) { for (int col = 0; col < table.getColumnCount(); col++) { if (HttpUnitUtils.matches( table.getCellAsText( row, col ).trim(), (String) criteria)) return true; } } return false; } };
public boolean matchesCriteria( Object htmlElement, Object criteria ) { WebTable table = ((WebTable) htmlElement); for (int row = 0; row < table.getRowCount(); row++) { for (int col = 0; col < table.getColumnCount(); col++) { if (HttpUnitUtils.hasPrefix( table.getCellAsText( row, col ).trim(), (String) criteria)) return true; } } return false; } };
public boolean matchesCriteria( Object htmlElement, Object criteria ) { WebTable table = ((WebTable) htmlElement); for (int row = 0; row < table.getRowCount(); row++) { for (int col = 0; col < table.getColumnCount(); col++) { if (HttpUnitUtils.matches( table.getCellAsText( row, col ).trim(), (String) criteria)) return true; } } return false; } };
public boolean matchesCriteria( Object htmlElement, Object criteria ) { WebTable table = ((WebTable) htmlElement); for (int row = 0; row < table.getRowCount(); row++) { for (int col = 0; col < table.getColumnCount(); col++) { if (HttpUnitUtils.hasPrefix( table.getCellAsText( row, col ).trim(), (String) criteria)) return true; } } return false; } };
public boolean matchesCriteria( Object htmlElement, Object criteria ) { WebTable table = ((WebTable) htmlElement); for (int row = 0; row < table.getRowCount(); row++) { for (int col = 0; col < table.getColumnCount(); col++) { if (HttpUnitUtils.matches( table.getCellAsText( row, col ).trim(), (String) criteria)) return true; } } return false; } };
/** * 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; }
/** * 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; }
for (int k = 0; k < tables[i].getColumnCount(); k++) { TableCell cell = tables[i].getTableCell(j, k); if (cell != null) {
for (int k = 0; k < tables[i].getColumnCount(); k++) { TableCell cell = tables[i].getTableCell(j, k); if (cell != null) {
for (int k = 0; k < tables[i].getColumnCount(); k++) { TableCell cell = tables[i].getTableCell(j, k); if (cell != null) {
for (int k = 0; k < tbl.getColumnCount(); k++) { TableCell cell = tbl.getTableCell(j,k); if (cell != null) { if( tbl.getColumnCount()<4 ) continue; if( tbl.getCellAsText(0,2).indexOf("Roles requested")==-1 )
int numColumnsWithText = 0; boolean rowHasText[] = new boolean[ getRowCount() ]; boolean columnHasText[] = new boolean[ getColumnCount() ]; Hashtable spanningCells = new Hashtable();
/** * 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; }
/** * 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; }
/** * 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; }