Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 11:25
Reiner Wahnsinn is currently offline Reiner WahnsinnFriend
Messages: 1
Registered: December 2019
Junior Member
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: Mon Jun 17 07:19:44 GMT 2024

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

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

Back to the top