Search in sources :

Example 1 with HumanTime

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);
}
Also used : HumanTime(org.activiti.explorer.util.time.HumanTime) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout)

Example 2 with HumanTime

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);
    }
}
Also used : HumanTime(org.activiti.explorer.util.time.HumanTime) SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) SimpleDateFormat(java.text.SimpleDateFormat) I18nManager(org.activiti.explorer.I18nManager)

Example 3 with HumanTime

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);
}
Also used : HumanTime(org.activiti.explorer.util.time.HumanTime) GridLayout(com.vaadin.ui.GridLayout) Label(com.vaadin.ui.Label) Embedded(com.vaadin.ui.Embedded) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

HumanTime (org.activiti.explorer.util.time.HumanTime)3 Label (com.vaadin.ui.Label)2 Embedded (com.vaadin.ui.Embedded)1 GridLayout (com.vaadin.ui.GridLayout)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 DateFormat (java.text.DateFormat)1 SimpleDateFormat (java.text.SimpleDateFormat)1 I18nManager (org.activiti.explorer.I18nManager)1