Calling to the owner class from a listener

button, java, listener, methods, swt

Solution

You would call it as `GUIclass1.this.foo()`

Problem

Having the follow class - ``` 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 .. } } ``` As you can see within the `addSelectionListener` there is a calling to method `foo()` . My question is - which reference I should write as a prefix to `foo()` in order to know which class `foo()` related to . I tried `super().foo()` with no success.

Original source