Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Add functionality to GUI with AspectJ

Andrew thanks for your reply.
I don't really know what i have to do. I don't know if i have to advice a
private method, actually i think it's not what i need.
I would like to put a Pointcut in the initComponents() method, and with an
aspect get the instance of JFrame that is the "reciver" of that method, and
with that instance (lets name it "aJFrame") do something like
aJFrame.add(new JButton());
And i don't know if there's a way to do this with aspects.



Andrew Eisenberg-3 wrote:
> 
> Actually, I was a bit mistaken.  You do not need to use the privileged
> keyword.  Aspects can advise private members of a class or other
> aspect.  Privileged means that they can also access private members.
> Probably not necessary in this case.
> 
> On Fri, Sep 5, 2008 at 2:36 PM, Andrew Eisenberg <andrew@xxxxxxxxxxxx>
> wrote:
>> Are you trying to advise a private method on JFrame?  If that's the
>> case, then you need to use the "privileged" keyword on your aspect.
>> You also need to add the SWT library onto your inpath.  By putting
>> something on your inpath, all of its class files are woven with all
>> your aspects.  The resulting code is placed in your out folder.
>>
>> On Fri, Sep 5, 2008 at 2:05 PM, Megaman <dimacamp@xxxxxxxxxxx> wrote:
>>>
>>> Hi everyone,
>>> Like i said before, i'm new in aspectj. I trying to add funtionality to
>>> a
>>> GUI with an aspect and i can't find the way.
>>> I'll be more specific: I have a simple GUI written in swing and i would
>>> like
>>> to add a button to it with and aspect.
>>> Suppose i have a class that extends JFrame and it has JButtonslike
>>> instance
>>> variables.
>>> the JFrame has a private method it called initComponents(), where adds
>>> all
>>> the buttons that it has like instance variables to the contentPane.
>>> I put a Pointcut in that method, but i don't know how to do it.
>>> Somebody know how?
>>> Thanks!
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Add-functionality-to-GUI-with-AspectJ-tp19339493p19339493.html
>>> Sent from the AspectJ - users mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> 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
> 
> 

-- 
View this message in context: http://www.nabble.com/Add-functionality-to-GUI-with-AspectJ-tp19339493p19341898.html
Sent from the AspectJ - users mailing list archive at Nabble.com.



Back to the top