I have created my own compound composite by extending the Composite class in a e4 application.
I have then override the dispose method but it never gets called. However if i add a dispose listener on my compound composite or any of the widgets that it contains the listener do get called.
Could somebody explain my why?
Here would be an example.
public class MyComposite extends Composite{
public MyComposite(){
this.addDisposeListener(new DisposeListener(){
@Override
public void widgetDisposed(DisposeEvent e) {
System.out.println("This get printed");
}
});
}
@Override
public void dispose(){
System.out.println("This is not printed");
super.dispose();
}
}
I have read the javadoc for the dispose method and it says:
NOTE: This method is not called recursively on the descendants of the receiver. This means that, widget implementers can not detect when a widget is being disposed of by re-implementing this method, but should instead listen for the Dispose event.
For the behaviour i am seeing and the javadoc above, seems that the dispose method can not be override because it is ignored. Is this interpretation correct?