src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java

Print this page




  24  */
  25 
  26 package sun.lwawt.macosx;
  27 
  28 import java.awt.*;
  29 import java.awt.dnd.*;
  30 
  31 import sun.lwawt.*;
  32 
  33 public class CPrinterDialogPeer extends LWWindowPeer {
  34     static {
  35         // AWT has to be initialized for the native code to function correctly.
  36         Toolkit.getDefaultToolkit();
  37     }
  38 
  39     Component fTarget;
  40 
  41     public CPrinterDialogPeer(CPrinterDialog target, PlatformComponent platformComponent,
  42                               PlatformWindow platformWindow)
  43     {
  44         super(target, platformComponent, platformWindow);
  45         //super(target);
  46         fTarget = target;
  47         super.initialize();
  48     }
  49 
  50     protected void disposeImpl() {
  51         LWCToolkit.targetDisposedPeer(fTarget, this);
  52     }
  53 
  54     public void setVisible(boolean visible) {
  55         if (visible) {
  56             new Thread(new Runnable() {
  57                 public void run() {
  58                     CPrinterDialog printerDialog = (CPrinterDialog)fTarget;
  59                     printerDialog.setRetVal(printerDialog.showDialog());
  60                     printerDialog.setVisible(false);
  61                 }
  62             }).start();
  63         }
  64     }




  24  */
  25 
  26 package sun.lwawt.macosx;
  27 
  28 import java.awt.*;
  29 import java.awt.dnd.*;
  30 
  31 import sun.lwawt.*;
  32 
  33 public class CPrinterDialogPeer extends LWWindowPeer {
  34     static {
  35         // AWT has to be initialized for the native code to function correctly.
  36         Toolkit.getDefaultToolkit();
  37     }
  38 
  39     Component fTarget;
  40 
  41     public CPrinterDialogPeer(CPrinterDialog target, PlatformComponent platformComponent,
  42                               PlatformWindow platformWindow)
  43     {
  44         super(target, platformComponent, platformWindow, LWWindowPeer.PeerType.DIALOG);
  45         //super(target);
  46         fTarget = target;
  47         super.initialize();
  48     }
  49 
  50     protected void disposeImpl() {
  51         LWCToolkit.targetDisposedPeer(fTarget, this);
  52     }
  53 
  54     public void setVisible(boolean visible) {
  55         if (visible) {
  56             new Thread(new Runnable() {
  57                 public void run() {
  58                     CPrinterDialog printerDialog = (CPrinterDialog)fTarget;
  59                     printerDialog.setRetVal(printerDialog.showDialog());
  60                     printerDialog.setVisible(false);
  61                 }
  62             }).start();
  63         }
  64     }