Example usage for com.vaadin.ui TabSheet addTab

List of usage examples for com.vaadin.ui TabSheet addTab

Introduction

In this page you can find the example usage for com.vaadin.ui TabSheet addTab.

Prototype

public Tab addTab(Component component, int position) 

Source Link

Document

Adds a new tab into TabSheet.

Usage

From source file:eu.maxschuster.vaadin.signaturefield.demo.DemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {

    getPage().setTitle(pageTitle);/*  www.  j ava 2  s . c o m*/

    final VerticalLayout margin = new VerticalLayout();
    setContent(margin);

    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setWidth("658px");
    margin.addComponent(layout);
    margin.setComponentAlignment(layout, Alignment.TOP_CENTER);

    final Label header1 = new Label(pageTitle);
    header1.addStyleName("h1");
    header1.setSizeUndefined();
    layout.addComponent(header1);
    layout.setComponentAlignment(header1, Alignment.TOP_CENTER);

    final TabSheet tabSheet = new TabSheet();
    tabSheet.setWidth("100%");
    layout.addComponent(tabSheet);
    layout.setComponentAlignment(tabSheet, Alignment.TOP_CENTER);

    final Panel signaturePanel = new Panel();
    signaturePanel.addStyleName("signature-panel");
    signaturePanel.setWidth("100%");
    tabSheet.addTab(signaturePanel, "Demo");

    final VerticalLayout signatureLayout = new VerticalLayout();
    signatureLayout.setMargin(true);
    signatureLayout.setSpacing(true);
    signatureLayout.setSizeFull();
    signaturePanel.setContent(signatureLayout);

    final SignatureField signatureField = new SignatureField();
    signatureField.setWidth("100%");
    signatureField.setHeight("318px");
    signatureField.setPenColor(Color.ULTRAMARINE);
    signatureField.setBackgroundColor("white");
    signatureField.setConverter(new StringToDataUrlConverter());
    signatureField.setPropertyDataSource(dataUrlProperty);
    signatureField.setVelocityFilterWeight(0.7);
    signatureLayout.addComponent(signatureField);
    signatureLayout.setComponentAlignment(signatureField, Alignment.MIDDLE_CENTER);

    final HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setSpacing(true);
    buttonLayout.setWidth("100%");
    signatureLayout.addComponent(buttonLayout);

    final Button clearButton = new Button("Clear", new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            signatureField.clear();
        }
    });
    buttonLayout.addComponent(clearButton);
    buttonLayout.setComponentAlignment(clearButton, Alignment.MIDDLE_LEFT);

    final Label message = new Label("Sign above");
    message.setSizeUndefined();
    buttonLayout.addComponent(message);
    buttonLayout.setComponentAlignment(message, Alignment.MIDDLE_CENTER);

    final ButtonLink saveButtonLink = new ButtonLink("Save", null);
    saveButtonLink.setTargetName("_blank");
    buttonLayout.addComponent(saveButtonLink);
    buttonLayout.setComponentAlignment(saveButtonLink, Alignment.MIDDLE_RIGHT);

    final Panel optionsPanel = new Panel();
    optionsPanel.setSizeFull();
    tabSheet.addTab(optionsPanel, "Options");

    final FormLayout optionsLayout = new FormLayout();
    optionsLayout.setMargin(true);
    optionsLayout.setSpacing(true);
    optionsPanel.setContent(optionsLayout);

    final ComboBox mimeTypeComboBox = new ComboBox(null, mimeTypeContainer);
    optionsLayout.addComponent(mimeTypeComboBox);
    mimeTypeComboBox.setItemCaptionPropertyId("mimeType");
    mimeTypeComboBox.setNullSelectionAllowed(false);
    mimeTypeComboBox.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            MimeType mimeType = (MimeType) event.getProperty().getValue();
            signatureField.setMimeType(mimeType);
        }
    });
    mimeTypeComboBox.setValue(MimeType.PNG);
    mimeTypeComboBox.setCaption("Result MIME-Type");

    final CheckBox immediateCheckBox = new CheckBox("immediate", false);
    optionsLayout.addComponent(immediateCheckBox);
    immediateCheckBox.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            boolean immediate = (Boolean) event.getProperty().getValue();
            signatureField.setImmediate(immediate);
        }
    });

    final CheckBox readOnlyCheckBox = new CheckBox("readOnly", false);
    optionsLayout.addComponent(readOnlyCheckBox);
    readOnlyCheckBox.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            boolean readOnly = (Boolean) event.getProperty().getValue();
            signatureField.setReadOnly(readOnly);
            mimeTypeComboBox.setReadOnly(readOnly);
            clearButton.setEnabled(!readOnly);
        }
    });

    final CheckBox requiredCheckBox = new CheckBox("required (causes bug that clears field)", false);
    optionsLayout.addComponent(requiredCheckBox);
    requiredCheckBox.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            boolean required = (Boolean) event.getProperty().getValue();
            signatureField.setRequired(required);
        }
    });

    final CheckBox clearButtonEnabledButton = new CheckBox("clearButtonEnabled", false);
    optionsLayout.addComponent(clearButtonEnabledButton);
    clearButtonEnabledButton.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            boolean clearButtonEnabled = (Boolean) event.getProperty().getValue();
            signatureField.setClearButtonEnabled(clearButtonEnabled);
        }
    });

    final Panel resultPanel = new Panel("Results:");
    resultPanel.setWidth("100%");
    layout.addComponent(resultPanel);

    final VerticalLayout resultLayout = new VerticalLayout();
    resultLayout.setMargin(true);
    resultPanel.setContent(resultLayout);

    final Image stringPreviewImage = new Image("String preview image:");
    stringPreviewImage.setWidth("500px");
    resultLayout.addComponent(stringPreviewImage);

    final Image dataUrlPreviewImage = new Image("DataURL preview image:");
    dataUrlPreviewImage.setWidth("500px");
    resultLayout.addComponent(dataUrlPreviewImage);

    final TextArea textArea = new TextArea("DataURL:");
    textArea.setWidth("100%");
    textArea.setHeight("300px");
    resultLayout.addComponent(textArea);

    final Label emptyLabel = new Label();
    emptyLabel.setCaption("Is Empty:");
    emptyLabel.setValue(String.valueOf(signatureField.isEmpty()));
    resultLayout.addComponent(emptyLabel);

    signatureField.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            String signature = (String) event.getProperty().getValue();
            stringPreviewImage.setSource(signature != null ? new ExternalResource(signature) : null);
            textArea.setValue(signature);
            emptyLabel.setValue(String.valueOf(signatureField.isEmpty()));
        }
    });
    dataUrlProperty.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            try {
                final DataUrl signature = (DataUrl) event.getProperty().getValue();
                dataUrlPreviewImage.setSource(
                        signature != null ? new ExternalResource(serializer.serialize(signature)) : null);
                StreamResource streamResource = null;
                if (signature != null) {
                    StreamSource streamSource = new StreamSource() {

                        @Override
                        public InputStream getStream() {
                            return new ByteArrayInputStream(signature.getData());
                        }
                    };
                    MimeType mimeType = MimeType.valueOfMimeType(signature.getMimeType());
                    String extension = null;

                    switch (mimeType) {
                    case JPEG:
                        extension = "jpg";
                        break;
                    case PNG:
                        extension = "png";
                        break;
                    }

                    streamResource = new StreamResource(streamSource, "signature." + extension);
                    streamResource.setMIMEType(signature.getMimeType());
                    streamResource.setCacheTime(0);
                }
                saveButtonLink.setResource(streamResource);
            } catch (MalformedURLException e) {
                logger.error(e.getMessage(), e);
            }
        }
    });
}

