0 Replies Latest reply: Feb 14, 2011 8:17 AM by Jesper Thuun-Petersen RSS

Problem using mixins to overload a superclass method

Jesper Thuun-Petersen Newbie

I have a class hierarchy like this:

 

A extends JComponent

 

B extends A

 

I want to introduce an overloaded version of the setVisible(..) method into class B using mixins, and do something like this:

 

 

@Mixin(target = B, interfaces = C)
public static CImpl doMixin(B b){
    return new CImpl(b);
}

 

 

 

the C interface has a setVisible(..) method, thereby overriding the original JComponent-version of the setVisible(..) method.

 

My problem is, that I'm unable to call the original JComponent version of setVisible, as my mixin-class CImpl does not extend B (and wouldn't be the same object at runtime anyway).

 

Is there a way to get hold of the original setVisible(..) method, as I cannot call super in the CImpl class?

 

Regards

/Jesper Thuun-Petersen