Re: GWT not using CssResources??
Hi, I opened an issue in the issue tracker concerning above problems: http://code.google.com/p/google-web-toolkit/issues/detail?id=4903 Let's hope enough people experience the same problems (and vote the issue) such that improvements are made. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
Thanks Stefan, interesting thoughts. Don't forget to add/insert examples sometimes as otherwise it's very hard to follow through just "paper"... :( For example: the problems you point out are better understood through a concrete example.. And don't forget that the UIBinder has just came out, and far from perfect... but it does fulfills a need for a group of people (just like you use it for toy app's)... Maybe in the next release of GWT we won't use CSS files anymore for widgets, but rather some CssResourse (xml) file/annotations. I think a CssResource-Generator would be a great idea. BTW: you might want to post your idea's in the GWT contributor list. They are always open for good idea's. Ed -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
Hi Ed, Regarding UI-Binder The fact that others are using similar concepts like Ui-Binder does not make it right. It just make it common. (150 years ago woman suffrage was not common, but would you say it was right what 150 years ago was common?) What is wrong with UI-Binder? a) it is an other XML-based language. XML is not really human readable. It the end, you need a tool. b) it is a further language. Everything you could do with it, could be done with java, too. You could write very declarative java code if you like. No need for Ui-Binder c) it is not expandable at the moment. Try to add your own widgets. d) It does not support theming. Changing a theme means recoding the UI- binder UI-Binder is a concept fitting rather to the mindset of a web designer (this one graphical beautyful application (NO plural!)) than to a web developer (deliver functional, supportable applications). "Being fast" Most companies suffers on the long run from doing things quickly but not right. These companies will pay the price in future. Because they are unable to change their theme or skin. "Single point of control" I want to be able to change all my widgets used in an application at a single place. And it should be regardless whether this widget comes from gwt core, widget library a or widget library b or from me or my colleague. Style modules To exchange a style module it must be separated. that is the consequence of your reduced requirements. So each of your reusable widgets need an own style module. It has to be duplicated for each theme. When you are having 30 widgets used in 5 applications with different styles (aka theme/skin) you need 150 style modules. With a1decor you need 5 different implementations of a theme. It is alway surprising that a more complete solution do reduce the effort Definition of a theme in the sense of a1decor: A consistent graphical representation of widgets and symbols. layout is not considered to be an issue of a theme in this sense. CSS CSS was advocated by separating structure from style. This is a variant of "separation of concerns". However, within a CSS there is NO possibility to separate further concerns. With CSS I see at least to following concerns "within" a) layout/visibility should not placed in .css-file at all. b) theming attributes (borders, colors) c) functionality attributes. (e.g pointer kinds) a) is separated because it applies from code not from css-file. This is rather an accident than designed. Often we just have luck because different concerns affect different style-attributes. But this is not guarantied When b) and c) want to affect the same css-attribute (let's say padding) there is no way to express it. a concrete example is "pressing a button": from functionality point of view you want different paddings when pressed and when not pressed, to make them look like pushed in. from theming point of view you want to apply a certain padding (compact versus broad). However, in the end you need to apply a single value to the padding- attribute. There is no way to express that padding is defined by TWO concerns, not even how they apply (add, min, max ..). "The lesson learned" is: pure declarative systems are going to fail when trying to increasing the degree of separation. You need some kind of procedural language to separate concerns, or better to consolidate multiple concerns to one value. Due to this "lesson learned" Ui-Binder will fail in large applications, too (due to: pure declarative without procedural language). I definitely will not wait until this happens. I am using Ui-Binder just for quick and dirty toys, and may be for some test cases. For a consistent gui all widgets must share similar attributes. Your questions sounds as this is no issue for you. One widget look compact, the other looks broad? Anyway, when you do adapt a consistent theme to all your widgets you need to change many styles. This is a lot of work and is in general not done. Or you have a single point of control It is right that the current way implies more freedom than with a1decor, but when this implies an enormous amount of effort you will never use your freedom. So what did you win? (did you know the joke: Marketing; We want to deliver the most adaptable flexible program: Development: OK, guys, tomorrow we deliver Java or C++ to our customers) regarding the large @def section: It may be annoying because it is just convention not programming. However, two things may happen a) you just need a subset for a specific widget b) maybe some one do an special CssResource-Generator were all that conventional stuff is implied. I am going to start on that. It addresses the problem which is far from generally understood, and maybe someone comes up with an great idea to make it easier. I do not fear this because the most work is defining the css and a better solution will probably only reduce to conventions part while still using the css. Stefan Bachert http://gwtworld.de On May 1, 1
Re: GWT not using CssResources??
Thanks Sefan, I agree with you on some of the issues you discuss, but not all of them. You are right that GWT's ClientBundle/CssResource concepts still have some issues, just like their widget design (some of my issues are in the issue tracker). But I don't think the UIBinder is a step back. Don't forget that many company's have to deliver fast and such work with GUI design tools like GWT Designer. UIBinder is the foundation for such tools. It's not for nothing that facelets became part of the JSF 2.0 spec and the Flex template mechanisme is the huge success behind Flex, all founded on the same concepts. Thet GWT dev team is just very careful and don't want to create a lock- in situation, so.. that is sometimes frustrating... but that's how it is and it probably takes a few releases .. Anyway, some of my answers are inlined, looking forward to your answers. > Because you want to have a single point of control. What do you mean by this? Isn't that the whole idea of ClientBundle/ CssResource Even with his current problems/restrictions > That is a fault. When you bind a widget to a certain css no change is > possible. But you want to have a change to chance. Why isn't this possible ?... Suppose a widget has his own css files, the developer can copy this and use it to inject his own css file through his own client bundle... at least... that is the "gwt way"... And you can always fine tune with dependent style names. > However, the technique you need for your reduced requirement is used > in a1decor. You just do variants like a1decor-style do. You separate > yourCssResourcein an own module. Each variant is just a duplicate of > this module with modified values. You select theCssResourceyou need > per class path, that is the trick. I can't really follow you here, can you give me a concrete example? I have dozens of reusable widgets, I hope I don't need to a style module for every one of them :(... > I feel this jumps too short. In common you don't want to change the > css of a single widget, you want to change the theme of a whole > application. What do you mean by this? How do you define you Theme then ? To me this sounds a bit too course grained and a different kind of problem... I simple want to be able to change my style values of one reusable (composite) widget. Do you mean that you define a theme as the collection of style definitions of the resusable widgets that you use in your app ?... This comes down to the same problem I think, as I don't want to change the Theme, as I only want to change one reusable widget Why should I need to change my Theme for this ? ... > From the values within a css there are at least two sorts: > a) one related with a theme > b) one related with functionality > The general problem with css is, that is does not really is able to > separate concerns. This is funny because css was advocated with this > argument. But css failed to fulfill this. You could not separate > concerns when they affect to the same css-style (e.g. because a > functionality and a theming aspect want to change "padding". But luck, > either or, but no AND possible).. Sorry, you are losing me here. Can you give a concrete example? > I did not expect this. GWT needs to run "legacy" app, too. So GWT will > not automatically bindCssResourceto core widgets. Just wait a see. Yep, I am also afraid of that, which is also what Thomas mentions above... I guess we will see major changes in this area in version 3.0... I like your idea's btw, but I am not very sure if it's very practical in larger app's and if it's the best solution in my case. If I look at my GWT app's, which are complex and have a total code base of about 2MB (downloaded in pieces).. I am a afraid it will become very messy if setup my css files like you propose... For example: if I look at my date picker styles, they will get very large with all the @def at's, not even to speak about all the code behind is. Of course the compiler will optimize a lot, but stilll.. it als has to be manageable. So I gain a lot of freedom and can override then every style value of my datepicker, but the question is: is this flexible worth the bunch of extra more-difficult maintainable code ? I don't know to honest... Ed On May 1, 10:23 pm, Ed wrote: > And Stefan answered this back: > Hi Stefan, > > > Looked at your project and played with it, but I don't think it's not > > solving my problem and it's not the way I like to work with styles. > > Why should I want to put my style value's in code like you do in your > > DecorInterface? > > Because you want to have a single point of control. > And the other benefits documented on the project page of a1decor > > > I want them only in CSS files that come with a widget. > > That is a fault. When you bind a widget to a certain css no change is > possible. But you want to have a change to chance. > > That's the nice thing about thisCssResourceconcept, you can have one > widget with one or more Css fi
Re: GWT not using CssResources??
And Stefan answered this back: Hi Stefan, > Looked at your project and played with it, but I don't think it's not solving > my problem and it's not the way I like to work with styles. > Why should I want to put my style value's in code like you do in your > DecorInterface? Because you want to have a single point of control. And the other benefits documented on the project page of a1decor > I want them only in CSS files that come with a widget. That is a fault. When you bind a widget to a certain css no change is possible. But you want to have a change to chance. That's the nice thing about this CssResource concept, you can have one widget with one or more Css files, resulting in clear checked compact css files. > That is wanted, but in practice it does not always work. But this is an issue > for GWT > The idea is to be able to replace/inject another CSS file with the same > widget (injecting/using another Client bundle). I feel this jumps too short. In common you don't want to change the css of a single widget, you want to change the theme of a whole application. However, the technique you need for your reduced requirement is used in a1decor. You just do variants like a1decor-style do. You separate your CssResource in an own module. Each variant is just a duplicate of this module with modified values. You select the CssResource you need per class path, that is the trick. > GWT also advices to put all your Style value's in CSS files. I think the GWT doc really state this. Any way, this is oversimplified and therefore rather wrong. Positions should not be part of a css, for example. Exception are only valid on the absolute top level. >From the values within a css there are at least two sorts: a) one related with a theme b) one related with functionality The general problem with css is, that is does not really is able to separate concerns. This is funny because css was advocated with this argument. But css failed to fulfill this. You could not separate concerns when they affect to the same css-style (e.g. because a functionality and a theming aspect want to change "padding". But luck, either or, but no AND possible) > I expect that GWT will also make more use of the ClientBundle/CssResource > concept for their widgets in the up comming releases, > with the risk that your concept will lose his power. This may happen. When GWT solves my intended issues, it is absolutely fine. However, I do not expect it. GWT is absolutely outstanding regarding compiler technology, but rather mediocre on gui design and their concepts. The widgets are rather poor designed, MVP is middle- rated, UiBinder was a step back. So GWT needs support in this area and I am going to solve one issue after the other. a1decor was one little step, but a strategic one. > And when using your code, you might have to refactor a lot of code when > upgrading to a newer gwt release. I did not expect this. GWT needs to run "legacy" app, too. So GWT will not automatically bind CssResource to core widgets. Just wait a see. > Just my thoughts, but maybe I miss understand it.. > Anyway, back to my problems: like my original question: can you point out how > your code solves my problems listed above ? When you think, my answers are failing to explain that, please ask a concrete question. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
Hm. The disadvantage of Gmail is that don't even realize that your are mailing a person or group (if you don't pay good attention like I did)... Anyway, I received an email from Stefan about this a1decorator project and this was mine reaction: Hi Stefan, --- Looked at your project and played with it, but I don't think it's not solving my problem and it's not the way I like to work with styles. Why should I want to put my style value's in code like you do in your DecorInterface? I want them only in CSS files that come with a widget. That's the nice thing about this CssResource concept, you can have one widget with one or more Css files, resulting in clear checked compact css files. The idea is to be able to replace/inject another CSS file with the same widget (injecting/using another Client bundle). GWT also advices to put all your Style value's in CSS files. I expect that GWT will also make more use of the ClientBundle/CssResource concept for their widgets in the up comming releases, with the risk that your concept will lose his power. And when using your code, you might have to refactor a lot of code when upgrading to a newer gwt release.. Just my thoughts, but maybe I miss understand it.. Anyway, back to my problems: like my original question: can you point out how your code solves my problems listed above ? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
> wait a few days. I am about to publish a project which probably covers > your issue, Looking forward to it and hope it will give answers to the problems listed above. On Apr 29, 9:02 am, Stefan Bachert wrote: > Hi Ed, > > wait a few days. I am about to publish a project which probably covers > your issue, > > Stefan Bacherthttp://gwtworld.de > > On 27 Apr., 16:00, Ed wrote: > > > > > > Have you had a read > > > through:http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... > > > Of course, every line > > > > What are you trying to do? Do you have some code samples? > > > Suppose I have my own button class called Button and want to use > > CssResource to set the styles in such a way that another developer > > that uses Button can change the style. > > > Idea's? > > > Ed > > > On Apr 27, 3:38 pm, Mike wrote: > > > > Ed, > > > > What are you trying to do? Do you have some code samples? > > > > Have you had a read > > > through:http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... > > > > Cheers > > > > On Apr 27, 3:43 am, Ed wrote: > > > > > Why is GWT not using CssResource to set styles on his components like > > > > a Button/Label? > > > > > I find it hard to use CssResources on reusable widgets, such that the > > > > styles can still be changed through the API of the widget by the > > > > outside world :(.. > > > > Maybe GWT experiences the same problems ?... > > > > What am I missing here ? > > > > > Ed > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "Google Web Toolkit" group. > > > > To post to this group, send email to > > > > google-web-tool...@googlegroups.com. > > > > To unsubscribe from this group, send email to > > > > google-web-toolkit+unsubscr...@googlegroups.com. > > > > For more options, visit this group > > > > athttp://groups.google.com/group/google-web-toolkit?hl=en. > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Google Web Toolkit" group. > > > To post to this group, send email to google-web-tool...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > google-web-toolkit+unsubscr...@googlegroups.com. > > > For more options, visit this group > > > athttp://groups.google.com/group/google-web-toolkit?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Web Toolkit" group. > > To post to this group, send email to google-web-tool...@googlegroups.com. > > To unsubscribe from this group, send email to > > google-web-toolkit+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/google-web-toolkit?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
> Have you guys seen > this:http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/... Yep, I have the GWT source in my Eclipse but neither could I find any answers their :( On Apr 29, 4:42 am, Mike wrote: > Have you guys seen > this:http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/... > ? > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
Hi Ed, wait a few days. I am about to publish a project which probably covers your issue, Stefan Bachert http://gwtworld.de On 27 Apr., 16:00, Ed wrote: > > Have you had a read > > through:http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... > > Of course, every line > > > What are you trying to do? Do you have some code samples? > > Suppose I have my own button class called Button and want to use > CssResource to set the styles in such a way that another developer > that uses Button can change the style. > > Idea's? > > Ed > > On Apr 27, 3:38 pm, Mike wrote: > > > Ed, > > > What are you trying to do? Do you have some code samples? > > > Have you had a read > > through:http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... > > > Cheers > > > On Apr 27, 3:43 am, Ed wrote: > > > > Why is GWT not using CssResource to set styles on his components like > > > a Button/Label? > > > > I find it hard to use CssResources on reusable widgets, such that the > > > styles can still be changed through the API of the widget by the > > > outside world :(.. > > > Maybe GWT experiences the same problems ?... > > > What am I missing here ? > > > > Ed > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Google Web Toolkit" group. > > > To post to this group, send email to google-web-tool...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > google-web-toolkit+unsubscr...@googlegroups.com. > > > For more options, visit this group > > > athttp://groups.google.com/group/google-web-toolkit?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Web Toolkit" group. > > To post to this group, send email to google-web-tool...@googlegroups.com. > > To unsubscribe from this group, send email to > > google-web-toolkit+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/google-web-toolkit?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
Have you guys seen this: http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/test/com/google/gwt/uibinder/test/client/WidgetBasedUi.ui.xml ? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
In fact I'm really interrested in this too and hope to find my time writing some little easy example in about a week. unfortunately my schedule up to then is ... (don't make me say it...) If anyone else might want to fetch up the idea earlier I won't be disapointed -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
From: Ed Bras To: google-web-toolkit@googlegroups.com Sent: Tue, April 27, 2010 6:10:30 PM Subject: Re: GWT not using CssResources?? > I think the @External annotation on your Css could help you there, too Like mentioned in the doc, this is for legacy support (I use it in other places). I want to support the correct way of using CssResource, but don't understand very well how to use it in the case below. Ed On Tue, Apr 27, 2010 at 5:58 PM, Tsukasa wrote: I think the @External annotation on your Css could help you there, too >- if I have understood all latest posts correctly. Try the following >documentation >http://code.google.com/p/google-web-toolkit/wiki/CssResource#External_and_legacy_scopes > >On 27 Apr., 16:00, Ed wrote: >> > Have you had a read >> > through:http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... >> >> Of course, every line >> >> > What are you trying to do? Do you have some code samples? >> >> Suppose I have my own button class called Button and want to use >> CssResource to set the styles in such a way that another developer >> that uses Button can change the style. >> >> Idea's? >> >> Ed >> >> On Apr 27, 3:38 pm, Mike wrote: >> >> >> >> >> >> > Ed, >> >> > What are you trying to do? Do you have some code samples? >> >> > Have you had a read >> > through:http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... >> >> > Cheers >> >> > On Apr 27, 3:43 am, Ed wrote: >> >> > > Why is GWT not using CssResource to set styles on his components like >> > > a Button/Label? >> >> > > I find it hard to use CssResources on reusable widgets, such that the >> > > styles can still be changed through the API of the widget by the >> > > outside world :(.. >> > > Maybe GWT experiences the same problems ?... >> > > What am I missing here ? >> >> > > Ed >> >> > > -- >> > > You received this message because you are subscribed to the Google >> > > Groups "Google Web Toolkit" group. >> > > To post to this group, send email to google-web-tool...@googlegroups.com. >> > > To unsubscribe from this group, send email to >> > > google-web-toolkit+unsubscr...@googlegroups.com. >> > > For more options, visit this group >> > > athttp://groups.google.com/group/google-web-toolkit?hl=en. >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "Google Web Toolkit" group. >> > To post to this group, send email to google-web-tool...@googlegroups.com. >> > To unsubscribe from this group, send email to >> > google-web-toolkit+unsubscr...@googlegroups.com. >> > For more options, visit this group >> > athttp://groups.google.com/group/google-web-toolkit?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Web Toolkit" group. >> To post to this group, send email to google-web-tool...@googlegroups.com. >> To unsubscribe from this group, send email to >> google-web-toolkit+unsubscr...@googlegroups.com. >> For more options, visit this group >> athttp://groups.google.com/group/google-web-toolkit?hl=en.- Zitierten Text >> ausblenden - >> >> - Zitierten Text anzeigen - > >-- >You received this message because you are subscribed to the Google Groups >"Google Web Toolkit" group. >To post to this group, send email to google-web-tool...@googlegroups.com. >To unsubscribe from this group, send email to >google-web-toolkit+unsubscr...@googlegroups.com. >For more options, visit this group at >http://groups.google.com/group/google-web-toolkit?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
> Because noone took the time to do it? (and GWT being a toolkit, it has > to account for both backwards and forwards compat, so it must be well > thought out from the beginning) That's understandable, but still, like you mention below, they do use it widgets like Tree, etc.. > What's the problem? If you call setStylePrimaryName or .. > I haven't tried it, but passing some specializedCssResourceor Please try it and use CssResource in a resuable widget, and you will see that it's much harder then you think (otherwise I wouldn't ask..) I started just like you mention "what's the problem", must be 123 finish... I found out otherwise.. > GWT already uses ImageResource and ClientBundle (when multiple > ImageResources are needed), and it shouldn't be really different with > aCssResource. Have a look at Tree and its Tree.Resources, MenuBar and I know the GWT usage, and these only use the Client bundle, not the CssResource! And the CssResource usage is much harder... My question: best practices of the CssResource in reusable widgets... The doc explains the theory but is missing good examples. Let me explain my "problem" through a use case: Suppose we have a MyButton that needs an image and style and that we can inject the client bundle through the constructor: MyButton() { this(GWT.create(MyButtonClientBundle.class)); } MyButton(final MyButtonClientBundle resource) { this.resource = resource; } The client bundle: MyButtonClientBundle extends ClientBundle{ @Source("back.png") ImageResource back(); @Source("mybutton.css") MyButtonCssResource getCss(); } And: MyButtonCssResource extends CssResource { @ClassName("but") String button(); } And the mybutton.css contains: .but { background-color: #ff00ff; } Some developer comes along and likes to use the MyButton and change the background color. How can he do this?... I donnoo :(... The problems I see: - He has to extend MyButtonClientBundle with his own version, something like ReuseClientBundle that he specifies through the MyButton constructor... He will override the method getCss and specifies his own stylesheet. However the compiler will see two getCss() methods and will load both stylesheets, which is not be desirable as he want to set his own background color. How to deal with this? An idea would be to only inject the MyButtonResource in MyButton, but then we are missing the ImageResource that MyButton needs :( .. - Suppose that he don't want to change the background color, but just some padding. In this case he will not have a problem with the injection witht he sylesheet through MyButtonClientButton, as it doesn't set the padding, but how do you share the same obfuscated name such he can inject his own stylesheet that contains something like: .panel .but { padding: 10px; } I did this, and it won't work as the style set in MyButton that comes from MyButtonCssResource has a different obfuscated names. I could solve this by the @external annotation, but that is for legacy code, and mine is brand new.. :(.. I think that it might be solved through the @Share or @Import annotation, but I don't fully understand that... It's lot of text above, but I hope some of the problems are clear now. Ed -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
On 27 avr, 10:43, Ed wrote: > Why is GWT not using CssResource to set styles on his components like > a Button/Label? Because noone took the time to do it? (and GWT being a toolkit, it has to account for both backwards and forwards compat, so it must be well thought out from the beginning) > I find it hard to use CssResources on reusable widgets, such that the > styles can still be changed through the API of the widget by the > outside world :(.. What's the problem? If you call setStylePrimaryName or addStyleDependentName you should know what you're doing and which are the consequences. The idea is that widgets document (in their JavaDoc) what they're doing internally (default stylePrimaryName, dependent names added or removed on which actions/events, add/removeStyleName on which actions/events) I haven't tried it, but passing some specialized CssResource or ClientBundle to the constructor and then only using setStylePrimaryName and add/removeStyleName (obviously not dependent style names) should do it. GWT already uses ImageResource and ClientBundle (when multiple ImageResources are needed), and it shouldn't be really different with a CssResource. Have a look at Tree and its Tree.Resources, MenuBar and its MenuBar.Resources, HorizontalSplitPanel and VerticalSplitPanel and their *.Resources, and DisclosurePanel which makes direct use of ImageResource, -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
> I think the @External annotation on your Css could help you there, too Like mentioned in the doc, this is for legacy support (I use it in other places). I want to support the correct way of using CssResource, but don't understand very well how to use it in the case below. Ed On Tue, Apr 27, 2010 at 5:58 PM, Tsukasa wrote: > I think the @External annotation on your Css could help you there, too > - if I have understood all latest posts correctly. Try the following > documentation > http://code.google.com/p/google-web-toolkit/wiki/CssResource#External_and_legacy_scopes > > On 27 Apr., 16:00, Ed wrote: > > > Have you had a read through: > http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... > > > > Of course, every line > > > > > What are you trying to do? Do you have some code samples? > > > > Suppose I have my own button class called Button and want to use > > CssResource to set the styles in such a way that another developer > > that uses Button can change the style. > > > > Idea's? > > > > Ed > > > > On Apr 27, 3:38 pm, Mike wrote: > > > > > > > > > > > > > Ed, > > > > > What are you trying to do? Do you have some code samples? > > > > > Have you had a read through: > http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... > > > > > Cheers > > > > > On Apr 27, 3:43 am, Ed wrote: > > > > > > Why is GWT not using CssResource to set styles on his components like > > > > a Button/Label? > > > > > > I find it hard to use CssResources on reusable widgets, such that the > > > > styles can still be changed through the API of the widget by the > > > > outside world :(.. > > > > Maybe GWT experiences the same problems ?... > > > > What am I missing here ? > > > > > > Ed > > > > > > -- > > > > You received this message because you are subscribed to the Google > Groups "Google Web Toolkit" group. > > > > To post to this group, send email to > google-web-tool...@googlegroups.com. > > > > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com > . > > > > For more options, visit this group athttp:// > groups.google.com/group/google-web-toolkit?hl=en. > > > > > -- > > > You received this message because you are subscribed to the Google > Groups "Google Web Toolkit" group. > > > To post to this group, send email to > google-web-tool...@googlegroups.com. > > > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com > . > > > For more options, visit this group athttp:// > groups.google.com/group/google-web-toolkit?hl=en. > > > > -- > > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > > To post to this group, send email to google-web-toolkit@googlegroups.com > . > > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com > . > > For more options, visit this group athttp:// > groups.google.com/group/google-web-toolkit?hl=en.- Zitierten Text > ausblenden - > > > > - Zitierten Text anzeigen - > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
I think the @External annotation on your Css could help you there, too - if I have understood all latest posts correctly. Try the following documentation http://code.google.com/p/google-web-toolkit/wiki/CssResource#External_and_legacy_scopes On 27 Apr., 16:00, Ed wrote: > > Have you had a read > > through:http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... > > Of course, every line > > > What are you trying to do? Do you have some code samples? > > Suppose I have my own button class called Button and want to use > CssResource to set the styles in such a way that another developer > that uses Button can change the style. > > Idea's? > > Ed > > On Apr 27, 3:38 pm, Mike wrote: > > > > > > > Ed, > > > What are you trying to do? Do you have some code samples? > > > Have you had a read > > through:http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... > > > Cheers > > > On Apr 27, 3:43 am, Ed wrote: > > > > Why is GWT not using CssResource to set styles on his components like > > > a Button/Label? > > > > I find it hard to use CssResources on reusable widgets, such that the > > > styles can still be changed through the API of the widget by the > > > outside world :(.. > > > Maybe GWT experiences the same problems ?... > > > What am I missing here ? > > > > Ed > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Google Web Toolkit" group. > > > To post to this group, send email to google-web-tool...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > google-web-toolkit+unsubscr...@googlegroups.com. > > > For more options, visit this group > > > athttp://groups.google.com/group/google-web-toolkit?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Web Toolkit" group. > > To post to this group, send email to google-web-tool...@googlegroups.com. > > To unsubscribe from this group, send email to > > google-web-toolkit+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/google-web-toolkit?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/google-web-toolkit?hl=en.- Zitierten Text > ausblenden - > > - Zitierten Text anzeigen - -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
> Have you had a read > through:http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... Of course, every line > What are you trying to do? Do you have some code samples? Suppose I have my own button class called Button and want to use CssResource to set the styles in such a way that another developer that uses Button can change the style. Idea's? Ed On Apr 27, 3:38 pm, Mike wrote: > Ed, > > What are you trying to do? Do you have some code samples? > > Have you had a read > through:http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... > > Cheers > > On Apr 27, 3:43 am, Ed wrote: > > > > > Why is GWT not using CssResource to set styles on his components like > > a Button/Label? > > > I find it hard to use CssResources on reusable widgets, such that the > > styles can still be changed through the API of the widget by the > > outside world :(.. > > Maybe GWT experiences the same problems ?... > > What am I missing here ? > > > Ed > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Web Toolkit" group. > > To post to this group, send email to google-web-tool...@googlegroups.com. > > To unsubscribe from this group, send email to > > google-web-toolkit+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/google-web-toolkit?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT not using CssResources??
Ed, What are you trying to do? Do you have some code samples? Have you had a read through: http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#CssResource Cheers On Apr 27, 3:43 am, Ed wrote: > Why is GWT not using CssResource to set styles on his components like > a Button/Label? > > I find it hard to use CssResources on reusable widgets, such that the > styles can still be changed through the API of the widget by the > outside world :(.. > Maybe GWT experiences the same problems ?... > What am I missing here ? > > Ed > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
GWT not using CssResources??
Why is GWT not using CssResource to set styles on his components like a Button/Label? I find it hard to use CssResources on reusable widgets, such that the styles can still be changed through the API of the widget by the outside world :(.. Maybe GWT experiences the same problems ?... What am I missing here ? Ed -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.