Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Intercepting Swing events




The suggested pointcut will only match the execution of methods defined in
javax.swing.JComponent and overridden by subclasses. To included methods
defined in subclasses of javax.swing.JComponent use:

pointcut somosNos() : (    execution     (* javax.swing.JComponent+.*(..)
));

However this is unlikely to catch any events in your own program unless you
are defining new Swing components. Are you trying to monitor the behaviour
of the Swing libraries instead? Any advice associated with the pointcut
above will be called _very_ frequently.  Before writing your aspect think
about the join points you want to advise and where they are.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/

"Khalid A. Al-Jasser" <kajasser@xxxxxxxxxxx>@eclipse.org on 26/05/2005
01:56:02

Please respond to aspectj-users@xxxxxxxxxxx

Sent by:    aspectj-users-bounces@xxxxxxxxxxx


To:    "Ze maria" <zemariamm@xxxxxxxxx>, <aspectj-users@xxxxxxxxxxx>
cc:
Subject:    Re: [aspectj-users] Intercepting Swing events


Dear Maria,,
As you know... events do not get called by any body.. they are executed
without explicit call..
for this reason,, you can use  "execution" instead of "call" as follows:

pointcut somosNos() : (    execution     (* javax.swing.JComponent.*(..)
));

this should work fine,,
regards,
-------------
Khalid
----- Original Message -----
From: "Ze maria" <zemariamm@xxxxxxxxx>
To: "Aspectj Mailing list" <aspectj-users@xxxxxxxxxxx>
Sent: Thursday, May 26, 2005 4:32 AM
Subject: [aspectj-users] Intercepting Swing events


Hi,
I'm trying to catch swing events, I'm using AspectJ Eclipse Plugin,
but i can't catch any method from all java api classes, for example ,
this catch's nothing:

public aspect campeao {

pointcut somosNos() : (call(* javax.swing.JComponent.*(..) ));

after() : somosNos() {
System.out.println("This should appear");
}
}
_______________________________________________
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




Back to the top