56 // don't use checkCreation() from WComponentPeer to avoid hwnd check
57 protected void checkCreation() {
58 }
59
60 protected void disposeImpl() {
61 WToolkit.targetDisposedPeer(target, this);
62 }
63
64 private native boolean _show();
65
66 public void show() {
67 new Thread(new Runnable() {
68 public void run() {
69 try {
70 ((WPrintDialog)target).setRetVal(_show());
71 } catch (Exception e) {
72 // No exception should be thrown by native dialog code,
73 // but if it is we need to trap it so the thread does
74 // not hide is called and the thread doesn't hang.
75 }
76 ((WPrintDialog)target).hide();
77 }
78 }).start();
79 }
80
81 synchronized void setHWnd(long hwnd) {
82 this.hwnd = hwnd;
83 for (WWindowPeer window : blockedWindows) {
84 if (hwnd != 0) {
85 window.modalDisable((Dialog)target, hwnd);
86 } else {
87 window.modalEnable((Dialog)target);
88 }
89 }
90 }
91
92 synchronized void blockWindow(WWindowPeer window) {
93 blockedWindows.add(window);
94 if (hwnd != 0) {
95 window.modalDisable((Dialog)target, hwnd);
96 }
|
56 // don't use checkCreation() from WComponentPeer to avoid hwnd check
57 protected void checkCreation() {
58 }
59
60 protected void disposeImpl() {
61 WToolkit.targetDisposedPeer(target, this);
62 }
63
64 private native boolean _show();
65
66 public void show() {
67 new Thread(new Runnable() {
68 public void run() {
69 try {
70 ((WPrintDialog)target).setRetVal(_show());
71 } catch (Exception e) {
72 // No exception should be thrown by native dialog code,
73 // but if it is we need to trap it so the thread does
74 // not hide is called and the thread doesn't hang.
75 }
76 ((WPrintDialog)target).setVisible(false);
77 }
78 }).start();
79 }
80
81 synchronized void setHWnd(long hwnd) {
82 this.hwnd = hwnd;
83 for (WWindowPeer window : blockedWindows) {
84 if (hwnd != 0) {
85 window.modalDisable((Dialog)target, hwnd);
86 } else {
87 window.modalEnable((Dialog)target);
88 }
89 }
90 }
91
92 synchronized void blockWindow(WWindowPeer window) {
93 blockedWindows.add(window);
94 if (hwnd != 0) {
95 window.modalDisable((Dialog)target, hwnd);
96 }
|