Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Using tags as class selectors
Using tags as class selectors [message #1435355] Wed, 01 October 2014 11:27 Go to next message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
Hello,

According to the RCP book, the CSS engine should be able to recognize user-defined tags in the application model and treat them as class-selectors.

However, when I tag all my Parts with "teststyle" and set up my css-file like this :

.teststyle
{
	-fx-background-color: red ;
}


nothing happens. Wat does work, are predefined tags, like the following :

.MPart
{
	-fx-background-color: red ;
}


Do I have to do something different for referring to this user-defined tags ... ?

Little subsidiary question : on the main page of the Efxclips-project, there's a mention about LESS-support. I've done a search on the wiki, but found no additionnal information about this feature. I tried some LESS-syntax in the CSS-editor but without success. So my question is : what does the LESS-support entail ?
Re: Using tags as class selectors [message #1435381 is a reply to message #1435355] Wed, 01 October 2014 12:17 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On 01.10.14 04:27, Thomas Elskens wrote:
> Hello,
>
> According to the RCP book, the CSS engine should be able to recognize
> user-defined tags in the application model and treat them as
> class-selectors.

yes

> However, when I tag all my Parts with "teststyle" and set up my css-file
> like this :
>
>
> teststyle
> {
> -fx-background-color: red ;
> }
>

Well your selector is wrong - a tag is a class selector ".teststyle" and
NOT a element selector "teststyle"

>
> nothing happens. Wat does work, are predefined tags, like the following :
>
>
> MPart
> {
> -fx-background-color: red ;
> }
>
>
> Do I have to do something different for referring to this user-defined
> tags ... ?
>
> Little subsidiary question : on the main page of the Efxclips-project,
> there's a mention about LESS-support. I've done a search on the wiki,
> but found no additionnal information about this feature. I tried some
> LESS-syntax in the CSS-editor but without success. So my question is :
> what does the LESS-support entail ?
>

We don't provide LESS support in the basic toolkit nor does the
CSS-Editor is understanding LESS.

What we have as part of http://efxclipse.bestsolution.at/ is LESS
support at runtime but this was more of an experiment - but this less
stuff does not integrate into e4 on FX.

Tom
Re: Using tags as class selectors [message #1435395 is a reply to message #1435381] Wed, 01 October 2014 12:35 Go to previous messageGo to next message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
Hi,

The quotation marks ">" shopped off my class-selector, but the dot is present in both .MPart and .teststyle (the dots are there in the original message)...

Thanks for the clarification on LESS, I was not really clear to me.
Re: Using tags as class selectors [message #1435420 is a reply to message #1435395] Wed, 01 October 2014 13:09 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Oh - now I remember what we did [1] - to avoid doing too much CSS
applying we are only applying tags who start with "efx_styleclass:"
because without that we'd put too much load on the CSS-Engine because
we'd apply styles whenever a none styling tag changes!

So please use the Tag: efx_styleclass:teststyle and to get a
CSS-Selector of .teststyle

Tom

[1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=440434

On 01.10.14 05:35, Thomas Elskens wrote:
> Hi,
>
> The quotation marks ">" shopped off my class-selector, but the dot is
> present in both .MPart and .teststyle (the dots are there in the
> original message)...
>
> Thanks for the clarification on LESS, I was not really clear to me.
Re: Using tags as class selectors [message #1435431 is a reply to message #1435420] Wed, 01 October 2014 13:28 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
.... and of course we should document it at the wiki.

Tom

On 01.10.14 06:09, Tom Schindl wrote:
> Oh - now I remember what we did [1] - to avoid doing too much CSS
> applying we are only applying tags who start with "efx_styleclass:"
> because without that we'd put too much load on the CSS-Engine because
> we'd apply styles whenever a none styling tag changes!
>
> So please use the Tag: efx_styleclass:teststyle and to get a
> CSS-Selector of .teststyle
>
> Tom
>
> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=440434
>
> On 01.10.14 05:35, Thomas Elskens wrote:
>> Hi,
>>
>> The quotation marks ">" shopped off my class-selector, but the dot is
>> present in both .MPart and .teststyle (the dots are there in the
>> original message)...
>>
>> Thanks for the clarification on LESS, I was not really clear to me.
>
Re: Using tags as class selectors [message #1436121 is a reply to message #1435431] Thu, 02 October 2014 12:39 Go to previous message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
That works, thanks !

Writing (comprehensive) documentation is indeed quite a daunting task.

If my company decides to adopt the couple Eclipse RCP-JavaFX, we will most likely write some training manual about the subject. I could be useful for other beginners. To be continued...
Previous Topic:MAVEN artifacts
Next Topic:Occasionnaly getting error when closing efxclipse application
Goto Forum:
  


Current Time: Fri Jan 17 02:19:08 GMT 2025

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

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

Back to the top