Menu

Finding Native Dialogs

Help
2006-01-03
2013-05-20
  • Grant Sheppard

    Grant Sheppard - 2006-01-03

    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

     
    • chausson sebastien

      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

       
    • Alistair A. Israel

      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

       

Log in to post a comment.