Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 308940 - [CSS] How to remove styling
Summary: [CSS] How to remove styling
Status: RESOLVED INVALID
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Bogdan Gheorghe CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-12 17:45 EDT by Lars Vogel CLA
Modified: 2012-11-29 12:35 EST (History)
4 users (show)

See Also:


Attachments
ReSkinnerHandler.java (1.79 KB, text/x-java-source)
2010-04-12 17:45 EDT, Lars Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2010-04-12 17:45:50 EDT
Created attachment 164636 [details]
ReSkinnerHandler.java

If I re-style the application via CSSEngine it seems that I cannot remove any set styles. 

How can I set the styling back to SWT default / remove any styling? I attach an example of an handler who re-style an application.
Comment 1 Angelo ZERR CLA 2010-04-13 14:00:09 EDT
Hi Lars,

When I have developped CSS engine I have done several errors. The reset of CSS property is a sample of my error, and it is not very good managed. Indead when CSSEngine apply styles for the first time, it get the current property (color, font....) for each widget and store it as default values. When CSSEngine is reseted or when new style must be applyed, default value computed is applyed. So the reset styles doesn't apply SWT default and it's a big error!

I would like refactor CSSEngine to manage correctly reset CSS property, but before that we should split SWTElement per SWT Widget (WidgetElement <- ControlElement...). I have seen your bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=308931 ([CSS] Ability to style menus.) and IHMO I think split SWTElement per SWT Widget should be done before developping this feature

WidgetElement sould implement EMF like PropertyDescriptor  :

PropertyDescriptor#getPropertyalue(String name)
PropertyDescriptor#resetPropertyalue(String name)
...

I would like do that since very long time, but i'm waiting decision of Bogdan to start this big refactoring.

Regards Angelo
Comment 2 Lars Vogel CLA 2010-04-14 12:35:47 EDT
Hi Angelo,

thanks for your detailed reply. I'm adding Bogdan to get his opinion on the refactoring.

Best regards, Lars
Comment 3 Lars Vogel CLA 2012-11-29 12:35:26 EST
Marking as invalid. To remove styling you have to override the properties with your new styling.