Re: Composite question

2009-05-22 Thread alan m
Developers can never be trusted to do what they're told ;-) I'll pass on your kind description of them! But seriously, I have everything I need for css layout built in to my widgets already (so no style is set in code; and no layout or style is all-but-impossible in css). I was just wondering if

Re: Composite question

2009-05-22 Thread sssmack
How about this: Create a new class that contains Composite and extends nothing. Implement the methods using those from Composite needed to make the new class work with GWT...and implement your own. In other words: class MyRestrictedWidget { private Composite composite = new Composite() {

Composite question

2009-05-21 Thread alan m
Hi, I see how Composite is useful in theory for custom widgets, to wrap rather than extend specific widgets prevent exposing all their methods; but I have found that Composite itself has a LOT of methods exposed, particularly the UIObject position/dimension/etc setters which I had wanted hidden

Re: Composite question

2009-05-21 Thread Jeff Chimene
On 05/21/2009 09:22 AM, alan m wrote: Hi, I see how Composite is useful in theory for custom widgets, to wrap rather than extend specific widgets prevent exposing all their methods; but I have found that Composite itself has a LOT of methods exposed, particularly the UIObject

Re: Composite question

2009-05-21 Thread alan m
sure Jeff: public class PanelWidget extends Composite { private FlowPanel div; public PanelWidget(){ super(); div = new FlowPanel(); initWidget(div); } public void add(Widget widget){ div.add(widget); } } On

Re: Composite question

2009-05-21 Thread Ian Bambury
You are creating a composite widget which is going to be a UIObject so it has UIObject methods. But if you make a composite with three labels, then you probably don't want (and it wouldn't be easy) to expose the setText method for all three. Ian http://examples.roughian.com 2009/5/21 alan m

Re: Composite question

2009-05-21 Thread Jeff Chimene
On 05/21/2009 10:09 AM, alan m wrote: sure Jeff: Hi, I'd misjudged your question, hence withdrawn my answer. public class PanelWidget extends Composite { private FlowPanel div; public PanelWidget(){ super(); div = new FlowPanel();

Re: Composite question

2009-05-21 Thread alan m
So... Is there any better way of blocking all these Composite methods other than kludgy myWidget @Override? On Thu, May 21, 2009 at 6:23 PM, Ian Bambury ianbamb...@gmail.com wrote: You are creating a composite widget which is going to be a UIObject so it has UIObject methods. But if you make

Re: Composite question

2009-05-21 Thread Ian Bambury
There is, by extending Widget, but it means more work and understanding the way GWT works. Do you have a reason for stopping certain UIObject methods being used or are you just a control freak :-) Generally speaking, those methods are there to allow your users to use the widget you create more

Re: Composite question

2009-05-21 Thread alan m
Yes, I'm a control freak! ;-) But also my brief is to provide a widget library with my (well, the client's) class names etc. and 100% css layout and style, and prevent individual developers to use gwt's setters (getters are less important) and diverge from the required styles - consistency is

Re: Composite question

2009-05-21 Thread Ian Bambury
Sorry - I was going from memory and got the widget thing wrong. :-( You'd have to go back to real basics to get around that. Or tell your client to get developers they can trust to do as they are told ;-) Is your client absolutely sure that their untrustworthy, pig-headed, anarchic,