Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » More on CSS Theming(How to programmatically change themeId?)
More on CSS Theming [message #903660] Fri, 24 August 2012 18:38 Go to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
Hi,

I have one entry point (org.eclipse.core.runtime.applications), two themes that are registered under "org.eclipse.rap.ui.themes", and one branding that is registered under "org.eclipse.rap.ui.branding". The branding maps to one of the themes. Is it possible to allow users to switch between the two themes in the UI, thus, programmatically change the themeId from one to the other?

Thanks,
Ronald
Re: More on CSS Theming [message #905031 is a reply to message #903660] Wed, 29 August 2012 15:11 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi.

> branding maps to one of the themes. Is it possible to allow users to
> switch between the two themes in the UI, thus, programmatically change
> the themeId from one to the other?
>

All theming values are sent to the client (browser) when the session
starts. There is currently no way to load new ones later on, so changing
anything in theming would require at least a reload. What you could do
is to use two brandings with one entry point, then change the URL
programatically to start a new session with the other branding, e.g.:

JSExecutor.executeJS( "location.href=\"" + url + "\";" );

I think thats the best you can get right now.

Greetings,
Tim

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: More on CSS Theming [message #908659 is a reply to message #905031] Wed, 05 September 2012 18:49 Go to previous messageGo to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
Thanks Tim. I understand this is how RAP works, but it does lack what CSS can do, which is changing styles on the fly without restarting the application. Are there any suggestions that can improve this behavior? Imagine that we have two CSS files, and we let users to click on a menu and select the CSS file they want to use.

Thanks again.
Re: More on CSS Theming [message #909030 is a reply to message #908659] Thu, 06 September 2012 12:42 Go to previous message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi.

Am 05.09.2012 20:49, schrieb Ronald So:
> Thanks Tim. I understand this is how RAP works, but it does lack what
> CSS can do, which is changing styles on the fly without restarting the
> application. Are there any suggestions that can improve this behavior?

Not sure what you mean by that. If you change a css-file for an
html-document, you need to reload it. If you change a css-file in RAP,
you need to restart the RAP Application. If you want to exchange/switch
a css-file (by switching branding), you only need restart the RAP session.

> Imagine that we have two CSS files, and we let users to click on a menu
> and select the CSS file they want to use.

I think what i described should make that possible. Basically let them
switch between brandings. You can't do it without restarting the session
of course.

Greetings,
Tim

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:[ANN] RAP 2.0 M1 published
Next Topic:run error to org.eclipse.rap.nebula.widgets.grid.snippets
Goto Forum:
  


Current Time: Wed Apr 24 22:13:48 GMT 2024

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

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

Back to the top