Example usage for com.vaadin.ui CustomLayout CustomLayout

List of usage examples for com.vaadin.ui CustomLayout CustomLayout

Introduction

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

Prototype

public CustomLayout(String template) 

Source Link

Document

Constructor for custom layout with given template name.

Usage

From source file:org.opennms.features.vaadin.nodemaps.internal.NodeMapsApplication.java

License:Open Source License

private void addHeader() {
    if (m_headerProvider != null) {
        try {/*  w  w w . ja  v a2s .  c  om*/
            URL pageUrl = Page.getCurrent().getLocation().toURL();
            setHeaderHtml(m_headerProvider.getHeaderHtml(new HttpServletRequestVaadinImpl(m_request, pageUrl)));
        } catch (final Exception e) {
            LOG.error("failed to get header HTML for request " + m_request.getPathInfo(), e.getCause());
        }
    }
    if (m_headerHtml != null) {
        InputStream is = null;
        try {
            is = new ByteArrayInputStream(m_headerHtml.getBytes());
            final CustomLayout headerLayout = new CustomLayout(is);
            headerLayout.setWidth("100%");
            headerLayout.addStyleName("onmsheader");
            m_rootLayout.addComponent(headerLayout);
        } catch (final IOException e) {
            closeQuietly(is);
            LOG.debug("failed to get header layout data", e);
        }
    }
}