Search in sources :

Example 71 with VerticalLayout

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

the class UserDetailsComponent method addUserDetails.

protected void addUserDetails() {
    VerticalLayout detailsLayout = new VerticalLayout();
    addComponent(detailsLayout);
    // Layout for name + skype
    HorizontalLayout nameLayout = new HorizontalLayout();
    nameLayout.setSpacing(true);
    detailsLayout.addComponent(nameLayout);
    // Name 
    Label nameLabel = null;
    if (user != null) {
        nameLabel = new Label(user.getFirstName() + " " + user.getLastName());
        nameLabel.addStyleName(ExplorerLayout.STYLE_LABEL_BOLD);
    } else {
        nameLabel = new Label(" ", Label.CONTENT_XHTML);
    }
    nameLayout.addComponent(nameLabel);
    // Layout for lower details
    HorizontalLayout actionsLayout = new HorizontalLayout();
    actionsLayout.setSpacing(true);
    detailsLayout.addComponent(actionsLayout);
    // Role
    Label roleLabel = new Label(role);
    actionsLayout.addComponent(roleLabel);
    // Action button
    if (clickListener != null) {
        Button button = new Button(buttonCaption);
        button.addStyleName(Reindeer.BUTTON_SMALL);
        button.addListener(clickListener);
        actionsLayout.addComponent(button);
    }
}
Also used : Button(com.vaadin.ui.Button) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 72 with VerticalLayout

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

the class EditorProcessDefinitionDetailPanel method initUi.

protected void initUi() {
    setSizeFull();
    addStyleName(Reindeer.LAYOUT_WHITE);
    detailPanelLayout = new VerticalLayout();
    detailPanelLayout.setWidth(100, UNITS_PERCENTAGE);
    detailPanelLayout.setMargin(true);
    detailPanelLayout.setSpacing(true);
    setDetailContainer(detailPanelLayout);
    // All details about the process definition
    initHeader();
    detailContainer = new HorizontalLayout();
    detailContainer.addStyleName(Reindeer.PANEL_LIGHT);
    detailPanelLayout.addComponent(detailContainer);
    detailContainer.setSizeFull();
    initActions();
    initProcessDefinitionInfo();
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 73 with VerticalLayout

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

the class SelectEditorComponent method createModelerEditorChoice.

protected void createModelerEditorChoice() {
    modelerLayout = new HorizontalLayout();
    modelerLayout.setWidth("300px");
    modelerLayout.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    addComponent(modelerLayout);
    modelerButton = new Button();
    modelerButton.setIcon(Images.PROCESS_EDITOR_BPMN);
    modelerButton.setStyleName(Reindeer.BUTTON_LINK);
    modelerLayout.addComponent(modelerButton);
    modelerLayout.setComponentAlignment(modelerButton, Alignment.MIDDLE_LEFT);
    VerticalLayout modelerTextLayout = new VerticalLayout();
    modelerLayout.addComponent(modelerTextLayout);
    modelerLayout.setExpandRatio(modelerTextLayout, 1.0f);
    modelerLabel = new Label(i18nManager.getMessage(Messages.PROCESS_EDITOR_MODELER));
    modelerLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    modelerTextLayout.addComponent(modelerLabel);
    modelerDescriptionLabel = new Label(i18nManager.getMessage(Messages.PROCESS_EDITOR_MODELER_DESCRIPTION));
    modelerDescriptionLabel.addStyleName(Reindeer.LABEL_SMALL);
    modelerDescriptionLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    modelerTextLayout.addComponent(modelerDescriptionLabel);
    modelerLayout.addListener(new LayoutClickListener() {

        public void layoutClick(LayoutClickEvent event) {
            preferModeler();
        }
    });
    modelerButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            preferModeler();
        }
    });
}
Also used : LayoutClickEvent(com.vaadin.event.LayoutEvents.LayoutClickEvent) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) LayoutClickEvent(com.vaadin.event.LayoutEvents.LayoutClickEvent) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) ClickListener(com.vaadin.ui.Button.ClickListener) LayoutClickListener(com.vaadin.event.LayoutEvents.LayoutClickListener) HorizontalLayout(com.vaadin.ui.HorizontalLayout) LayoutClickListener(com.vaadin.event.LayoutEvents.LayoutClickListener)

