|What is the correct to set a CSS selector on a subclass [message #1061494]
||Fri, 31 May 2013 22:25
| Corby James
Registered: May 2013
I'm trying to set the font on a eclipse ui forms widget - Section - which inherits from ExpandableComposite, which is a widget that supports custom theme-ing.|
Can this be done and if so, how so I set CSS selector for it in my code?
I'm currently doing the following in code:
Section section = new Section(composite, style );
In the CSS, I tried
all to no avail.
Thanks for any help.
|Re: What is the correct to set a CSS selector on a subclass [message #1064011 is a reply to message #1063957]
||Mon, 17 June 2013 05:17
| Ivan Furnadjiev
Registered: July 2009
I looked at the Section code the there is a textLabel (Label/Hyperlink
widget) responsible for the text. To change the font of this textLabel
you have to set the custom variant on that widget. Unfortunately, this
internal textLabel control is not accessible (it is protected and can be
accessed by subclasses). A style sheet like:
font: 18px Arial, sans-serif;
should work if you manage to set the custom variant on
Section#textLabel. Don't forget that the property set by the code
overrides the property set by the theming. In other word - Section sets
the font by code automatically. If you want your theme value, you have
to reset the font to null manually first - section.setFont( null );.
From my point of view it will be easier in your case to set your
desired font programmatically and not by the theming.
On 6/16/2013 9:20 PM, Corby James wrote:
> Tried using the composite for the selector and its not firing. I'm
> calling the setData method on the section in the sub-class. Will that
> cause any issues?
Professional services for RAP and RCP?
Powered by FUDForum
. Page generated in 0.01668 seconds