Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » multiple custom themes extending from default theme
multiple custom themes extending from default theme [message #1822253] Mon, 02 March 2020 15:44 Go to next message
Karl Mehltretter is currently offline Karl MehltretterFriend
Messages: 9
Registered: May 2016
Junior Member
I want to create multiple custom themes, each extending the default css scheme for my application, so different entry points can use different themes.

The following works, but it is using internal details (DEFAULT_THEME_CSS, ThemeManager internal API class).

final String DEFAULT_THEME_CSS = "resource/theme/default.css";
// create theme1
application.addStyleSheet("theme1_id", DEFAULT_THEME_CSS, ThemeManager.STANDARD_RESOURCE_LOADER);
application.addStyleSheet("theme1_id", "mytheme1.css");
// create theme2
application.addStyleSheet("theme2_id", DEFAULT_THEME_CSS, ThemeManager.STANDARD_RESOURCE_LOADER);
application.addStyleSheet("theme2_id", "mytheme2.css");


Best Regards,
Karl

[Updated on: Mon, 02 March 2020 16:26]

Report message to a moderator

Re: multiple custom themes extending from default theme [message #1822259 is a reply to message #1822253] Mon, 02 March 2020 16:21 Go to previous message
Karl Mehltretter is currently offline Karl MehltretterFriend
Messages: 9
Registered: May 2016
Junior Member
I've now decided to use my "own" ResourceLoader, based on RWT class. This at least removes the warning about internal API access.

private static final String RWT_DEFAULT_THEME = "resource/theme/default.css";
public static final ResourceLoader RWT_RESOURCE_LOADER = new ResourceLoader() {
		ClassLoader classLoader = RWT.class.getClassLoader();

		@Override
		public InputStream getResourceAsStream(String resourceName) throws IOException {
			return classLoader.getResourceAsStream(resourceName);
		}
	};

	[..]
// create theme1
application.addStyleSheet("theme1_id", RWT_DEFAULT_THEME,  RWT_RESOURCE_LOADER);
application.addStyleSheet("theme1_id", "mytheme1.css");
// create theme2
application.addStyleSheet("theme2_id", RWT_DEFAULT_THEME,  RWT_RESOURCE_LOADER);
application.addStyleSheet("theme2_id", "mytheme2.css");
}
]

[Updated on: Mon, 02 March 2020 16:26]

Report message to a moderator

Previous Topic:Is there a way to register a global service handler without a UIThread?
Next Topic:LabelProvider called even for invisible GridColumns
Goto Forum:
  


Current Time: Fri Sep 17 11:13:12 GMT 2021

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

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

Back to the top