Change themes in Vaadin 7 via code

2020-06-03 07:56发布

I am doing a project in Vaadin 7. In that I need to change the theme of a page.

In Vaadin 6, there is a function called 'setTheme()'. so that I can change the theme using that function wherever I want in my code.

But, In Vaadin 7, I couldn't find any like that.

I know there will be a way to do it.

And also how to apply changes on the UI when I change a theme?

Will it be changed automatically? (or)

ICEPush gonna help me?

标签: themes vaadin
7条回答
Summer. ? 凉城
2楼-- · 2020-06-03 08:59

Regarding themes for charts: simply have a switch somewhere inside a listener of either a ComboBox or an OptionGroup (for radio buttons) to make a the following ChartOptions static method call, e.g.:

ChartOptions.get().setTheme(new VaadinTheme())

then

ChartOptions.get().setTheme(new SkiesTheme())

etc.

there's also GridTheme(); GrayTheme() and HighChartsDefaultTheme(); you can even extend the base theme to create your own theme (look that up in the Book of Vaadin).

查看更多
登录 后发表回答