Re: widgets plan proposal
David Crawshaw <[email protected]>
| Newsgroups | gmane.comp.java.xwt.general |
|---|---|
| Message-ID | <[email protected]> |
On Wednesday, April 2, 2003, at 11:20 AM, Andrew Kohlsmith wrote: >> The question is do behaviors belong in xwt.theme.<behavior>, or just >> in >> plain xwt.theme. > > yuck. 90% of all the theme templates have the same core behaviour. > Why > repeat that code in every theme? Okay, I think you missed what I was trying to say, which is actually the same as what you're trying to say. xwt.theme gets overridden by org.xwt.theme.monopoly. This is the only overlay. We have a directory called xwt.theme, that contains the template xwt.theme.button. There's not much in this file xwt.theme.button, except very detailed documentation about its exact interface. We have a directory called xwt.widget, that contains the template xwt.widget.button. There's not much in this file xwt.theme.button, except a preapply for xwt.theme.focusable, a preapply for xwt.theme.clickable, a preapply for xwt.theme.button. xwt.widget.button also contains documentation on the traps that a beginner building a basic application would want. It explains how it holds focus, etc. We have a directory called xwt.lib, that contains the template xwt.lib.button. There's a lot of meat in this template, and it does lots of stuff. We have a directory called org.xwt.theme.monopoly, that contains the template org.xwt.theme.monopoly.button. This contains a preapply for xwt.lib.button, it contains just enough to fill the gaps between the xwt.lib.button API and that required by xwt.theme.button (which it will replace), and it puts the specific monopoly feel on everything. End Result: xwt.widget.button <- Developers use this, it does stuff, that's all that matters xwt.theme.button <- Defines backend api requirements for a button xwt.lib.button <- Contains theme independent implementation for theme.button org.xwt.theme.monopoly.button <- Adds theme dependent implementation. This model: - provides simple interface for base developer - provides power interface for over-serious developer - keeps theme independent code in xwt.lib - keeps theme dependent code in org.xwt.theme.<themename> - no code redundancy (that I can see) This is what we're talking about, right? d _______________________________________________ http://lists.xwt.org/listinfo/dev