From source file:gov.osti.doecode.RepositoryForm.java

/**
 * Create a basic form UI for editing software metadata information.
 * //from w  ww.j  av a  2s. c o  m
 * @param ui link to the MyUI parent UI
 */
public RepositoryForm(MyUI ui) {
    this.ui = ui;

    setSizeUndefined();

    agentGrid.setColumns("firstName", "lastName", "email");
    agentGrid.setHeightMode(HeightMode.ROW);
    agentGrid.setHeightByRows(8);

    idGrid.setColumns("relationType", "identifierType", "value");
    idGrid.setHeightMode(HeightMode.ROW);
    idGrid.setHeightByRows(8);

    idForm = new IdentifierForm(this);
    agentForm = new AgentForm(this);

    TabSheet tabs = new TabSheet();
    tabs.addStyleName(ValoTheme.TABSHEET_FRAMED);
    tabs.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);

    addComponent(tabs);

    HorizontalLayout main = new HorizontalLayout();
    main.setSpacing(true);
    main.setMargin(true);

    FormLayout left = new FormLayout();
    FormLayout right = new FormLayout();

    countryCode.addItems(countryCodes);

    left.addComponents(url, loadButton, name, openSource, siteOwnershipCode, acronym, doi, countryCode);
    right.addComponents(keywords, rights, license, operatingSystem, siteAccessionNumber, otherRequirements);

    loadButton.addClickListener(e -> {
        try {
            SoftwareRepository repo = Reader.loadRepository("doecode");

            setSoftwareRepository(repo);

        } catch (IOException ex) {
            setComponentError(new UserError("Unable to load: " + ex.getMessage()));
        }
    });

    main.addComponents(left, right);

    tabs.addTab(main, "Metadata");

    Button agentAddButton = new Button("New");
    agentAddButton.setStyleName(BaseTheme.BUTTON_LINK);
    agentAddButton.setIcon(FontAwesome.PLUS);

    agentAddButton.addClickListener(e -> {
        agentForm.setAgent(new Agent());
    });

    VerticalLayout innerAgent = new VerticalLayout(agentAddButton, agentGrid);
    innerAgent.setSizeUndefined();
    HorizontalLayout agentLayout = new HorizontalLayout(innerAgent, agentForm);
    agentLayout.setSpacing(true);
    agentLayout.setMargin(true);

    tabs.addTab(agentLayout, "Agents");

    Button idAddButton = new Button("New");
    idAddButton.setIcon(FontAwesome.PLUS);
    idAddButton.setStyleName(BaseTheme.BUTTON_LINK);
    idAddButton.setSizeUndefined();

    idAddButton.addClickListener(e -> {
        idForm.setIdentifier(new Identifier());
    });

    VerticalLayout innerId = new VerticalLayout(idAddButton, idGrid);
    HorizontalLayout idTab = new HorizontalLayout(innerId, idForm);
    idTab.setSpacing(true);
    idTab.setMargin(true);

    tabs.addTab(idTab, "Identifiers");

    agentGrid.addSelectionListener(e -> {
        if (!e.getSelected().isEmpty()) {
            Agent agent = (Agent) e.getSelected().iterator().next();
            agentForm.setAgent(agent);
            System.out.println("Selected " + agent.getFirstName());
        }
    });
    idGrid.addSelectionListener(e -> {
        if (!e.getSelected().isEmpty()) {
            Identifier identifier = (Identifier) e.getSelected().iterator().next();
            idForm.setIdentifier(identifier);
        }
    });

}

