Search in sources :

Example 26 with HorizontalLayout

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

the class ReportDetailPanel 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(getReportDisplayName());
    nameLabel.addStyleName(Reindeer.LABEL_H2);
    details.addComponent(nameLabel, 1, 0);
    // Properties
    HorizontalLayout propertiesLayout = new HorizontalLayout();
    propertiesLayout.setSpacing(true);
    details.addComponent(propertiesLayout);
    // Version
    String versionString = i18nManager.getMessage(Messages.PROCESS_VERSION, processDefinition.getVersion());
    Label versionLabel = new Label(versionString);
    versionLabel.addStyleName(ExplorerLayout.STYLE_PROCESS_HEADER_VERSION);
    propertiesLayout.addComponent(versionLabel);
}
Also used : GridLayout(com.vaadin.ui.GridLayout) Label(com.vaadin.ui.Label) Embedded(com.vaadin.ui.Embedded) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 27 with HorizontalLayout

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

the class ReportDetailPanel method initUi.

protected void initUi() {
    setSizeFull();
    addStyleName(Reindeer.LAYOUT_WHITE);
    detailPanelLayout = new VerticalLayout();
    detailPanelLayout.setWidth(100, UNITS_PERCENTAGE);
    detailPanelLayout.setMargin(true);
    setDetailContainer(detailPanelLayout);
    initHeader();
    detailContainer = new HorizontalLayout();
    detailContainer.addStyleName(Reindeer.PANEL_LIGHT);
    detailPanelLayout.addComponent(detailContainer);
    detailContainer.setSizeFull();
    initForm();
    initActions();
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 28 with HorizontalLayout

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

the class EditorProcessDefinitionInfoComponent method initImage.

protected void initImage() {
    processImageContainer = new VerticalLayout();
    Label processTitle = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM));
    processTitle.addStyleName(ExplorerLayout.STYLE_H3);
    processImageContainer.addComponent(processTitle);
    StreamSource streamSource = null;
    final byte[] editorSourceExtra = repositoryService.getModelEditorSourceExtra(modelData.getId());
    if (editorSourceExtra != null) {
        streamSource = new StreamSource() {

            private static final long serialVersionUID = 1L;

            public InputStream getStream() {
                InputStream inStream = null;
                try {
                    inStream = new ByteArrayInputStream(editorSourceExtra);
                } catch (Exception e) {
                    LOGGER.warn("Error reading PNG in StreamSource", e);
                }
                return inStream;
            }
        };
    }
    if (streamSource != null) {
        Embedded embedded = new Embedded(null, new ImageStreamSource(streamSource, ExplorerApp.get()));
        embedded.setType(Embedded.TYPE_IMAGE);
        embedded.setSizeUndefined();
        // using panel for scrollbars
        Panel imagePanel = new Panel();
        imagePanel.addStyleName(Reindeer.PANEL_LIGHT);
        imagePanel.setWidth(100, UNITS_PERCENTAGE);
        imagePanel.setHeight(700, UNITS_PIXELS);
        HorizontalLayout panelLayout = new HorizontalLayout();
        panelLayout.setSizeUndefined();
        imagePanel.setContent(panelLayout);
        imagePanel.addComponent(embedded);
        processImageContainer.addComponent(imagePanel);
    } else {
        Label noImageAvailable = new Label(i18nManager.getMessage(Messages.PROCESS_NO_DIAGRAM));
        processImageContainer.addComponent(noImageAvailable);
    }
    addComponent(processImageContainer);
}
Also used : Panel(com.vaadin.ui.Panel) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) StreamSource(com.vaadin.terminal.StreamResource.StreamSource) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) Embedded(com.vaadin.ui.Embedded) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 29 with HorizontalLayout

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

the class SelectEditorComponent method createTableDrivenEditorChoice.

protected void createTableDrivenEditorChoice() {
    tableEditorLayout = new HorizontalLayout();
    tableEditorLayout.setWidth("300px");
    tableEditorLayout.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    addComponent(tableEditorLayout);
    tableEditorButton = new Button();
    tableEditorButton.setIcon(Images.PROCESS_EDITOR_TABLE);
    tableEditorButton.setStyleName(Reindeer.BUTTON_LINK);
    tableEditorLayout.addComponent(tableEditorButton);
    tableEditorLayout.setComponentAlignment(tableEditorButton, Alignment.MIDDLE_LEFT);
    VerticalLayout tableEditorTextLayout = new VerticalLayout();
    tableEditorLayout.addComponent(tableEditorTextLayout);
    tableEditorLayout.setExpandRatio(tableEditorTextLayout, 1.0f);
    tableEditorLabel = new Label(i18nManager.getMessage(Messages.PROCESS_EDITOR_TABLE));
    tableEditorLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    tableEditorTextLayout.addComponent(tableEditorLabel);
    tableEditorDescriptionLabel = new Label(i18nManager.getMessage(Messages.PROCESS_EDITOR_TABLE_DESCRIPTION));
    tableEditorDescriptionLabel.addStyleName(Reindeer.LABEL_SMALL);
    tableEditorDescriptionLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    tableEditorTextLayout.addComponent(tableEditorDescriptionLabel);
    tableEditorLayout.addListener(new LayoutClickListener() {

        public void layoutClick(LayoutClickEvent event) {
            preferTableDrivenEditor();
        }
    });
    tableEditorButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            preferTableDrivenEditor();
        }
    });
}
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 30 with HorizontalLayout

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

the class UrlAttachmentRenderer method getDetailComponent.

public Component getDetailComponent(Attachment attachment) {
    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setSpacing(true);
    verticalLayout.setMargin(true);
    verticalLayout.addComponent(new Label(attachment.getDescription()));
    HorizontalLayout linkLayout = new HorizontalLayout();
    linkLayout.setSpacing(true);
    verticalLayout.addComponent(linkLayout);
    // Icon
    linkLayout.addComponent(new Embedded(null, Images.RELATED_CONTENT_URL));
    // Link
    Link link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl()));
    link.setTargetName(ExplorerLayout.LINK_TARGET_BLANK);
    linkLayout.addComponent(link);
    return verticalLayout;
}
Also used : Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) Embedded(com.vaadin.ui.Embedded) ExternalResource(com.vaadin.terminal.ExternalResource) Link(com.vaadin.ui.Link) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

HorizontalLayout (com.vaadin.ui.HorizontalLayout)85 Label (com.vaadin.ui.Label)45 Button (com.vaadin.ui.Button)26 VerticalLayout (com.vaadin.ui.VerticalLayout)20 Embedded (com.vaadin.ui.Embedded)19 ClickEvent (com.vaadin.ui.Button.ClickEvent)17 ClickListener (com.vaadin.ui.Button.ClickListener)15 ExternalResource (com.vaadin.terminal.ExternalResource)7 GridLayout (com.vaadin.ui.GridLayout)7 TextField (com.vaadin.ui.TextField)6 PrettyTimeLabel (org.activiti.explorer.ui.custom.PrettyTimeLabel)6 StreamResource (com.vaadin.terminal.StreamResource)5 Link (com.vaadin.ui.Link)5 Panel (com.vaadin.ui.Panel)5 InputStream (java.io.InputStream)4 URL (java.net.URL)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)3 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)3 ExternalResource (com.vaadin.server.ExternalResource)3