In many cases it is not appropriate to expose the entire API of the underlying widget, so a Composite is used.
If you don't want consumers calling certain methods of the underlying (extended) widget then use a composite, if you really are just adding additional functionality to an existing widget then extending it directly is fine. -jason On Mar 17, 2009, at 3:26 PM, Moe48 wrote: > > Why wouldn't I want people to message the panel into how they want it? > > On Mar 17, 3:16 pm, Jason Essington <[email protected]> wrote: >> Composite allows you to hide the implementation details of the >> underlying panel (or other Widget)... >> >> For instance if you are creating some widget that has 3 columns of >> stuff, and are going to use a horizontal panel to be the ultimate >> parent of the stuff, you wouldn't want to extend Horizontal Panel >> directly as that would allow users to add additional columns to your >> widget. you'd want to hide that implementation detail by using >> Composite, then only exposing necessary methods. >> >> -jason >> >> On Mar 17, 2009, at 3:09 PM, Moe48 wrote: >> >> >> >>> I have been extending different panels to contain features of my >>> app. >>> I was told the other day that I should always use Composites. >>> So what are the advantages to extending Composite VS just extending >>> the class that I would initWidget() with? > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
