Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Add CSS rule to CSSEngine programmatically(Is it possible to add a CSS rule to the running CSSEngine programmatically?)
Add CSS rule to CSSEngine programmatically [message #1479168] Wed, 19 November 2014 07:59 Go to next message
Stefan Weiser is currently offline Stefan WeiserFriend
Messages: 54
Registered: February 2012
Member
I am using the CSS Style-Engine from e4. I would like to edit or add CSS rules to the CSSEngine during runtime.

Applying the given style to a Control is not enough to solve the problem, as it only applies the style of the engine to the control. I want to alter the style of the engine.

How can I do this? Do I have to implement my own CSSEngine or does the standard engine provide such a feature?
Re: Add CSS rule to CSSEngine programmatically [message #1479576 is a reply to message #1479168] Wed, 19 November 2014 14:52 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 877
Registered: January 2012
Senior Member

I'm not sure what "alter the style of the engine" means. Could you elaborate? What are you trying to accomplish?

You can dynamically bring in other style sheets: see the CSS Scratchpad. See the CSSScratchPart's applyCSS() method for an example.

You can add support to expose your own properties (e.g., "Shell { my-special-property: true; }").
You can also expose your own elements, though that's usually better done as a separate CSS Engine.
You can also create your own CSS Engines (e.g., see this thread).

Brian.
Re: Add CSS rule to CSSEngine programmatically [message #1480338 is a reply to message #1479576] Thu, 20 November 2014 05:28 Go to previous message
Stefan Weiser is currently offline Stefan WeiserFriend
Messages: 54
Registered: February 2012
Member
Thank you for the hints.

The code of CSSScratchPart is exactly the feature I'm looking for. That helps me a lot and solves my problems.

The already defined my own CSS properties by using the AbstractCSSPropertySWTHandler. This is really nice and very easy to use.
Previous Topic:Luna 4.4 unable to connect to marketplace behind firewall
Next Topic:CSS TableItem support of "even" "odd"
Goto Forum:
  


Current Time: Sat Jan 23 05:58:34 GMT 2021

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

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

Back to the top