private static QueueTask createDivForElement(IDatesMapper datesMapper,
LimitingResourceQueueElement queueElement) {
final Task task = queueElement.getResourceAllocation().getTask();
final OrderElement order = getRootOrder(task);
QueueTask result = new QueueTask(queueElement);
String cssClass = "queue-element";
result.setTooltiptext(createTooltiptext(queueElement));
int startPixels = getStartPixels(datesMapper, queueElement);
result.setLeft(forCSS(startPixels));
if (startPixels < 0) {
cssClass += " truncated-start ";
}
int taskWidth = getWidthPixels(datesMapper, queueElement);
if ((startPixels + taskWidth) > datesMapper.getHorizontalSize()) {
taskWidth = datesMapper.getHorizontalSize() - startPixels;
cssClass += " truncated-end ";
} else {
result.appendChild(generateNonWorkableShade(datesMapper,
queueElement));
}
result.setWidth(forCSS(taskWidth));
LocalDate deadlineDate = task.getDeadline();
boolean isOrderDeadline = false;
if (deadlineDate == null) {
Date orderDate = order.getDeadline();
if (orderDate != null) {
deadlineDate = LocalDate.fromDateFields(orderDate);
isOrderDeadline = true;
}
}