From source file:io.subutai.plugin.accumulo.ui.AccumuloComponent.java

public AccumuloComponent(ExecutorService executorService, Accumulo accumulo, Hadoop hadoop, Zookeeper zookeeper,
        Tracker tracker, EnvironmentManager environmentManager) throws NamingException {

    setSizeFull();/*from www .  ja  v  a  2s  .  c o m*/

    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setSpacing(true);
    verticalLayout.setSizeFull();

    TabSheet sheet = new TabSheet();
    sheet.setSizeFull();

    final Manager manager = new Manager(executorService, accumulo, hadoop, zookeeper, tracker,
            environmentManager);
    Wizard wizard = new Wizard(executorService, accumulo, hadoop, zookeeper, tracker, environmentManager);
    sheet.addTab(wizard.getContent(), "Install");
    sheet.getTab(0).setId("AccumuloInstallTab");
    sheet.addTab(manager.getContent(), "Manage");
    sheet.getTab(1).setId("AccumuloManageTab");
    sheet.addSelectedTabChangeListener(new TabSheet.SelectedTabChangeListener() {
        @Override
        public void selectedTabChange(TabSheet.SelectedTabChangeEvent event) {
            TabSheet tabsheet = event.getTabSheet();
            String caption = tabsheet.getTab(event.getTabSheet().getSelectedTab()).getCaption();
            if (caption.equals("Manage")) {
                manager.refreshClustersInfo();
            }
        }
    });
    verticalLayout.addComponent(sheet);
    setCompositionRoot(verticalLayout);
    manager.refreshClustersInfo();
}

From source file:nl.kpmg.lcm.ui.view.metadata.MetadataEditWindow.java

License:Apache License

