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

    Problem using mixins to overload a superclass method

    Jesper Thuun-Petersen Newbie

      I have a class hierarchy like this:


      {code}A extends JComponent{code}

       

      {code}B extends A{code}

       

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

       

      {code}

      @Mixin(target = B, interfaces = C)

      public static CImpl doMixin(B b){

          return new CImpl(b);

      }

      {code}

       

      
      

       

      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