|
|
Re: Why am I unable to subclass an SWT control? [message #467631 is a reply to message #467624] |
Thu, 02 February 2006 04:35 |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
Jon <jon@tradescape.biz> wrote:
> To whom it may concern,
>
> I wanted to subclass the Combo control so I could improve the API in
> regards to associating "data" (an object) with an "item".
> Unfortunately when I do a new on my derived class I get a Runtime
> exception (unable to subclass).
>
> I find this restriction too limiting, especially when an API is not
> well thought out and is difficult to use. I realize the SWT makes
> platform dependent calls but the interface I added has nothing to do
> with the underlying Windowing system.
>
Use a ComboViewer instead of subclassing the Combo control.
Your model will contain the data and the Combo will contain the items.
The ComboViewer will manage the mapping between the two.
--
Sunil
|
|
|
Powered by
FUDForum. Page generated in 0.03267 seconds