Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-24 Thread GWTter
Hi Jens, Yea, this is definitely a good point. Then any widget can inherit this minimal CssResource and define on its own how it will look like in enabled / disabled state (= you would not add enableddisabled.css to the various widgets @Source annotation although you extend

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-23 Thread GWTter
Hi Jens, Here's the full example of what I was trying to illustrate as it's probably unfair of me to have others expect that I'm setting everything up right from just the pseudo code alone: public class GwtTest3 implements EntryPoint { public interface MyClientBundle extends ClientBundle{

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-23 Thread GWTter
Hi Thomas, I think this part right here is the clarification I needed: - mapping class names to/from methods is based on the method name or a @ClassName annotation (the class name in the CSS file will thus be replaced with the unique name computed for the method) So, if you want to

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-23 Thread Thomas Broyer
The best fix would be to use @Import instead of @Shared+inheritance (you don't even use the fact that MyCss extends GlobalCss). In other words, your InitButton is OK, not MyCss. On Sunday, February 23, 2014 10:13:00 PM UTC+1, GWTter wrote: Hi Thomas, I think this part right here is the

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-23 Thread Thomas Broyer
On Sunday, February 23, 2014 10:13:00 PM UTC+1, GWTter wrote: Hi Thomas, I think this part right here is the clarification I needed: - mapping class names to/from methods is based on the method name or a @ClassName annotation (the class name in the CSS file will thus be replaced

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-23 Thread GWTter
Yes, in the example I gave there's no clear need for the inheritance with MyCss, it's just there to show how inheritance would be setup to try to illustrate the issue I was referring to. It seems more and more like it's probably best to avoid inheritance and just go in the @Import direction.

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-23 Thread Jens
Just to get things right. Even in your complete example the usage of @Import in the case of InitButtonCSS is useless. Its useless because the css class initButton2 will be a unique name anyways and thus it doesn't really make sense to define the css rule as .global-genButton.initButton2.

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-23 Thread Thomas Broyer
On Monday, February 24, 2014 12:27:18 AM UTC+1, Jens wrote: Just to get things right. Even in your complete example the usage of @Import in the case of InitButtonCSS is useless. Its useless because the css class initButton2 will be a unique name anyways and thus it doesn't really make

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-22 Thread GWTter
On Friday, February 21, 2014 5:09:36 PM UTC+1, Thomas Broyer wrote: On Thursday, February 20, 2014 10:51:29 PM UTC+1, GWTter wrote: Before anything, sorry Thomas, I think I may have just replied to you instead of just the topic (buttons bugged on me a bit), no-spam intended

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-22 Thread Jens
At this point because SuperCssResource has now been reinjected and thus is now the last one declared between it and MyCssResource, its .genButton rule now wins and causes WidgetDisplayedFirst's button to now have a color of black. With the code above, it shouldn't (now there could be

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-22 Thread Thomas Broyer
You have a fundamental misunderstanding of @Import, despite the doc being rather clear, and that's your only problem (afaict). http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html#Imported_scopes You also have a slight misunderstanding of @Shared. Let's go back to the basics:

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-21 Thread GWTter
Hi Jens, Yes, this duplication when extending CssResources is exactly the issue I'm trying to highlight above and mitigate with the @required idea. Your suggestion is what I was trying to cover with the third option I gave above on how to avoid the duplication and unintended precedence

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-21 Thread Thomas Broyer
On Thursday, February 20, 2014 10:51:29 PM UTC+1, GWTter wrote: Before anything, sorry Thomas, I think I may have just replied to you instead of just the topic (buttons bugged on me a bit), no-spam intended You're right I guess I did misunderstand if the imported with prefix

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-20 Thread Thomas Broyer
On Thursday, February 20, 2014 12:08:28 AM UTC+1, GWTter wrote: On Wednesday, February 19, 2014 10:59:51 AM UTC+1, Thomas Broyer wrote: On Tuesday, February 18, 2014 6:38:36 PM UTC+1, GWTter wrote: Hi all, Let me just go with an example right off the bat. Let's say I have the

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-20 Thread GWTter
Before anything, sorry Thomas, I think I may have just replied to you instead of just the topic (buttons bugged on me a bit), no-spam intended You're right I guess I did misunderstand if the imported with prefix doesn't in fact use a different obfuscation for the original selectors in

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-20 Thread Jens
If you write a widget and that widget uses a button and that button has a default style defined in a BaseCssResource then you should use that BaseCssResource directly in your widget. You should not make your WidgetCssResource extend the BaseCssResource. Why? Because as soon as you do so, all

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-19 Thread Thomas Broyer
On Tuesday, February 18, 2014 6:38:36 PM UTC+1, GWTter wrote: Hi all, Let me just go with an example right off the bat. Let's say I have the following: === Pseudocode === SuperCssResource: This is injected onModuleLoad before anything else .genButton{ color: black; } Widget1

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-19 Thread GWTter
On Wednesday, February 19, 2014 10:59:51 AM UTC+1, Thomas Broyer wrote: On Tuesday, February 18, 2014 6:38:36 PM UTC+1, GWTter wrote: Hi all, Let me just go with an example right off the bat. Let's say I have the following: === Pseudocode === SuperCssResource: This is injected

CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-18 Thread GWTter
Hi all, Let me just go with an example right off the bat. Let's say I have the following: === Pseudocode === SuperCssResource: This is injected onModuleLoad before anything else .genButton{ color: black; } Widget1 consists of: --- css --- MyCssResource: .myButton{ color: red; } --- html ---