Added the rendering of a color in the competitorColumn of a leaderboard. The same color is used in the racemap and the competitor charts to identify a competitor.

This commit is contained in:
fmittag committed 2012-06-20 09:17:41 +02:00
1 parent fc9ec9aa9a
commit 96427c32ba
1 file changed
+14 -1
@@ -333,7 +333,6 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
}
protected class CompetitorColumn extends SortableColumn<LeaderboardRowDTO, String> {
protected CompetitorColumn() {
super(new TextCell());
}
@@ -362,6 +361,20 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
public String getValue(LeaderboardRowDTO object) {
return getLeaderboard().getDisplayName(object.competitor);
}
@Override
public void render(Context context, LeaderboardRowDTO object, SafeHtmlBuilder sb) {
String competitorColor = LeaderboardPanel.this.competitorSelectionProvider.getColor(object.competitor);
String competitorColorBarStyle;
if(LeaderboardPanel.this.isEmbedded) {
competitorColorBarStyle = "style=\"border-bottom: 2px solid "+competitorColor+";\"";
} else {
competitorColorBarStyle = "style=\"border: none;\"";
}
sb.appendHtmlConstant("<div "+competitorColorBarStyle+">");
sb.appendEscaped(getLeaderboard().getDisplayName(object.competitor));
sb.appendHtmlConstant("</div>");
}
}
/**