[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Adding methods to all subclasses

You can't use load-time weaving because it won't weave into classes in
java..*  You could distribute a script that creates a woven set of Swing
classes to prepend to the bootstrap classpath, weaving rt.jar. There are
some licensing restrictions to consider, though I think if you suggest users
use the open jdk you'd probably be fine.

Another option to consider is to use around advice on calls to construct the
base swing components and replace them with your own enhanced subclasses,
which you could have woven freely.

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Tomas KRAMAR
Sent: Thursday, October 04, 2007 11:25 AM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Adding methods to all subclasses

No, this is not what I meant. I need to add few new methods to each of
the swing components (JButton, JCheckBox, JFrame etc.), which will
provide new functionality.

2007/10/4, Ron Bodkin <rbodkin@xxxxxxxxxxxxxx>:
> You could advise calls to the Swing methods, as long as they're not being
> done through reflection.
>
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Tomas KRAMAR
> Sent: Thursday, October 04, 2007 10:15 AM
> To: aspectj-users
> Subject: [aspectj-users] Adding methods to all subclasses
>
> Hello,
>
> I need to add methods to all subclasses of various swing components.
> The simplest solution seems to be simply adding those methods to the
> component itself, but that would require weaving the swing classes;
> something I cannot afford if I want to keep the application
> distributable.
>
> I hoped I could use a similar construction like:
>
> public void JFrame+.doSomething() {}
>
> Is it possible to use some kind of pattern instead of a class name,
> when introducing new methods?
>
> Regards
> Tomas Kramar
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


-- 
Tomas Kramar
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users