Search in sources :

Example 26 with VerticalLayout

use of com.vaadin.ui.VerticalLayout in project opennms by OpenNMS.

the class DialogWindow method createContent.

private Layout createContent(final String description) {
    VerticalLayout content = new VerticalLayout();
    content.setWidth(100, Unit.PERCENTAGE);
    Layout footer = createFooter();
    Layout mainArea = createMainArea(description);
    content.addComponent(mainArea);
    content.addComponent(footer);
    content.setExpandRatio(mainArea, 1);
    return content;
}
Also used : Layout(com.vaadin.ui.Layout) HorizontalLayout(com.vaadin.ui.HorizontalLayout) VerticalLayout(com.vaadin.ui.VerticalLayout) VerticalLayout(com.vaadin.ui.VerticalLayout)

Example 27 with VerticalLayout

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

the class TaskDetailPanel method initDescription.

protected void initDescription(HorizontalLayout layout) {
    final CssLayout descriptionLayout = new CssLayout();
    descriptionLayout.setWidth(100, UNITS_PERCENTAGE);
    layout.addComponent(descriptionLayout);
    layout.setExpandRatio(descriptionLayout, 1.0f);
    layout.setComponentAlignment(descriptionLayout, Alignment.MIDDLE_LEFT);
    String descriptionText = null;
    if (task.getDescription() != null && !"".equals(task.getDescription())) {
        descriptionText = task.getDescription();
    } else {
        descriptionText = i18nManager.getMessage(Messages.TASK_NO_DESCRIPTION);
    }
    final Label descriptionLabel = new Label(descriptionText);
    descriptionLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    descriptionLayout.addComponent(descriptionLabel);
    descriptionLayout.addListener(new LayoutClickListener() {

        public void layoutClick(LayoutClickEvent event) {
            if (event.getClickedComponent() != null && event.getClickedComponent().equals(descriptionLabel)) {
                // layout for textarea + ok button
                final VerticalLayout editLayout = new VerticalLayout();
                editLayout.setSpacing(true);
                // textarea
                final TextArea descriptionTextArea = new TextArea();
                descriptionTextArea.setNullRepresentation("");
                descriptionTextArea.setWidth(100, UNITS_PERCENTAGE);
                descriptionTextArea.setValue(task.getDescription());
                editLayout.addComponent(descriptionTextArea);
                // ok button
                Button okButton = new Button(i18nManager.getMessage(Messages.BUTTON_OK));
                editLayout.addComponent(okButton);
                editLayout.setComponentAlignment(okButton, Alignment.BOTTOM_RIGHT);
                // replace
                descriptionLayout.replaceComponent(descriptionLabel, editLayout);
                // When OK is clicked -> update task data + ui
                okButton.addListener(new ClickListener() {

                    public void buttonClick(ClickEvent event) {
                        // Update data
                        task.setDescription(descriptionTextArea.getValue().toString());
                        taskService.saveTask(task);
                        // Update UI
                        descriptionLabel.setValue(task.getDescription());
                        descriptionLayout.replaceComponent(editLayout, descriptionLabel);
                    }
                });
            }
        }
    });
}
Also used : LayoutClickEvent(com.vaadin.event.LayoutEvents.LayoutClickEvent) CssLayout(com.vaadin.ui.CssLayout) TextArea(com.vaadin.ui.TextArea) Button(com.vaadin.ui.Button) LayoutClickEvent(com.vaadin.event.LayoutEvents.LayoutClickEvent) ClickEvent(com.vaadin.ui.Button.ClickEvent) Label(com.vaadin.ui.Label) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel) VerticalLayout(com.vaadin.ui.VerticalLayout) ClickListener(com.vaadin.ui.Button.ClickListener) LayoutClickListener(com.vaadin.event.LayoutEvents.LayoutClickListener) ClaimTaskClickListener(org.activiti.explorer.ui.task.listener.ClaimTaskClickListener) LayoutClickListener(com.vaadin.event.LayoutEvents.LayoutClickListener)

Example 28 with VerticalLayout

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

the class TaskDetailPanel method init.

protected void init() {
    setSizeFull();
    addStyleName(Reindeer.LAYOUT_WHITE);
    // Central panel: all task data
    this.centralLayout = new VerticalLayout();
    centralLayout.setMargin(true);
    setDetailContainer(centralLayout);
    initHeader();
    initDescriptionAndClaimButton();
    initProcessLink();
    initParentTaskLink();
    initPeopleDetails();
    initSubTasks();
    initRelatedContent();
    initTaskForm();
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout)

Example 29 with VerticalLayout

use of com.vaadin.ui.VerticalLayout 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 30 with VerticalLayout

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

the class ProcessInstanceDetailPanel method init.

protected void init() {
    addStyleName(Reindeer.LAYOUT_WHITE);
    setSizeFull();
    panelLayout = new VerticalLayout();
    panelLayout.setWidth(100, UNITS_PERCENTAGE);
    panelLayout.setMargin(true);
    setDetailContainer(panelLayout);
    addHeader();
    addProcessImage();
    addTasks();
    addVariables();
    addDeleteButton();
}
Also used : 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