[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: Subclassing SWT widgets

How about using setData() and getData(), can I use those to store my data?.
I haven't found the javadocs, so I'm kind of working blindly


Thanks to everyone that replied !!!

Andres


"Nick Evgeniev" <nick@xxxxxxxxx> wrote in message
news:atkau9$8ib$1@xxxxxxxxxxxxxxxx
> Hi,
>
> SWT widgets aren't designed to be subclassed... The simplest way to add
> extra functionality is to rewrite them...
>
> So get the source, change the widget, compile, pack your own myswt.jar
> enjoy. Don't forget to do it with each SWT release you are going to use.
> NOTE if you need crossplatform support you must change widget sources for
> every platform.
>
> It's a well known "use it, or throw it" pattern.
>
> "Andres" <az9az@xxxxxxxxxxx> wrote in message
> news:atinnn$hqm$1@xxxxxxxxxxxxxxxx
> > For the project I'm working on, I need to subclass some of the SWT
> widgets,
> > like TableColumn, TreeItem, TreeItem. I'm not overiding any methods,
just
> > adding a few member variables and methods.
> >
> > When I subclass, a get SWTException that subclassing is not allowed.  I
> have
> > been able to get around this by declaring a protected method:
> >
> > public void checkSubclass(){}
> >
> > If I do this, everything works OK, but I want to know if this is the
> correct
> > way to do things, or how should it be done correctly.
> >
> > Thanks in advance,
> >
> > Andres
> >
> >
>