Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Extending Item?
Extending Item? [message #462137] Fri, 07 October 2005 03:00 Go to next message
Brad Reynolds is currently offline Brad ReynoldsFriend
Messages: 309
Registered: July 2009
Senior Member
I have a custom Table that mimics the SWT API to a certain extent. I'm
working on the viewer for it and StructuredViewer expects a Widget to be
passed to a few methods. I made my TableItem extend Item to get past
this and I just want to make sure that I'm not doing something that is
going to cause me problems. Composite and Canvas are the only widgets
that I know I should extend but didn't know if that applied to non
Controls (also the javaodc for Item doesn't say not to extend it).
Everything seems alright from a functionality perspective but I wanted
to check to make sure that I'm not going to run into issues. Is this
alright to do? Does anyone see any potential problems?

Thanks,
Brad
Re: Extending Item? [message #462143 is a reply to message #462137] Fri, 07 October 2005 09:07 Go to previous messageGo to next message
Robert Bacs is currently offline Robert BacsFriend
Messages: 165
Registered: July 2009
Senior Member
Hi Brad,

I've made my own custom Table control too, so there should be no problem,
and you can extend the Item class to create your own custom table items.
Also you can make your own viewer for the custom table extending from
StructuredViewer.

Regards,
Boby

"Brad Reynolds" <bradleyjames@gmail.com> wrote in message
news:di4ocd$76f$1@news.eclipse.org...
> I have a custom Table that mimics the SWT API to a certain extent. I'm
> working on the viewer for it and StructuredViewer expects a Widget to be
> passed to a few methods. I made my TableItem extend Item to get past
> this and I just want to make sure that I'm not doing something that is
> going to cause me problems. Composite and Canvas are the only widgets
> that I know I should extend but didn't know if that applied to non
> Controls (also the javaodc for Item doesn't say not to extend it).
> Everything seems alright from a functionality perspective but I wanted
> to check to make sure that I'm not going to run into issues. Is this
> alright to do? Does anyone see any potential problems?
>
> Thanks,
> Brad
Re: Extending Item? [message #462172 is a reply to message #462143] Fri, 07 October 2005 14:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

At the very top of the javadoc for table item it says:

* </dl>
* <p>
* IMPORTANT: This class is <em>not</em> intended to be subclassed.
* </p>
*/

So no, it should not be subclassed.

However there is a Widget.setData (String key, Object value) method
where you can store additional data and then you can have listeners that
take the additional data and do things.

Robert Bacs wrote:
> Hi Brad,
>
> I've made my own custom Table control too, so there should be no problem,
> and you can extend the Item class to create your own custom table items.
> Also you can make your own viewer for the custom table extending from
> StructuredViewer.
>
> Regards,
> Boby
>
> "Brad Reynolds" <bradleyjames@gmail.com> wrote in message
> news:di4ocd$76f$1@news.eclipse.org...
>
>>I have a custom Table that mimics the SWT API to a certain extent. I'm
>>working on the viewer for it and StructuredViewer expects a Widget to be
>>passed to a few methods. I made my TableItem extend Item to get past
>>this and I just want to make sure that I'm not doing something that is
>>going to cause me problems. Composite and Canvas are the only widgets
>>that I know I should extend but didn't know if that applied to non
>>Controls (also the javaodc for Item doesn't say not to extend it).
>>Everything seems alright from a functionality perspective but I wanted
>>to check to make sure that I'm not going to run into issues. Is this
>>alright to do? Does anyone see any potential problems?
>>
>>Thanks,
>>Brad
>
>
>

--
Thanks,
Rich Kulp
Re: Extending Item? [message #462177 is a reply to message #462172] Fri, 07 October 2005 14:56 Go to previous message
Brad Reynolds is currently offline Brad ReynoldsFriend
Messages: 309
Registered: July 2009
Senior Member
That's TableItem, I'm talking about Item. Item has no such stipulation.

Rich Kulp wrote:
> At the very top of the javadoc for table item it says:
>
> * </dl>
> * <p>
> * IMPORTANT: This class is <em>not</em> intended to be subclassed.
> * </p>
> */
>
> So no, it should not be subclassed.
>
> However there is a Widget.setData (String key, Object value) method
> where you can store additional data and then you can have listeners that
> take the additional data and do things.
>
> Robert Bacs wrote:
>
>> Hi Brad,
>>
>> I've made my own custom Table control too, so there should be no problem,
>> and you can extend the Item class to create your own custom table items.
>> Also you can make your own viewer for the custom table extending from
>> StructuredViewer.
>>
>> Regards,
>> Boby
>>
>> "Brad Reynolds" <bradleyjames@gmail.com> wrote in message
>> news:di4ocd$76f$1@news.eclipse.org...
>>
>>> I have a custom Table that mimics the SWT API to a certain extent. I'm
>>> working on the viewer for it and StructuredViewer expects a Widget to be
>>> passed to a few methods. I made my TableItem extend Item to get past
>>> this and I just want to make sure that I'm not doing something that is
>>> going to cause me problems. Composite and Canvas are the only widgets
>>> that I know I should extend but didn't know if that applied to non
>>> Controls (also the javaodc for Item doesn't say not to extend it).
>>> Everything seems alright from a functionality perspective but I wanted
>>> to check to make sure that I'm not going to run into issues. Is this
>>> alright to do? Does anyone see any potential problems?
>>>
>>> Thanks,
>>> Brad
>>
>>
>>
>>
>
Previous Topic:Save pages from SWT Browser
Next Topic:menu accelerators
Goto Forum:
  


Current Time: Fri Apr 26 23:01:32 GMT 2024

Powered by FUDForum. Page generated in 0.03042 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top