Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » CTabFolder/CTabItem: Wrong font on CSS theme switch
CTabFolder/CTabItem: Wrong font on CSS theme switch [message #1818367] Fri, 13 December 2019 06:25
Eclipse UserFriend
Hello,

I try to switch (at runtime) between two css themes which I defined in extensions.
To do this, I use below code snippet:
final String themeId = ...;
final String currentThemeId = ThemeUtil.getCurrentThemeId();
if (!currentThemeId.equals(themeId)) {
	final String[] availableThemeIds = ThemeUtil.getAvailableThemeIds();
	final String newTheme = Arrays
			.stream(availableThemeIds)
			.filter(availableTheme -> availableTheme.equals(themeId))
			.findAny()
			.orElse("com.example.ui.mythemes.default");

	ThemeUtil.setCurrentThemeId(RWT.getUISession(), newTheme);
}


But after reload, some ui components, like CTabFolder/CTabItem, ignores the new theme and continue to use the defaut font.
I found out that change from 'CTabItem.this.font' to 'getFont()' in CTabItem.java in getAdapter works for me but I'm not sure about that.

I know, use the ThemeUtil is not the best solution (because of internal and not api) but I don't know another way of solving the problem.

Is there neat solution? Or is not proposed that you can switch between css themes in RAP at runtime?

RAP 3.10
Previous Topic:RAP GEF endless redraw, no UI Access..
Next Topic:Is it possible to attach listeners to client objects?
Goto Forum:
  


Current Time: Wed Apr 23 07:58:27 EDT 2025

Powered by FUDForum. Page generated in 0.02714 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top