Label nameLabel = new Label(historicTask.getName());
nameLabel.addStyleName(Reindeer.LABEL_H2);
taskDetails.addComponent(nameLabel, 1, 0, 4,0);
// Add due date
PrettyTimeLabel dueDateLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.TASK_DUEDATE_SHORT),
historicTask.getDueDate(), i18nManager.getMessage(Messages.TASK_DUEDATE_UNKNOWN), false);
dueDateLabel.addStyleName(ExplorerLayout.STYLE_TASK_HEADER_DUEDATE);
taskDetails.addComponent(dueDateLabel, 1, 1);
// Add priority
Integer lowMedHighPriority = convertPriority(historicTask.getPriority());
Label priorityLabel = new Label();
switch(lowMedHighPriority) {
case 1:
priorityLabel.setValue(i18nManager.getMessage(Messages.TASK_PRIORITY_LOW));
priorityLabel.addStyleName(ExplorerLayout.STYLE_TASK_HEADER_PRIORITY_LOW);
break;
case 2:
priorityLabel.setValue(i18nManager.getMessage(Messages.TASK_PRIORITY_MEDIUM));
priorityLabel.addStyleName(ExplorerLayout.STYLE_TASK_HEADER_PRIORITY_MEDIUM);
break;
case 3:
default:
priorityLabel.setValue(i18nManager.getMessage(Messages.TASK_PRIORITY_HIGH));
priorityLabel.addStyleName(ExplorerLayout.STYLE_TASK_HEADER_PRIORITY_HIGH);
}
taskDetails.addComponent(priorityLabel, 2, 1);
// Add create date
PrettyTimeLabel createLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.TASK_CREATED_SHORT),
historicTask.getStartTime(), "", true);
createLabel.addStyleName(ExplorerLayout.STYLE_TASK_HEADER_CREATE_TIME);
taskDetails.addComponent(createLabel, 3, 1);
// Add label to fill excess space
Label spacer = new Label();
spacer.setContentMode(Label.CONTENT_XHTML);