|
From: Jan H. <jh...@sc...> - 2008-02-11 12:41:39
|
Hi, I've run into some issues concerning the dispose of the ApplicationDialog. The default CloseAction of ApplicationDialogs is set to DISPOSE and will have the effect of disposing the actual JDialog which resides in ApplicationDialog. Issues I encounter are: 1) subclasses don't 'dispose' the content pane they provide, however the surrounding JDialog is disposed. This can be fixed by providing an additional method disposeDialogContentPane. Any components kept in fields and created in createDialogContentPane can have their reference set to null in the disposeDialogContentPane. 2) subclasses may use the createDialogContentPane for other reasons than just the creation of visual components. Eg WizardDialog actually adds its pages in that method. This is not a real part of the content creation and momentarily has problems because it gets executed every time the wizard is opened. It reflects in duplicate pages (see issue RCP-536). I don't think we want to remove them in disposeDialogContentPane and re-add them again but fix this by calling it only once. I'm looking for the best spot/way to do this. 3) the create/dispose methods may not be transparent. Meaning when using the TitledApplicationDialog, a titlepane is used on top. When creating the dialog, titlePane.getControl() is used. When closing the ApplicationDialog, the JDialog can be disposed as well as any content in the TitledApplicationDialog by the disposeDialogContentPane, but the titlepane still has its component cached. Is this a problem? WDYT? Kind Regards, Jan **** DISCLAIMER **** http://www.schaubroeck.be/maildisclaimer.htm |