r532 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table
Author: tchemit Date: 2013-03-04 19:40:32 +0100 (Mon, 04 Mar 2013) New Revision: 532 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/532 Log: improve comment highlight Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-03-04 18:03:49 UTC (rev 531) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-03-04 18:40:32 UTC (rev 532) @@ -42,6 +42,7 @@ import jaxx.runtime.swing.renderer.DecoratorTableCellRenderer; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jdesktop.swingx.JXTable; @@ -303,12 +304,15 @@ new HighlightPredicate.AndHighlightPredicate( new MyIdentifierHighlightPredicate(SpeciesBatchTableModel.COMMENT), // for not null value - new HighlightPredicate.NotHighlightPredicate(new HighlightPredicate.EqualsHighlightPredicate()), - new HighlightPredicate.NotHighlightPredicate(new HighlightPredicate.EqualsHighlightPredicate("")) - ), cellWithValueColor); + new HighlightPredicate() { + @Override + public boolean isHighlighted(Component renderer, ComponentAdapter adapter) { + return StringUtils.isNotBlank((String) adapter.getValue()); + } + }), cellWithValueColor); table.addHighlighter(commentHighlighter); - // paint in a special color for attachment cell (with not null value) + // paint in a special color for attachment cell (when some attachments) Highlighter attachmentHighlighter = TuttiUIUtil.newBackgroundColorHighlighter( new HighlightPredicate.AndHighlightPredicate( new MyIdentifierHighlightPredicate(SpeciesBatchTableModel.ATTACHMENTS),
participants (1)
-
tchemit@users.forge.codelutin.com