Search in sources :

Example 61 with VerticalLayout

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

the class SubTaskComponent method initAddSubTaskPanel.

protected void initAddSubTaskPanel(HorizontalLayout headerLayout) {
    // The add button is placed in a panel, so we can catch 'enter' and 'escape' events
    addSubTaskPanel = new Panel();
    addSubTaskPanel.setContent(new VerticalLayout());
    addSubTaskPanel.setSizeUndefined();
    addSubTaskPanel.addStyleName(Reindeer.PANEL_LIGHT);
    addSubTaskPanel.addStyleName("no-border");
    headerLayout.addComponent(addSubTaskPanel);
    initAddSubTaskPanelKeyboardActions();
    initAddButton();
}
Also used : Panel(com.vaadin.ui.Panel) VerticalLayout(com.vaadin.ui.VerticalLayout)

Example 62 with VerticalLayout

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

the class HistoricTaskDetailPanel method init.

protected void init() {
    setSizeFull();
    addStyleName(Reindeer.LAYOUT_WHITE);
    this.centralLayout = new VerticalLayout();
    centralLayout.setMargin(true);
    setDetailContainer(centralLayout);
    initHeader();
    initDescription();
    initParentTaskLink();
    initPeopleDetails();
    initSubTasks();
    initRelatedContent();
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout)

Example 63 with VerticalLayout

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

the class HistoricTaskDetailPanel method initSubTasks.

protected void initSubTasks() {
    subTasksLayout = new VerticalLayout();
    subTasksLayout.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
    addComponent(subTasksLayout);
    initSubTaskTitle();
    List<HistoricTaskInstance> subTasks = historyService.createHistoricTaskInstanceQuery().taskParentTaskId(historicTask.getId()).list();
    if (!subTasks.isEmpty()) {
        initSubTaskGrid();
        populateSubTasks(subTasks);
    } else {
        initNoSubTasksLabel();
    }
}
Also used : HistoricTaskInstance(org.activiti.engine.history.HistoricTaskInstance) VerticalLayout(com.vaadin.ui.VerticalLayout)

Example 64 with VerticalLayout

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

the class TaskEventsPanel method addInputField.

protected void addInputField() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    layout.setWidth(100, UNITS_PERCENTAGE);
    addComponent(layout);
    // Hack: actionHandlers can only be attached to panels or windows
    Panel textFieldPanel = new Panel();
    textFieldPanel.addStyleName(Reindeer.PANEL_LIGHT);
    textFieldPanel.setContent(new VerticalLayout());
    textFieldPanel.setWidth(100, UNITS_PERCENTAGE);
    layout.addComponent(textFieldPanel);
    layout.setExpandRatio(textFieldPanel, 1.0f);
    commentInputField = new TextField();
    commentInputField.setWidth(100, UNITS_PERCENTAGE);
    textFieldPanel.addComponent(commentInputField);
    // Hack to catch keyboard 'enter'
    textFieldPanel.addActionHandler(new Handler() {

        public void handleAction(Action action, Object sender, Object target) {
            addNewComment(commentInputField.getValue().toString());
        }

        public Action[] getActions(Object target, Object sender) {
            return new Action[] { new ShortcutAction("enter", ShortcutAction.KeyCode.ENTER, null) };
        }
    });
    addCommentButton = new Button(i18nManager.getMessage(Messages.TASK_ADD_COMMENT));
    layout.addComponent(addCommentButton);
    layout.setComponentAlignment(addCommentButton, Alignment.MIDDLE_LEFT);
    addCommentButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            addNewComment(commentInputField.getValue().toString());
        }
    });
}
Also used : Panel(com.vaadin.ui.Panel) ShortcutAction(com.vaadin.event.ShortcutAction) Action(com.vaadin.event.Action) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) VerticalLayout(com.vaadin.ui.VerticalLayout) TextField(com.vaadin.ui.TextField) Handler(com.vaadin.event.Action.Handler) ShortcutAction(com.vaadin.event.ShortcutAction) ClickListener(com.vaadin.ui.Button.ClickListener) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 65 with VerticalLayout

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

the class JobDetailPanel method addJobState.

