use of com.vaadin.ui.CustomLayout in project opennms by OpenNMS.
the class SimpleIframeInVaadinApplication method addHeader.
private void addHeader(VaadinRequest request) {
if (m_headerProvider != null) {
try {
setHeaderHtml(m_headerProvider.getHeaderHtml(((VaadinServletRequest) request).getHttpServletRequest()));
} catch (final Exception e) {
LOG.error("failed to get header HTML for request " + 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);
}
}
}
use of com.vaadin.ui.CustomLayout in project opennms by OpenNMS.
the class NodeMapsApplication method addHeader.
private void addHeader() {
if (m_headerProvider != null) {
try {
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);
}
}
}
use of com.vaadin.ui.CustomLayout in project opennms by OpenNMS.
the class PluginManagerAdminApplication method addHeader.
private void addHeader(VaadinRequest request) {
if (m_headerProvider != null) {
try {
setHeaderHtml(m_headerProvider.getHeaderHtml(((VaadinServletRequest) request).getHttpServletRequest()));
} catch (final Exception e) {
LOG.error("failed to get header HTML for request " + 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);
}
}
}
use of com.vaadin.ui.CustomLayout in project opennms by OpenNMS.
the class TopologyUI method addHeader.
private void addHeader() {
if (m_headerHtml != null && m_showHeader) {
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) {
try {
is.close();
} catch (final IOException closeE) {
LOG.debug("failed to close HTML input stream", closeE);
}
LOG.debug("failed to get header layout data", e);
}
}
}
Aggregations