Example 74 with VerticalLayout

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

the class UploadComponent method addDropPanel.

protected void addDropPanel() {
    Panel dropPanel = new Panel();
    DragAndDropWrapper dragAndDropWrapper = new DragAndDropWrapper(dropPanel);
    dragAndDropWrapper.setDropHandler(this);
    dragAndDropWrapper.setWidth("80%");
    addComponent(dragAndDropWrapper);
    setComponentAlignment(dragAndDropWrapper, Alignment.MIDDLE_CENTER);
    Label dropLabel = new Label(i18nManager.getMessage(Messages.UPLOAD_DROP));
    dropLabel.setSizeUndefined();
    dropPanel.addComponent(dropLabel);
    ((VerticalLayout) dropPanel.getContent()).setComponentAlignment(dropLabel, Alignment.MIDDLE_CENTER);
}
Also used : Panel(com.vaadin.ui.Panel) DragAndDropWrapper(com.vaadin.ui.DragAndDropWrapper) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout)

Example 75 with VerticalLayout

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

the class ImageAttachmentRenderer method getDetailComponent.

@Override
public Component getDetailComponent(Attachment attachment) {
    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setSizeUndefined();
    verticalLayout.setSpacing(true);
    verticalLayout.setMargin(true);
    Label description = new Label(attachment.getDescription());
    description.setSizeUndefined();
    verticalLayout.addComponent(description);
    // Image
    TaskService taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
    String mimeType = extractMineType(attachment.getType());
    InputStream imageStream = ImageUtil.resizeImage(taskService.getAttachmentContent(attachment.getId()), mimeType, 900, 550);
    Resource resource = new StreamResource(new InputStreamStreamSource(imageStream), attachment.getName() + extractExtention(attachment.getType()), ExplorerApp.get());
    Embedded image = new Embedded(null, resource);
    verticalLayout.addComponent(image);
    // Linke
    HorizontalLayout LinkLayout = new HorizontalLayout();
    LinkLayout.setSpacing(true);
    verticalLayout.addComponent(LinkLayout);
    verticalLayout.setComponentAlignment(LinkLayout, Alignment.MIDDLE_CENTER);
    Label fullSizeLabel = new Label(ExplorerApp.get().getI18nManager().getMessage(Messages.RELATED_CONTENT_SHOW_FULL_SIZE));
    LinkLayout.addComponent(fullSizeLabel);
    Link link = null;
    if (attachment.getUrl() != null) {
        link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl()));
    } else {
        taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
        Resource res = new StreamResource(new InputStreamStreamSource(taskService.getAttachmentContent(attachment.getId())), attachment.getName() + extractExtention(attachment.getType()), ExplorerApp.get());
        link = new Link(attachment.getName(), res);
    }
    link.setIcon(Images.RELATED_CONTENT_PICTURE);
    link.setTargetName(ExplorerLayout.LINK_TARGET_BLANK);
    LinkLayout.addComponent(link);
    return verticalLayout;
}
Also used : StreamResource(com.vaadin.terminal.StreamResource) TaskService(org.activiti.engine.TaskService) InputStream(java.io.InputStream) Label(com.vaadin.ui.Label) StreamResource(com.vaadin.terminal.StreamResource) ExternalResource(com.vaadin.terminal.ExternalResource) Resource(com.vaadin.terminal.Resource) VerticalLayout(com.vaadin.ui.VerticalLayout) Embedded(com.vaadin.ui.Embedded) ExternalResource(com.vaadin.terminal.ExternalResource) InputStreamStreamSource(org.activiti.explorer.ui.util.InputStreamStreamSource) Link(com.vaadin.ui.Link) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

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