Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » How to customize the Rayo Look&Feel?
How to customize the Rayo Look&Feel? [message #1058999] Thu, 16 May 2013 03:40 Go to next message
André Lohrenz is currently offline André Lohrenz
Messages: 4
Registered: March 2013
Junior Member
I would like to experiment with some modifications to the Rayo Look & Feel in our project. In [1] it says, "Rayo is a skinnable Look and Feel that can be configured in an XML property file." Is there any further or more detailed information available on how and where to do that?

I am specifically interested in setting a custom color for the background of selected text. From some debugging, I found that the color being used for this would probably be javax.swing.plaf.ColorUIResource[r=229,g=243,b=254] (a JTextFieldEx seems to be created with this color set in selectionColor), but I had no luck in finding the place where this is being set.

Is there a central place (like the XML property file mentioned above) where these aspects can be configured? Or even if there is no central place, where are colors and the like set for the indiviual components? I'm not that familiar with Swing look & feel development, so I might be missing some central or obvious point here.

Thanks in advance!

[1] http://wiki.eclipse.org/Scout/Tutorial/3.8/Rayo_Look_and_Feel
Re: How to customize the Rayo Look&Feel? [message #1059062 is a reply to message #1058999] Thu, 16 May 2013 09:32 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 628
Registered: October 2011
Senior Member
All look and feel classes overwrite:
javax.swing.plaf.basic.BasicLookAndFeel
(have a look at the class hierarchy)

Have also a look at the Java Tutorial:
Modifying the Look and Feel
This will give you some inputs on how Swing Laf is working.

In Scout we have an additional wrapper/convinience class to install Look and Feel easily:
org.eclipse.scout.rt.ui.swing.ILookAndFeelProvider
The Javadoc on this interface explain how you can use it.

You can also have a look at the code:
org.eclipse.scout.rt.ui.swing.inject.InitLookAndFeelInjector


At the end you will see, that the Laf is initialize in the Swing Environment:
org.eclipse.scout.rt.ui.swing.AbstractSwingEnvironment.initLookAndFeel(Properties)

(You have a SwingEnvironment extending AbstractSwingEnvironment in your application)

Re: How to customize the Rayo Look&Feel? [message #1059727 is a reply to message #1059062] Tue, 21 May 2013 08:20 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 628
Registered: October 2011
Senior Member
I do not know if you have continued your investigations. I just spoke with a project that have fork and extended Rayo in order to be able to "inject" another XML. This was not feasible with the current Rayo implementation. They added an additional extension point to provide a custom XML.

If you have interest, we could extend the current Rayo implementation with the modifications of this project, in order to do some Laf modification at XML level.

Let me know.
Re: How to customize the Rayo Look&Feel? [message #1059792 is a reply to message #1059727] Tue, 21 May 2013 11:37 Go to previous messageGo to next message
André Lohrenz is currently offline André Lohrenz
Messages: 4
Registered: March 2013
Junior Member
Hi Jérémie,

sorry, I didn't find the time to post back my experiences until now. I had a look at the code pieces you pointed out and had the same impression as well - that overriding certain single aspects of the look and feel is not that simple. I found the xml-file that holds the UI color values, but I did not yet find the place where they are being assigned or stored so that I could hook in there.

Generally I would prefer to have a solution that would not need a new version of the Rayo plugins. So is there really no way to customize the selection color alone, say in SwingEnvironment or SwingApplication? We already override those, and given that we currently don't need to change anything else than the text selection color, I find replacing the whole UI xml-file a bit overengineered.

That being said, if there is no other way I thankfully accept your offer to adapt the Rayo look and feel, so that the injection of a custom xml-file would be possible. I suppose that would be a valuable contribution in any case, to really honor the "that can be configured in an XML property file" part in the wiki. Wink

We are using Scout 3.8.2, and the according Rayo plugins and fragments.

Thanks again!
Re: How to customize the Rayo Look&Feel? [message #1059796 is a reply to message #1059792] Tue, 21 May 2013 11:59 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 628
Registered: October 2011
Senior Member
From what I understood, it is not feasible at the moment (without modifying Rayo to provide access to the XML).

I think it is possible to obtain a new version of Rayo that will still be compatible with 3.8.2 but I need to get confirmation.

I changed the sentence in the wiki: instead of "can be configured in an XML property file". There is now "is configured with an XML property file". (I could have added: "internal XML").
Re: How to customize the Rayo Look&Feel? [message #1059802 is a reply to message #1059796] Tue, 21 May 2013 12:23 Go to previous message
André Lohrenz is currently offline André Lohrenz
Messages: 4
Registered: March 2013
Junior Member
I feared as much. Then I will gladly go with the fix in Rayo itself. Smile

I opened up a Bugzilla ticket for this issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=408611

Thanks for your advice.
Previous Topic:Tabs at bottom instead of top
Next Topic:[Help] How to run external application same time as server runnig
Goto Forum:
  


Current Time: Thu Jul 24 21:42:28 EDT 2014

Powered by FUDForum. Page generated in 0.03519 seconds