This is true but keep in mind that if you use inheritance to extent a
widget your object must follow the "Is A..." rule.
Il you extent a button with a new child class "MyButton" or
"MyToolbar" you inherit all present and future methods, your object
can be cast and used as a parent representative, it is also a Button
and a Widget as example. So may be "MyToolbar" is not a good idea here
because it is a button set and no a single button (The Rule "Is A
Button" is not respected). The composite is a good way to build a new
widget mays be with various smaller widgets and java code as glue
(another one is wrapping the JS component using native methods).
Inheritance has to keep the original widget idea with only
specialisation like button with image as a sort of button or
IntegerTextBox as a interger input dedicate TextBox. So if (and only
if) the "Is A" rule apply it seems better to inherit.
Hope it help a little bit. G. ;-)