protected void addJobState() {
    Label processDefinitionHeader = new Label(i18nManager.getMessage(Messages.JOB_HEADER_EXECUTION));
    processDefinitionHeader.addStyleName(ExplorerLayout.STYLE_H3);
    processDefinitionHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
    processDefinitionHeader.setWidth(100, UNITS_PERCENTAGE);
    addComponent(processDefinitionHeader);
    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    layout.setSizeFull();
    layout.setMargin(true, false, true, false);
    addDetailComponent(layout);
    setDetailExpandRatio(layout, 1.0f);
    // Exceptions
    if (job.getExceptionMessage() != null) {
        // Number of retries
        Label retrieslabel = new Label(getRetriesLabel(job));
        layout.addComponent(retrieslabel);
        // Exception
        Label exceptionMessageLabel = new Label(i18nManager.getMessage(Messages.JOB_ERROR) + ": " + job.getExceptionMessage());
        exceptionMessageLabel.addStyleName(ExplorerLayout.STYLE_JOB_EXCEPTION_MESSAGE);
        layout.addComponent(exceptionMessageLabel);
        // Add Exception stacktrace
        String stack = managementService.getJobExceptionStacktrace(job.getId());
        Label stackTraceLabel = new Label(stack);
        stackTraceLabel.setContentMode(Label.CONTENT_PREFORMATTED);
        stackTraceLabel.addStyleName(ExplorerLayout.STYLE_JOB_EXCEPTION_TRACE);
        stackTraceLabel.setSizeFull();
        Panel stackPanel = new Panel();
        stackPanel.setWidth(100, UNITS_PERCENTAGE);
        stackPanel.setSizeFull();
        stackPanel.setScrollable(true);
        stackPanel.addComponent(stackTraceLabel);
        layout.addComponent(stackPanel);
        layout.setExpandRatio(stackPanel, 1.0f);
    } else {
        if (job.getProcessDefinitionId() != null) {
            // This is a hack .. need to cleanify this in the engine
            JobEntity jobEntity = (JobEntity) job;
            if (jobEntity.getJobHandlerType().equals(TimerSuspendProcessDefinitionHandler.TYPE)) {
                addLinkToProcessDefinition(layout, i18nManager.getMessage(Messages.JOB_SUSPEND_PROCESSDEFINITION), false);
            } else if (jobEntity.getJobHandlerType().equals(TimerActivateProcessDefinitionHandler.TYPE)) {
                addLinkToProcessDefinition(layout, i18nManager.getMessage(Messages.JOB_ACTIVATE_PROCESSDEFINITION), true);
            } else {
                addNotYetExecutedLabel(layout);
            }
        } else {
            addNotYetExecutedLabel(layout);
        }
    }
}
Also used : JobEntity(org.activiti.engine.impl.persistence.entity.JobEntity) Panel(com.vaadin.ui.Panel) DetailPanel(org.activiti.explorer.ui.custom.DetailPanel) Label(com.vaadin.ui.Label) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel) VerticalLayout(com.vaadin.ui.VerticalLayout)

Aggregations

VerticalLayout (com.vaadin.ui.VerticalLayout)75 Label (com.vaadin.ui.Label)33 HorizontalLayout (com.vaadin.ui.HorizontalLayout)21 Link (com.vaadin.ui.Link)13 Button (com.vaadin.ui.Button)12 ExternalResource (com.vaadin.server.ExternalResource)9 ClickEvent (com.vaadin.ui.Button.ClickEvent)8 PostConstruct (javax.annotation.PostConstruct)8 Panel (com.vaadin.ui.Panel)7 ClickListener (com.vaadin.ui.Button.ClickListener)6 Embedded (com.vaadin.ui.Embedded)5 ExternalResource (com.vaadin.terminal.ExternalResource)4 StreamResource (com.vaadin.terminal.StreamResource)4 LayoutClickEvent (com.vaadin.event.LayoutEvents.LayoutClickEvent)3 LayoutClickListener (com.vaadin.event.LayoutEvents.LayoutClickListener)3 InputStream (java.io.InputStream)3 PrettyTimeLabel (org.activiti.explorer.ui.custom.PrettyTimeLabel)3 Resource (com.vaadin.terminal.Resource)2 StreamSource (com.vaadin.terminal.StreamResource.StreamSource)2 CssLayout (com.vaadin.ui.CssLayout)2