HighlightPredicate predicate = new HighlightPredicate() { @Override public boolean isHighlighted(Component renderer, ComponentAdapter adapter) { return adapter.convertRowIndexToModel(adapter.row) == mySpecialRow; } };
/** * Returns the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates. * * Note: the asymmetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows. * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public Object getFilteredValueAt(int row, int column) { return getValueAt(convertRowIndexToModel(row), column); }
/** * Returns the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates. * * Note: the asymmetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows. * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public Object getFilteredValueAt(int row, int column) { return getValueAt(convertRowIndexToModel(row), column); }
/** * Returns the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates. * * Note: the asymmetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows. * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public Object getFilteredValueAt(int row, int column) { return getValueAt(convertRowIndexToModel(row), column); }
/** * Returns the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates. * * Note: the asymmetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows. * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public Object getFilteredValueAt(int row, int column) { return getValueAt(convertRowIndexToModel(row), column); }
/** * Returns the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates.<p> * * Note: the asymetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows.<p> * * This implementation messages the StringValue.TO_STRING with the filteredValue, * subclasses should re-implement and use the API appropriate for the target component type.<p> * * PENDING JW: what about null cell values? StringValue has a contract to return a * empty string then, would that be okay here as well? * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public String getFilteredStringAt(int row, int column) { return getStringAt(convertRowIndexToModel(row), column); }
/** * Returns the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates.<p> * * Note: the asymetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows.<p> * * This implementation messages the StringValue.TO_STRING with the filteredValue, * subclasses should re-implement and use the API appropriate for the target component type.<p> * * PENDING JW: what about null cell values? StringValue has a contract to return a * empty string then, would that be okay here as well? * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public String getFilteredStringAt(int row, int column) { return getStringAt(convertRowIndexToModel(row), column); }
/** * Returns the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates.<p> * * Note: the asymetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows.<p> * * This implementation messages the StringValue.TO_STRING with the filteredValue, * subclasses should re-implement and use the API appropriate for the target component type.<p> * * PENDING JW: what about null cell values? StringValue has a contract to return a * empty string then, would that be okay here as well? * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public String getFilteredStringAt(int row, int column) { return getStringAt(convertRowIndexToModel(row), column); }
/** * Returns the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates.<p> * * Note: the asymetry of the coordinates is intentional - clients like * Highlighters are interested in view values but might need to access * non-visible columns for testing. While it is possible to access * row coordinates different from the current (that is this.row) it is not * safe to do so for row > this.row because the adapter doesn't allow to * query the count of visible rows.<p> * * This implementation messages the StringValue.TO_STRING with the filteredValue, * subclasses should re-implement and use the API appropriate for the target component type.<p> * * PENDING JW: what about null cell values? StringValue has a contract to return a * empty string then, would that be okay here as well? * * @param row the row of the cell in view coordinates * @param column the column of the cell in model coordinates. * @return the String representation of the filtered value of the cell identified by the row * in view coordinate and the column in model coordinates */ public String getFilteredStringAt(int row, int column) { return getStringAt(convertRowIndexToModel(row), column); }
public boolean isHighlighted(Component renderer, ComponentAdapter adapter) { int modelIndex = adapter.convertRowIndexToModel(adapter.row); return related.contains(modelIndex);