Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Switching Themes in E3 mode
Switching Themes in E3 mode [message #1015976] Mon, 04 March 2013 13:04 Go to next message
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 183
Registered: January 2013
Senior Member
Hi,

We are currently developing a e4 RCP that can dynamically switch themes. But it might happen that we have to use 3.x views. So I edited the project in a way that allows starting it as an e3 or an e4 RCP (by renaming the plugin.xml). I used this tutorial as a base: http://dirksmetric.wordpress.com/2012/08/01/tutorial-eclipse-rcp-e4-with-3-x-views-like-project-explorer-properties-etc/.
Running it as an e3 RCP works out quite well, but switching css files doesn't work anymore. The handler code looks like this:
@Execute
	public void execute(
			IThemeEngine engine,
			@Named("styleParam") String param) {

		if (param.equals(TEST) && !engine.getActiveTheme().getId().equals(TEST)) {
			engine.setTheme(TEST, true);
		} else if (param.equals(DEFAULT)
				&& !engine.getActiveTheme().getId().equals(DEFAULT)) {
			engine.setTheme(DEFAULT, true);
		}
	}

This code works under e4, but the handler isn't invoked in e3, since it seems to have problems with the IThemeEngine.

Is it possible to change themes dynamically, if I start the RCP as an e3 RCP?

Best regards
Bastian
Re: Switching Themes in E3 mode [message #1015995 is a reply to message #1015976] Mon, 04 March 2013 14:32 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
So I edited the project in a way that allows starting it as an e3 or an e4 RCP


I don't understand what you are trying to tell us with that. Usually the answer would be that Eclipse 4 features like CSS styling won't work in a pure Eclipse 3 application. Unless you make it possible.

You can find several blog posts about that. But I'm not quite sure if they still fit as they are a few years old (e.g. http://www.toedter.com/blog/?p=295 )
Re: Switching Themes in E3 mode [message #1016002 is a reply to message #1015995] Mon, 04 March 2013 15:02 Go to previous message
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 183
Registered: January 2013
Senior Member
Hi,

That should just mean, the project includes two plugin.xml files. Depending on which one you start it either runs as an e3 or an e4 plugin. But this isn't that much important Smile

I thought the IThemeEngine could work as well as the rest of the e4 content does, since the usage of a CSS file itself works like it did, when I ran it as an e4 RCP.

But I'll try to solve it in a different way.
Thanks
Bastian
Previous Topic:Core expressions in compatibility mode
Next Topic:AbstractCSSEngine MalFormedURLException in a deployed RCP product
Goto Forum:
  


Current Time: Thu Mar 28 19:49:46 GMT 2024

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

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

Back to the top