Bill,

Everything should work as expected if you add a SheetStateListener and
perform your logic in SheetStateListener#sheetClosed(Sheet), or a provide a
SheetCloseListener to one of the Sheet#open(...) methods.

Sheet#close() / Sheet#close(boolean) request the closure of the Sheet (which
extends Window), but SheetCloseListener#sheetClosed(Sheet) and
SheetStateListener#sheetClosed(Sheet) will be called when it has actually
been closed.

You will notice the other methods in SheetStateListener for vetoing a close
request should you need to, for instance if the Sheet requires some data
input from the user which it has not yet received to its satisfaction.

Chris

On 24 February 2011 07:18, Bill van Melle <[email protected]> wrote:

> I override Sheet.close in my Sheet dialog classes, so that I can take
> appropriate action when they are closed or canceled, which happens outside
> of my control when user presses Enter or Esc.  When I run this in the
> debugger, I can see that my close override gets called when the user presses
> Esc (call from TerraSheetSkin.keyPressed), and then again when the
> sheet-closing animation finishes
> (from TerraSheetSkin$4.transitionCompleted).  If I want to run some code
> when the dialog closes, do I have to keep track of this myself and set a
> flag or something?  Or is there a better place I can hook into all the
> places that terminate the dialog but get called only once?

Reply via email to