private void init() {
    Layout viewPanel = initViewPanel();//  www  . ja  v a 2  s. c  o m
    Layout rawPanel = initRawPanel();
    Layout adminPanel = initAdministrationPanel();

    TabSheet tabsheet = new TabSheet();
    tabsheet.addTab(viewPanel, "View");
    tabsheet.addTab(rawPanel, "Raw");
    tabsheet.addTab(adminPanel, "Administration");

    this.setWidth(PANEL_SIZE);
    this.setHeight(PANEL_HEIGHT);
    this.setModal(true);
    this.setContent(tabsheet);
}

From source file:org.apache.tamaya.ui.views.ConfigView.java

License:Apache License

public ConfigView() {
    Label caption = new Label("Raw Configuration");
    Label description = new Label(
            "This view shows the overall <b>raw</b> configuration configArea. Dependening on your access rights you"
                    + "may see partial or masked data. Similarly configuration can be <i>read-only</i> or <i>mutable</i>.",
            ContentMode.HTML);//from w  w w.  j a  va2 s  .  co m
    TabSheet tabPane = new TabSheet();
    tabPane.setHeight("100%");
    tabPane.setWidth("100%");
    tabPane.addTab(createConfigTab(), "Configuration");
    tabPane.addTab(createEnvTab(), "Environment Properties");
    tabPane.addTab(createSysPropsTab(), "System Properties");
    tabPane.addTab(createRuntimeTab(), "Runtime Properties");
    addComponents(caption, description, tabPane);
    caption.addStyleName(UIConstants.LABEL_HUGE);
    description.addStyleName(UIConstants.LABEL_LARGE);
}

From source file:org.asi.ui.custom.demo.ExtFilteringTableDemo.java

private void loadTables() {
    TabSheet tabsheet = new TabSheet();
    addComponent(tabsheet);/*w  w w.  j  ava2  s.  c o  m*/

    tabsheet.addTab(loadExtFilterTable(), "Ext Filter Table");
    tabsheet.addTab(loadFreezeFilterTreeTable(), "Freeze Filter Tree Table");
    tabsheet.addTab(loadPagedFilterTable(), "Paged Filter Table");
    tabsheet.addTab(loadFreezePagedFilterTable(), "Freeze Paged Filter Table");
}

From source file:org.azrul.langkuik.framework.webgui.BeanView.java

@Override
public void enter(final ViewChangeListener.ViewChangeEvent vcevent) {
    setCurrentView(vcevent.getViewName());
    //reset form/*from   w  w w.  j  ava  2 s .  co  m*/
    this.removeAllComponents();

    //determine user details
    UserDetails userDetails = null;
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    if (!(auth instanceof AnonymousAuthenticationToken)) {
        userDetails = (UserDetails) auth.getPrincipal();
    } else {
        return;
    }

    final Set<String> currentUserRoles = new HashSet<>();
    for (GrantedAuthority grantedAuth : userDetails.getAuthorities()) {
        currentUserRoles.add(grantedAuth.getAuthority());
    }

    //determine entity rights 
    EntityRight entityRight = null;

    EntityUserMap[] entityUserMaps = ((WebEntity) currentBean.getClass().getAnnotation(WebEntity.class))
            .userMap();
    for (EntityUserMap e : entityUserMaps) {
        if (currentUserRoles.contains(e.role()) || ("*").equals(e.role())) {
            entityRight = e.right();
            break;
        }
    }
    if (entityRight == null) { //if entityRight=EntityRight.NONE, still allow to go through because field level might be accessible
        //Not accessible
        return;
    }

    //create bean utils
    final BeanUtils beanUtils = new BeanUtils();

    //rebuild pageParameter.getBreadcrumb()
    BreadCrumbBuilder.buildBreadCrumb(vcevent.getNavigator(), pageParameter.getBreadcrumb(),
            pageParameter.getHistory());

    //rebuild components
    if (currentBean == null) {
        return;
    }

    //refresh current item
    C newBean = dao.refresh(currentBean);
    if (newBean != null) {
        currentBean = newBean;
    }

    final BeanFieldGroup fieldGroup = new BeanFieldGroup(currentBean.getClass());
    fieldGroup.setItemDataSource(currentBean);
    final FormLayout form = new FormLayout();
    Map<String, Map<Integer, FieldContainer>> groups = beanUtils.createGroupsFromBean(currentBean.getClass());

    //render form according to tab
    if (groups.size() == 1) {
        createForm(entityRight, currentUserRoles, groups, fieldGroup, pageParameter.getCustomTypeDaos(),
                vcevent.getNavigator(), form);
    } else {
        TabSheet tabSheet = new TabSheet();
        for (String group : groups.keySet()) {
            if (("All").equals(group)) {
                createForm(entityRight, currentUserRoles, groups, group, fieldGroup,
                        pageParameter.getCustomTypeDaos(), vcevent.getNavigator(), form);
            } else {
                FormLayout tab = new FormLayout();
                createForm(entityRight, currentUserRoles, groups, group, fieldGroup,
                        pageParameter.getCustomTypeDaos(), vcevent.getNavigator(), tab);
                tabSheet.addTab(tab, group);

            }
        }
        form.addComponent(tabSheet);
    }

    //Navigation and actions
    HorizontalLayout navButtons = new HorizontalLayout();
    navButtons.setSpacing(true);

    Button saveAndBackBtn = new Button("Save and back", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            try {
                fieldGroup.commit();
                currentBean = (C) fieldGroup.getItemDataSource().getBean();
                currentBean = saveBean(currentBean, parentBean, beanUtils, currentUserRoles);
                if (!pageParameter.getHistory().isEmpty()) {
                    String currentView = pageParameter.getHistory().pop().getViewHandle();
                    String lastView = pageParameter.getHistory().peek().getViewHandle();
                    vcevent.getNavigator().removeView(currentView);
                    vcevent.getNavigator().navigateTo(lastView);
                }
            } catch (FieldGroup.CommitException ex) {
                handleFieldsError(fieldGroup);
            }
        }

    });
    navButtons.addComponent(saveAndBackBtn);
    saveAndBackBtn.setId(saveAndBackBtn.getCaption());

    form.addComponent(navButtons);
    form.setMargin(new MarginInfo(true));
    this.addComponent(form);
}

