Skip to main content



      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 10:44 Go to next message
Eclipse UserFriend
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 11:26] by Moderator

Re: multiple custom themes extending from default theme [message #1822259 is a reply to message #1822253] Mon, 02 March 2020 11:21 Go to previous message
Eclipse UserFriend
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 11:26] by 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: Tue May 13 16:49:37 EDT 2025

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

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

Back to the top