Search in sources :

Example 31 with Embedded

use of com.vaadin.ui.Embedded in project Activiti by Activiti.

the class DeploymentDetailPanel method addDeploymentName.

protected void addDeploymentName() {
    GridLayout taskDetails = new GridLayout(3, 2);
    taskDetails.setWidth(100, UNITS_PERCENTAGE);
    taskDetails.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
    taskDetails.setSpacing(true);
    taskDetails.setMargin(false, false, true, false);
    // Add image
    Embedded image = new Embedded(null, Images.DEPLOYMENT_50);
    taskDetails.addComponent(image, 0, 0, 0, 1);
    // Add deployment name
    Label nameLabel = new Label();
    if (deployment.getName() != null) {
        nameLabel.setValue(deployment.getName());
    } else {
        nameLabel.setValue(i18nManager.getMessage(Messages.DEPLOYMENT_NO_NAME));
    }
    nameLabel.addStyleName(Reindeer.LABEL_H2);
    taskDetails.addComponent(nameLabel, 1, 0, 2, 0);
    // Add deploy time
    PrettyTimeLabel deployTimeLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.DEPLOYMENT_DEPLOY_TIME), deployment.getDeploymentTime(), null, true);
    deployTimeLabel.addStyleName(ExplorerLayout.STYLE_DEPLOYMENT_HEADER_DEPLOY_TIME);
    taskDetails.addComponent(deployTimeLabel, 1, 1);
    taskDetails.setColumnExpandRatio(1, 1.0f);
    taskDetails.setColumnExpandRatio(2, 1.0f);
    addDetailComponent(taskDetails);
}
Also used : GridLayout(com.vaadin.ui.GridLayout) Label(com.vaadin.ui.Label) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel) Embedded(com.vaadin.ui.Embedded) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel)

Example 32 with Embedded

use of com.vaadin.ui.Embedded in project Activiti by Activiti.

the class AdminRunningInstancesPanel method addTaskItem.

protected void addTaskItem(HistoricTaskInstance task, Table taskTable) {
    Item item = taskTable.addItem(task.getId());
    if (task.getEndTime() != null) {
        item.getItemProperty("finished").setValue(new Embedded(null, Images.TASK_FINISHED_22));
    } else {
        item.getItemProperty("finished").setValue(new Embedded(null, Images.TASK_22));
    }
    item.getItemProperty("name").setValue(task.getName());
    item.getItemProperty("priority").setValue(task.getPriority());
    item.getItemProperty("startDate").setValue(new PrettyTimeLabel(task.getStartTime(), true));
    item.getItemProperty("endDate").setValue(new PrettyTimeLabel(task.getEndTime(), true));
    if (task.getDueDate() != null) {
        Label dueDateLabel = new PrettyTimeLabel(task.getEndTime(), i18nManager.getMessage(Messages.TASK_NOT_FINISHED_YET), true);
        item.getItemProperty("dueDate").setValue(dueDateLabel);
    }
    if (task.getAssignee() != null) {
        Component taskAssigneeComponent = getTaskAssigneeComponent(task.getAssignee());
        if (taskAssigneeComponent != null) {
            item.getItemProperty("assignee").setValue(taskAssigneeComponent);
        }
    }
}
Also used : Item(com.vaadin.data.Item) Label(com.vaadin.ui.Label) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel) Embedded(com.vaadin.ui.Embedded) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel) Component(com.vaadin.ui.Component)

Example 33 with Embedded

use of com.vaadin.ui.Embedded in project Activiti by Activiti.

the class UserDetailPanel method initPageTitle.

protected void initPageTitle() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth(100, UNITS_PERCENTAGE);
    layout.setSpacing(true);
    layout.setMargin(false, false, true, false);
    layout.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
    addDetailComponent(layout);
    Embedded userImage = new Embedded(null, Images.USER_50);
    layout.addComponent(userImage);
    Label userName = new Label(user.getFirstName() + " " + user.getLastName());
    userName.setSizeUndefined();
    userName.addStyleName(Reindeer.LABEL_H2);
    layout.addComponent(userName);
    layout.setComponentAlignment(userName, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(userName, 1.0f);
}
Also used : Label(com.vaadin.ui.Label) Embedded(com.vaadin.ui.Embedded) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 34 with Embedded

use of com.vaadin.ui.Embedded in project Activiti by Activiti.

the class AdminCompletedInstancesPanel method initPageTitle.

protected void initPageTitle() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth(100, UNITS_PERCENTAGE);
    layout.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
    layout.setSpacing(true);
    layout.setMargin(false, false, true, false);
    addDetailComponent(layout);
    Embedded groupImage = new Embedded(null, Images.PROCESS_50);
    layout.addComponent(groupImage);
    Label groupName = new Label(i18nManager.getMessage(Messages.ADMIN_COMPLETED_TITLE));
    groupName.setSizeUndefined();
    groupName.addStyleName(Reindeer.LABEL_H2);
    layout.addComponent(groupName);
    layout.setComponentAlignment(groupName, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(groupName, 1.0f);
}
Also used : Label(com.vaadin.ui.Label) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel) Embedded(com.vaadin.ui.Embedded) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 35 with Embedded

use of com.vaadin.ui.Embedded in project Activiti by Activiti.

the class AdminRunningInstancesPanel method initPageTitle.

protected void initPageTitle() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth(100, UNITS_PERCENTAGE);
    layout.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
    layout.setSpacing(true);
    layout.setMargin(false, false, true, false);
    addDetailComponent(layout);
    Embedded groupImage = new Embedded(null, Images.PROCESS_50);
    layout.addComponent(groupImage);
    Label groupName = new Label(i18nManager.getMessage(Messages.ADMIN_RUNNING_TITLE));
    groupName.setSizeUndefined();
    groupName.addStyleName(Reindeer.LABEL_H2);
    layout.addComponent(groupName);
    layout.setComponentAlignment(groupName, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(groupName, 1.0f);
}
Also used : Label(com.vaadin.ui.Label) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel) Embedded(com.vaadin.ui.Embedded) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

Embedded (com.vaadin.ui.Embedded)40 Label (com.vaadin.ui.Label)29 HorizontalLayout (com.vaadin.ui.HorizontalLayout)19 PrettyTimeLabel (org.activiti.explorer.ui.custom.PrettyTimeLabel)14 StreamResource (com.vaadin.terminal.StreamResource)12 GridLayout (com.vaadin.ui.GridLayout)9 Item (com.vaadin.data.Item)7 InputStream (java.io.InputStream)7 StreamSource (com.vaadin.terminal.StreamResource.StreamSource)6 ExternalResource (com.vaadin.terminal.ExternalResource)5 Resource (com.vaadin.terminal.Resource)5 VerticalLayout (com.vaadin.ui.VerticalLayout)5 Component (com.vaadin.ui.Component)4 Panel (com.vaadin.ui.Panel)4 Picture (org.activiti.engine.identity.Picture)4 ClickEvent (com.vaadin.ui.Button.ClickEvent)3 ClickListener (com.vaadin.ui.Button.ClickListener)3 Link (com.vaadin.ui.Link)3 ProcessEngineConfiguration (org.activiti.engine.ProcessEngineConfiguration)3 ProcessDefinitionEntity (org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity)3