Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Composite Obsession


Tree and Table are Composites because they can have Control children, for example, cell editors that are Text controls.  Combo is a Composite mainly for historical reasons.  On platforms that don't have a native Combo (or Spinner), the control needs to be emulated by a Text and a List or some other control.  Due to Java strong typing, only Composites can have children so an emulated Combo must be a subclass of Composite.  The SWT class hierarchy must be identical across platforms for portablity.  Hence, Combo and Spinner are subclasses of Composite.  Sorry.



"Ivan Markov" <ivan.markov@xxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

11/24/2004 02:33 PM

Please respond to
platform-swt-dev

To
<platform-swt-dev@xxxxxxxxxxx>
cc
Subject
[platform-swt-dev] Composite Obsession





Hey,
 
Yesterday I started porting the new Spinner widget to SWT/Fox and oh, horror! The everything-is-composite saga continues!
Why is this widget Composite? Does it make sense for it to have children?
 
Also, why are Tree & Table Composite and List only Scrollable?
In fact, why other controls besides Canvas, Decorations & Shell inherit from Composite?
 
-Ivan
 

Back to the top