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.
Listener Classes get notified on selected events, such as starting up the application or creating a new Session.
You can do this using this code: Class clazz = Class. forName(yourString); As the class name you should use the full class name including packages.
You would call it as GUIclass1.this.foo()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With