author | serb |
Tue, 01 Oct 2019 10:28:12 -0700 | |
changeset 58597 | 4ff14948c6a1 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
12047 | 1 |
/* |
16892 | 2 |
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. |
12047 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
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 |
{ |
|
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
12047
diff
changeset
|
44 |
super(target, platformComponent, platformWindow, LWWindowPeer.PeerType.DIALOG); |
12047 | 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) { |
|
29922 | 56 |
Runnable task = () -> { |
57 |
CPrinterDialog printerDialog = (CPrinterDialog)fTarget; |
|
58 |
printerDialog.setRetVal(printerDialog.showDialog()); |
|
59 |
printerDialog.setVisible(false); |
|
60 |
}; |
|
37550
c8252b8fea3d
8147544: Remove sun.misc.ManagedLocalsThread from java.desktop
prr
parents:
31653
diff
changeset
|
61 |
new Thread(null, task, "PrintDialog", 0, false).start(); |
12047 | 62 |
} |
63 |
} |
|
64 |
||
65 |
// unused methods. |
|
66 |
public void toFront() {} |
|
67 |
public void toBack() {} |
|
68 |
public void setResizable(boolean resizable) {} |
|
69 |
public void setEnabled(boolean enable) {} |
|
70 |
public void setBounds(int x, int y, int width, int height) {} |
|
43722
25ba19c20260
8143077: Deprecate InputEvent._MASK in favor of InputEvent._DOWN_MASK
serb
parents:
37550
diff
changeset
|
71 |
@SuppressWarnings("deprecation") |
12047 | 72 |
public boolean handleEvent(Event e) { return false; } |
73 |
public void setForeground(Color c) {} |
|
74 |
public void setBackground(Color c) {} |
|
75 |
public void setFont(Font f) {} |
|
76 |
public boolean requestFocus(boolean temporary, boolean focusedWindowChangeAllowed) { |
|
77 |
return false; |
|
78 |
} |
|
79 |
void start() {} |
|
80 |
void invalidate(int x, int y, int width, int height) {} |
|
81 |
public void addDropTarget(DropTarget dt) {} |
|
82 |
public void removeDropTarget(DropTarget dt) {} |
|
83 |
||
84 |
// 1.5 peer method |
|
85 |
public boolean isRestackSupported() { |
|
86 |
return false; |
|
87 |
} |
|
88 |
||
89 |
// 1.6 peer method |
|
16892 | 90 |
public void updateAlwaysOnTopState() { |
12047 | 91 |
// no-op, since we just show the native print dialog |
92 |
} |
|
93 |
||
94 |
// 1.6 peer method |
|
95 |
public void updateMinimumSize() {} |
|
96 |
||
97 |
// 1.6 peer method |
|
98 |
public void setModalBlocked(Dialog blocker, boolean blocked) { |
|
99 |
// I don't think we care since this is a native dialog |
|
100 |
} |
|
101 |
||
102 |
// 1.6 peer method |
|
103 |
public void updateFocusableWindowState() {} |
|
104 |
} |