}
private static Component generateProgressBar(IDatesMapper datesMapper,
LimitingResourceQueueElement queueElement, Task task,
int startPixels) {
DateAndHour advancementEndDate = getAdvanceEndDate(queueElement);
if (advancementEndDate == null) {
return null;
}
Duration durationBetween = new Duration(queueElement.getStartTime()
.toDateTime().getMillis(), advancementEndDate.toDateTime().getMillis());
Div progressBar = new Div();
if (!queueElement.getStartDate().isEqual(advancementEndDate.getDate())) {
progressBar.setWidth(datesMapper.toPixels(durationBetween) + "px");
progressBar.setSclass("queue-progress-bar");
}
return progressBar;
}