use of com.revolsys.swing.table.highlighter.ColorHighlighter in project com.revolsys.open by revolsys.
the class ModifiedFieldPredicate method add.
public static void add(final RecordRowTable table) {
final RecordRowTableModel model = table.getModel();
final ModifiedFieldPredicate predicate = new ModifiedFieldPredicate(model);
final Color lime50 = WebColors.newAlpha(WebColors.Lime, 127);
table.addHighlighter(new ColorHighlighter(new AndHighlightPredicate(predicate, HighlightPredicate.EVEN), lime50, WebColors.Black, lime50, WebColors.Black));
table.addHighlighter(new ColorHighlighter(new AndHighlightPredicate(predicate, HighlightPredicate.ODD), WebColors.Lime, WebColors.Black, WebColors.Lime, WebColors.Black));
}
use of com.revolsys.swing.table.highlighter.ColorHighlighter in project com.revolsys.open by revolsys.
the class BackgroundTaskTableModel method addHighlighter.
private static void addHighlighter(final BaseJTable table, final BackgroundTaskTableModel model, final StateValue state, final Color background, final Color foreground) {
final HighlightPredicate predicate = (renderer, adapter) -> {
final int rowIndex = adapter.convertRowIndexToModel(adapter.row);
final BackgroundTask task = model.tasks.get(rowIndex);
return task.getTaskStatus() == state;
};
final ColorHighlighter highlighter = new ColorHighlighter(predicate, background, foreground, foreground, background);
table.addHighlighter(highlighter);
}
Aggregations