From source file:org.dussan.vaadin.dcharts.test.DChartsTestUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();/*  ww  w.j  a v a2 s  .c om*/
    setContent(layout);
    Page.getCurrent().setTitle("dCharts Application");

    DCharts charts1 = chartsDemo1();
    DCharts charts2 = chartsDemo2();
    DCharts charts3_1 = chartsDemo3_1();
    DCharts charts3_2 = chartsDemo3_2();
    DCharts charts4 = chartsDemo4();
    DCharts charts5 = chartsDemo5();
    DCharts charts6 = chartsDemo6();
    DCharts charts7 = chartsDemo7();
    DCharts charts8 = chartsDemo8();

    HorizontalLayout layout3 = new HorizontalLayout();
    layout3.addComponent(charts3_1);
    layout3.addComponent(charts3_2);

    TabSheet demoTabSheet = new TabSheet();
    layout.addComponent(demoTabSheet);
    demoTabSheet.addTab(charts1, "Demo 1");
    demoTabSheet.addTab(charts2, "Demo 2");
    demoTabSheet.addTab(layout3, "Demo 3");
    demoTabSheet.addTab(charts4, "Demo 4");
    demoTabSheet.addTab(charts5, "Demo 5");
    demoTabSheet.addTab(charts6, "Demo 6");
    demoTabSheet.addTab(charts7, "Demo 7");
    demoTabSheet.addTab(charts8, "Demo 8");
}

From source file:org.eclipse.hawkbit.ui.rollout.rollout.AddUpdateRolloutWindowLayout.java

License:Open Source License

private TabSheet createGroupDefinitionTabs() {
    final TabSheet tabSheet = new TabSheet();
    tabSheet.setId(UIComponentIdProvider.ROLLOUT_GROUPS);
    tabSheet.setWidth(850, Unit.PIXELS);
    tabSheet.setHeight(300, Unit.PIXELS);
    tabSheet.setStyleName(SPUIStyleDefinitions.ROLLOUT_GROUPS);

    final TabSheet.Tab simpleTab = tabSheet.addTab(createSimpleGroupDefinitionTab(),
            i18n.getMessage("caption.rollout.tabs.simple"));
    simpleTab.setId(UIComponentIdProvider.ROLLOUT_SIMPLE_TAB);

    final TabSheet.Tab advancedTab = tabSheet.addTab(defineGroupsLayout,
            i18n.getMessage("caption.rollout.tabs.advanced"));
    advancedTab.setId(UIComponentIdProvider.ROLLOUT_ADVANCED_TAB);

    tabSheet.addSelectedTabChangeListener(event -> validateGroups());

    return tabSheet;
}

