Java 从侦听器调用所有者类

Java 从侦听器调用所有者类,java,button,methods,swt,listener,Java,Button,Methods,Swt,Listener,有跟班- public class GUIclass1 extends org.eclipse.swt.widgets.Composite { private void initGUI() { { // The setting of the open file button. openButton = new Button(this, SWT.PUSH | SWT.CENTER); openButt

有跟班-

public class GUIclass1 extends org.eclipse.swt.widgets.Composite {
    private void initGUI() {

        {
            // The setting of the open file button.
            openButton = new Button(this, SWT.PUSH | SWT.CENTER);
            openButton.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent evt) {
                    foo() ; 
                }
            });
        }
    }

    public void foo() {
        // implementation ..
    }
}
正如您可以在
addSelectionListener
中看到的,有一个对方法
foo()
的调用

我的问题是-我应该写哪个引用作为
foo()
的前缀,以便知道与哪个类
foo()
相关


我尝试了
super().foo()
,但没有成功

您可以将其称为
GUIclass1.this.foo()
试试这个

正如我们所知,
内部类可以隐式访问外部类的成员
, 因此,
这个.foo()将不起作用
,但是

GUIclass1.this.foo()将起作用