Custom CSS properties

Hi,

I want to create a plugin that adds some custom css properties, like the existing JavaFX plugin does (with the "-fx-*" properties), and basically the same as discussed here: https://devnet.jetbrains.com/message/5485291

Is the way described in that thread (using CssElementDescriptorProvider) still the best way to do it? The first message (from Alexander Zolotov) said "At the moment css-api is not really handy (it will be improved in the next version)". Was it improved, or are there any docs I should read before doing this?

Also, is there any example code for a plugin that already does what I want? The JavaFX source doesn't seem to do much with properties (or maybe it's too obscure for me to realize :)) and there is not a single reference for it on the community edition source (I guess because CSS is a Ultimate thing)

Thanks in advance :)

2 comments
Comment actions Permalink

Hi,

It would be easier for me if you try to implement something and ask particular question about implementation.

> Is the way described in that thread (using CssElementDescriptorProvider) still the best way to do it?

Yes, you still should use CssElementDescriptorProvider and implement methods that I've mentioned in that thread.

> The first message (from Alexander Zolotov) said "At the moment css-api is not really handy (it will be improved in the next version)". Was it improved, or are there any docs I should read before doing this?

It was improved, CssElementDescriptorProvider was extracted to API as well as some base descriptors implementations (e.g. CssPropertyDescriptorStub). Also now you don't have to retrieve base provider and delegate anything to it.

> Also, is there any example code for a plugin that already does what I want?

I don't know any open source example.

> The JavaFX source doesn't seem to do much with properties (or maybe it's too obscure for me to realize :)) and there is not a single reference for it on the community edition source (I guess because CSS is a Ultimate thing)

JavaFX-CSS module is not included into community edition.

0
Comment actions Permalink

Thank you Alexander, that's exactly what I needed :).

I will certainly be asking questions about my implementation if I get stuck, thank you!

0

Please sign in to leave a comment.