use of org.activiti.explorer.util.time.HumanTime in project Activiti by Activiti.
the class TaskEventsPanel method addTaskEventText.
protected void addTaskEventText(final org.activiti.engine.task.Event taskEvent, final GridLayout eventGrid) {
VerticalLayout layout = new VerticalLayout();
layout.addStyleName(ExplorerLayout.STYLE_TASK_EVENT);
layout.setWidth("100%");
eventGrid.addComponent(layout);
// Actual text
Label text = taskEventTextResolver.resolveText(taskEvent);
text.setWidth("100%");
layout.addComponent(text);
// Time
Label time = new Label(new HumanTime(i18nManager).format(taskEvent.getTime()));
time.setSizeUndefined();
time.addStyleName(ExplorerLayout.STYLE_TASK_EVENT_TIME);
layout.addComponent(time);
}
use of org.activiti.explorer.util.time.HumanTime in project Activiti by Activiti.
the class PrettyTimeLabel method init.
protected void init() {
final I18nManager i18nManager = ExplorerApp.get().getI18nManager();
if (date != null) {
DateFormat dateFormat = null;
if (showTime) {
dateFormat = new SimpleDateFormat(Constants.DEFAULT_TIME_FORMAT);
} else {
dateFormat = new SimpleDateFormat(Constants.DEFAULT_DATE_FORMAT);
}
if (labelTemplate != null) {
super.setValue(MessageFormat.format(labelTemplate, new HumanTime(i18nManager).format(date)));
} else {
super.setValue(new HumanTime(i18nManager).format(date));
}
setDescription(dateFormat.format(date));
} else {
super.setValue(noDateCaption);
setDescription(noDateCaption);
}
}
use of org.activiti.explorer.util.time.HumanTime in project Activiti by Activiti.
the class SavedReportDetailPanel method initHeader.
protected void initHeader() {
GridLayout details = new GridLayout(2, 2);
details.setWidth(100, UNITS_PERCENTAGE);
details.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
details.setSpacing(true);
details.setMargin(false, false, true, false);
details.setColumnExpandRatio(1, 1.0f);
detailPanelLayout.addComponent(details);
// Image
Embedded image = new Embedded(null, Images.REPORT_50);
details.addComponent(image, 0, 0, 0, 1);
// Name
Label nameLabel = new Label(SavedReportListItem.getReportDisplayName(historicProcessInstance));
nameLabel.addStyleName(Reindeer.LABEL_H2);
details.addComponent(nameLabel, 1, 0);
// Properties
HorizontalLayout propertiesLayout = new HorizontalLayout();
propertiesLayout.setSpacing(true);
details.addComponent(propertiesLayout);
// Created Time
String createLabel = i18nManager.getMessage(Messages.REPORTING_CREATE_TIME, new HumanTime(i18nManager).format(historicProcessInstance.getEndTime()));
Label versionLabel = new Label(createLabel);
versionLabel.addStyleName(ExplorerLayout.STYLE_PROCESS_HEADER_START_TIME);
propertiesLayout.addComponent(versionLabel);
}
Aggregations