Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » switching css themes with e(fx)clipse
switching css themes with e(fx)clipse [message #1487143] Tue, 25 November 2014 15:52 Go to next message
Frank Benischek is currently offline Frank BenischekFriend
Messages: 2
Registered: November 2014
Junior Member
Hello everybody,

i've tried to extend my "e4+javaFX" demo app with the ability to switch the css theme at runtime.

I was following the tutorial at "www.vogella.com/tutorials/Eclipse4CSS/article.html#tutorial_cssstyling" but in the final this won't work, because my app has a "e(fx)clipse Target Platform" and therefore doesn't know the bundle "org.eclipse.e4.ui.css.swt.theme" and so the classes and interfaces like "IThemeEngine" will be unknown. The according jar file is presend within the eclipse plugin folder: org.eclipse.e4.ui.css.swt.theme_0.9.300.v20140424-2042.jar

Switching the target platform back to "default" will resolve the "IThemeEngine" problem but will create others because of the missing e(fx)clipse bundles.

In a second attempt i tried using "org.eclipse.fx.ui.theme.internal.DefaultThemeManager" (from e(fx)clipse??) but this doesn't work either.

Anybody has a hint to get this working? I wasn't able to find any tutorial on this problem.

Thanks in advance
Frank
Re: switching css themes with e(fx)clipse [message #1487418 is a reply to message #1487143] Tue, 25 November 2014 21:00 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

The CSS-Styling from e4+SWT does not really help you on e4+JavaFX
because as you already found out:
* the extension point is different
* the classes are different

The API you are looking for is
*org.eclipse.fx.ui.services.theme.ThemeManager* and the extension point
is *org.eclipse.fx.ui.theme*

Usage in a handler should as simple as:

@Execute
public void switch(ThemeManager manager) {
manager.setCurrentThemeId("dark");
}

Tom

On 25.11.14 20:49, Frank Benischek wrote:
> Hello everybody,
>
> i've tried to extend my "e4+javaFX" demo app with the ability to switch
> the css theme at runtime.
>
> I was following the tutorial at
> "www.vogella.com/tutorials/Eclipse4CSS/article.html#tutorial_cssstyling"
> but in the final this won't work, because my app has a "e(fx)clipse
> Target Platform" and therefore doesn't know the bundle
> "org.eclipse.e4.ui.css.swt.theme" and so the classes and interfaces like
> "IThemeEngine" will be unknown. The according jar file is presend within
> the eclipse plugin folder:
> org.eclipse.e4.ui.css.swt.theme_0.9.300.v20140424-2042.jar
>
> Switching the target platform back to "default" will resolve the
> "IThemeEngine" problem but will create others because of the missing
> e(fx)clipse bundles.
>
> In a second attempt i tried using
> "org.eclipse.fx.ui.theme.internal.DefaultThemeManager" (from
> e(fx)clipse??) but this doesn't work either.
>
> Anybody has a hint to get this working? I wasn't able to find any
> tutorial on this problem.
>
> Thanks in advance
> Frank
Re: switching css themes with e(fx)clipse [message #1488408 is a reply to message #1487418] Wed, 26 November 2014 15:26 Go to previous message
Frank Benischek is currently offline Frank BenischekFriend
Messages: 2
Registered: November 2014
Junior Member
Hello Tom,

with your hint it worked like a charm. Thank you.

Frank
Previous Topic:Launch several JavaFX window from Eclipse IDE
Next Topic:dependency on org.apache.commons.lang.text
Goto Forum:
  


Current Time: Thu Apr 25 20:21:46 GMT 2024

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

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

Back to the top