From source file:org.ikasan.dashboard.ui.topology.window.CategorisedErrorOccurrenceViewWindow.java

License:BSD License

protected Panel createErrorOccurrenceDetailsPanel() {
    Panel errorOccurrenceDetailsPanel = new Panel();

    GridLayout layout = new GridLayout(4, 7);
    layout.setWidth("100%");
    layout.setSpacing(true);/*from  ww w  . j  a va  2 s.  c om*/
    layout.setColumnExpandRatio(0, .10f);
    layout.setColumnExpandRatio(1, .30f);
    layout.setColumnExpandRatio(2, .05f);
    layout.setColumnExpandRatio(3, .30f);

    Label errorOccurrenceDetailsLabel = new Label(" Categorised Error Occurence Details", ContentMode.HTML);
    Label errorCategoryLabel = new Label();

    if (categorisedErrorOccurrence.getErrorCategorisation().getErrorCategory()
            .equals(ErrorCategorisation.BLOCKER)) {
        errorOccurrenceDetailsLabel = new Label(
                VaadinIcons.BAN.getHtml() + " Categorised Error Occurence Details", ContentMode.HTML);
        errorCategoryLabel = new Label(VaadinIcons.BAN.getHtml() + " Blocker", ContentMode.HTML);
    } else if (categorisedErrorOccurrence.getErrorCategorisation().getErrorCategory()
            .equals(ErrorCategorisation.CRITICAL)) {
        errorOccurrenceDetailsLabel = new Label(
                VaadinIcons.EXCLAMATION.getHtml() + " Categorised Error Occurence Details", ContentMode.HTML);
        errorCategoryLabel = new Label(VaadinIcons.EXCLAMATION.getHtml() + " Critical", ContentMode.HTML);
    } else if (categorisedErrorOccurrence.getErrorCategorisation().getErrorCategory()
            .equals(ErrorCategorisation.MAJOR)) {
        errorOccurrenceDetailsLabel = new Label(
                VaadinIcons.ARROW_UP.getHtml() + " Categorised Error Occurence Details", ContentMode.HTML);
        errorCategoryLabel = new Label(VaadinIcons.ARROW_UP.getHtml() + " Major", ContentMode.HTML);
    } else if (categorisedErrorOccurrence.getErrorCategorisation().getErrorCategory()
            .equals(ErrorCategorisation.TRIVIAL)) {
        errorOccurrenceDetailsLabel = new Label(
                VaadinIcons.ARROW_DOWN.getHtml() + " Categorised Error Occurence Details", ContentMode.HTML);
        errorCategoryLabel = new Label(VaadinIcons.ARROW_DOWN.getHtml() + " Trivial", ContentMode.HTML);
    }

    errorOccurrenceDetailsLabel.setStyleName(ValoTheme.LABEL_HUGE);
    layout.addComponent(errorOccurrenceDetailsLabel, 0, 0, 3, 0);

    Label label = new Label("Module Name:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 1);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf1 = new TextField();
    tf1.setValue(this.categorisedErrorOccurrence.getErrorOccurrence().getModuleName());
    tf1.setReadOnly(true);
    tf1.setWidth("80%");
    layout.addComponent(tf1, 1, 1);

    label = new Label("Flow Name:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 2);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf2 = new TextField();
    tf2.setValue(this.categorisedErrorOccurrence.getErrorOccurrence().getFlowName());
    tf2.setReadOnly(true);
    tf2.setWidth("80%");
    layout.addComponent(tf2, 1, 2);

    label = new Label("Component Name:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 3);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf3 = new TextField();
    tf3.setValue(this.categorisedErrorOccurrence.getErrorOccurrence().getFlowElementName());
    tf3.setReadOnly(true);
    tf3.setWidth("80%");
    layout.addComponent(tf3, 1, 3);

    label = new Label("Date/Time:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 4);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf4 = new TextField();
    tf4.setValue(new Date(this.categorisedErrorOccurrence.getErrorOccurrence().getTimestamp()).toString());
    tf4.setReadOnly(true);
    tf4.setWidth("80%");
    layout.addComponent(tf4, 1, 4);

    GridLayout wrapperLayout = new GridLayout(1, 4);
    wrapperLayout.setMargin(true);
    wrapperLayout.setWidth("100%");

    Label errorMessageLabel = new Label("Error Message:");
    errorMessageLabel.setSizeUndefined();
    layout.addComponent(errorMessageLabel, 0, 5);
    layout.setComponentAlignment(errorMessageLabel, Alignment.TOP_RIGHT);

    final TextArea errorMessageTextArea = new TextArea();
    errorMessageTextArea.setWidth("650px");
    errorMessageTextArea.setRows(6);
    errorMessageTextArea
            .setValue(this.categorisedErrorOccurrence.getErrorCategorisation().getErrorDescription());

    layout.addComponent(errorMessageTextArea, 1, 5, 3, 5);

    AceEditor editor = new AceEditor();
    editor.setCaption("Error Details");
    editor.setValue(this.categorisedErrorOccurrence.getErrorOccurrence().getErrorDetail());
    editor.setReadOnly(true);
    editor.setMode(AceMode.xml);
    editor.setTheme(AceTheme.eclipse);
    editor.setHeight(470, Unit.PIXELS);
    editor.setWidth("100%");

    label = new Label("Error Category:");
    label.setSizeUndefined();
    layout.addComponent(label, 2, 1);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    layout.addComponent(errorCategoryLabel, 3, 1);
    layout.setComponentAlignment(errorCategoryLabel, Alignment.MIDDLE_LEFT);

    label = new Label("System Action:");
    label.setSizeUndefined();
    layout.addComponent(label, 2, 2);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField systemAction = new TextField();
    systemAction.setValue(this.categorisedErrorOccurrence.getErrorOccurrence().getAction());
    systemAction.setReadOnly(true);
    systemAction.setWidth("80%");
    layout.addComponent(systemAction, 3, 2);

    label = new Label("User Action:");
    label.setSizeUndefined();
    layout.addComponent(label, 2, 3);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField userAction = new TextField();
    userAction.setValue("");
    userAction.setReadOnly(true);
    userAction.setWidth("80%");
    layout.addComponent(userAction, 3, 3);

    label = new Label("User Action By:");
    label.setSizeUndefined();
    layout.addComponent(label, 2, 4);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    Label userActionBy = new Label();
    userActionBy.setValue("");
    userActionBy.setReadOnly(true);
    userActionBy.setWidth("80%");
    layout.addComponent(userActionBy, 3, 4);

    AceEditor eventEditor = new AceEditor();
    eventEditor.setCaption("Event Payload");

    if (this.categorisedErrorOccurrence.getErrorOccurrence().getEvent() != null) {
        eventEditor
                .setValue(new String((byte[]) this.categorisedErrorOccurrence.getErrorOccurrence().getEvent()));
    }

    eventEditor.setReadOnly(true);
    eventEditor.setMode(AceMode.java);
    eventEditor.setTheme(AceTheme.eclipse);
    eventEditor.setHeight(470, Unit.PIXELS);
    eventEditor.setWidth("100%");

    HorizontalLayout formLayout = new HorizontalLayout();
    formLayout.setWidth("100%");
    formLayout.setHeight(300, Unit.PIXELS);
    formLayout.addComponent(layout);
    wrapperLayout.addComponent(formLayout, 0, 0);

    //      VerticalSplitPanel vSplitPanel = new VerticalSplitPanel();
    //      vSplitPanel.setWidth("100%");
    //      vSplitPanel.setHeight(800, Unit.PIXELS);
    //      vSplitPanel.addStyleName(ValoTheme.SPLITPANEL_LARGE);

    TabSheet tabsheet = new TabSheet();
    tabsheet.setSizeFull();

    HorizontalLayout h1 = new HorizontalLayout();
    h1.setSizeFull();
    h1.setMargin(true);
    h1.addComponent(eventEditor);
    //      vSplitPanel.setFirstComponent(h1);

    HorizontalLayout h2 = new HorizontalLayout();
    h2.setSizeFull();
    h2.setMargin(true);
    h2.addComponent(editor);
    //      vSplitPanel.setSecondComponent(h2);

    tabsheet.addTab(h2, "Error Details");
    tabsheet.addTab(h1, "Event Payload");

    wrapperLayout.addComponent(tabsheet, 0, 1);

    //      wrapperLayout.addComponent(vSplitPanel, 0, 1);

    errorOccurrenceDetailsPanel.setContent(wrapperLayout);
    return errorOccurrenceDetailsPanel;
}