int count = ticket.commentsCount;
String pattern = getString("gb.nComments");
if (count == 1) {
pattern = getString("gb.oneComment");
}
indicators.add(new Indicator("fa fa-comment", count, pattern));
}
// participants
if (!ArrayUtils.isEmpty(ticket.participants)) {
int count = ticket.participants.size();
if (count > 1) {
String pattern = getString("gb.nParticipants");
indicators.add(new Indicator("fa fa-user", count, pattern));
}
}
// attachments
if (!ArrayUtils.isEmpty(ticket.attachments)) {
int count = ticket.attachments.size();
String pattern = getString("gb.nAttachments");
if (count == 1) {
pattern = getString("gb.oneAttachment");
}
indicators.add(new Indicator("fa fa-file", count, pattern));
}
// patchset revisions
if (ticket.patchset != null) {
int count = ticket.patchset.commits;
String pattern = getString("gb.nCommits");
if (count == 1) {
pattern = getString("gb.oneCommit");
}
indicators.add(new Indicator("fa fa-code", count, pattern));
}
// milestone
if (!StringUtils.isEmpty(ticket.milestone)) {
indicators.add(new Indicator("fa fa-bullseye", ticket.milestone));
}
ListDataProvider<Indicator> indicatorsDp = new ListDataProvider<Indicator>(indicators);
DataView<Indicator> indicatorsView = new DataView<Indicator>("indicators", indicatorsDp) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(final Item<Indicator> item) {
Indicator indicator = item.getModelObject();
String tooltip = indicator.getTooltip();
Label icon = new Label("icon");
WicketUtils.setCssClass(icon, indicator.css);
item.add(icon);