Does anyone know if it's possible to check for the existence of a native dialog? I have a panel that contains a button used to print the contents of a textfield. This is done using the PrinterJob classes printDialog() function. This fires up the native print dialog of the operating system. How can I find this dialog??
Thanks,
Grant Sheppard
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I faced similar problems a few weeks ago and I didn't find any solution to this problem : it seems quite impossible to deal with native dialogs. Even TPTP (an eclipse testing framework) disclaimed to deal with such dialog when recording/playing scenarios... Still I'm very interested in all ideas, but I guess you should implement low-level method (using C code) to "listen" to OS windowing events.
HTH
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmmn... I'll probably run into this dilemna sooner or later. What I might try is not to deal with the native dialogs at all.
Instead, I might consider writing a 'wrapper' interface to act as a proxy for PrinterJob that'd expose the required functionality and return whatever information is needed.
That way I can stub the printer/printerdialog functionality during UI/component testing. Of course, this won't help if your intent _is_ to actually test the native printing/printer dialog system.
My 2c,
- alistair
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Does anyone know if it's possible to check for the existence of a native dialog? I have a panel that contains a button used to print the contents of a textfield. This is done using the PrinterJob classes printDialog() function. This fires up the native print dialog of the operating system. How can I find this dialog??
Thanks,
Grant Sheppard
I faced similar problems a few weeks ago and I didn't find any solution to this problem : it seems quite impossible to deal with native dialogs. Even TPTP (an eclipse testing framework) disclaimed to deal with such dialog when recording/playing scenarios... Still I'm very interested in all ideas, but I guess you should implement low-level method (using C code) to "listen" to OS windowing events.
HTH
Hmmn... I'll probably run into this dilemna sooner or later. What I might try is not to deal with the native dialogs at all.
Instead, I might consider writing a 'wrapper' interface to act as a proxy for PrinterJob that'd expose the required functionality and return whatever information is needed.
That way I can stub the printer/printerdialog functionality during UI/component testing. Of course, this won't help if your intent _is_ to actually test the native printing/printer dialog system.
My 2c,
- alistair