|
|
|
Re: (no subject) [message #671541 is a reply to message #671318] |
Wed, 18 May 2011 08:37 |
Eclipse User |
|
|
|
Originally posted by:
On 2011-05-17 15:41, No real name wrote:
> I could create a factory object that would return
> TableViewers whose Table controls were appropriately
> initialized based on a setttings object. However, I would
> then have to extend Table to provide my custom
> functionality.
>
> Then, in cases where I only have a reference to the
> TableViewer and I want to access/use its Table control, I
> have to call getTable() and appropriately cast the returned
> Table in order to use any of the functionality provided by
> the Table subclass (i.e. I would have to perform
> "instanceof" checks every time I wanted to use the viewers
> Table control).
>
> While I could perform the instanceof/casting each time I use
> the Table control, it would be nice to be able to extend
> TableViewer and override the getTable() method to return
> the appropriate type of Table.
I don't see the difference in effort here, because either way you would
need to derive from Table because there are no existing refinement of
Table that you could return instead. But superclassing Table is no valid
option for clients, see the corresponding SWT documentation:
"IMPORTANT: This class is not intended to be subclassed."
HTH & Greetings from Bremen,
Daniel Krügler
|
|
|
|
Powered by
FUDForum. Page generated in 0.04109 seconds