本文整理了Java中com.vaadin.ui.UI.getTheme()
方法的一些代码示例,展示了UI.getTheme()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UI.getTheme()
方法的具体详情如下:
包路径:com.vaadin.ui.UI
类名称:UI
方法名:getTheme
[英]Gets the theme currently in use by this UI.
[中]获取此UI当前使用的主题。
代码示例来源:origin: com.vaadin/vaadin-server
try {
is = ui.getSession().getService().getThemeResourceAsStream(ui,
ui.getTheme(), resource);
} catch (final Exception e) {
代码示例来源:origin: eclipse/hawkbit
private void addFooter(final VerticalLayout rootLayout) {
final Resource resource = context
.getResource("classpath:/VAADIN/themes/" + UI.getCurrent().getTheme() + "/layouts/footer.html");
try (final InputStream resourceStream = resource.getInputStream()) {
final CustomLayout customLayout = new CustomLayout(resourceStream);
customLayout.setSizeUndefined();
rootLayout.addComponent(customLayout);
rootLayout.setComponentAlignment(customLayout, Alignment.BOTTOM_LEFT);
} catch (final IOException ex) {
LOG.error("Footer file cannot be loaded", ex);
}
}
代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui
private void addFooter(final VerticalLayout rootLayout) {
final Resource resource = context
.getResource("classpath:/VAADIN/themes/" + UI.getCurrent().getTheme() + "/layouts/footer.html");
try (final InputStream resourceStream = resource.getInputStream()) {
final CustomLayout customLayout = new CustomLayout(resourceStream);
customLayout.setSizeUndefined();
rootLayout.addComponent(customLayout);
rootLayout.setComponentAlignment(customLayout, Alignment.BOTTOM_LEFT);
} catch (final IOException ex) {
LOG.error("Footer file cannot be loaded", ex);
}
}
内容来源于网络,如有侵权,请联系作者删除!