com.vaadin.ui.UI.getTheme()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(77)

本文整理了Java中com.vaadin.ui.UI.getTheme()方法的一些代码示例,展示了UI.getTheme()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UI.getTheme()方法的具体详情如下:
包路径:com.vaadin.ui.UI
类名称:UI
方法名:getTheme

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);
  }
}

相关文章