author | mli |
Wed, 23 May 2018 14:21:14 +0800 | |
changeset 50230 | cae567ae015d |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
34796
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
1 |
/* |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
2 |
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
4 |
* |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
8 |
* |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
13 |
* accompanied this code). |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
14 |
* |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
18 |
* |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
21 |
* questions. |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
22 |
*/ |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
23 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
24 |
import javax.swing.JComponent; |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
25 |
import javax.swing.plaf.ComponentUI; |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
26 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
27 |
/* |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
28 |
* @test |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
29 |
* @bug 8131754 |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
30 |
* @summary Tests JComponent encoding |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
31 |
*/ |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
32 |
public final class javax_swing_JComponent extends AbstractTest<JComponent> { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
33 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
34 |
public static void main(final String[] args) { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
35 |
new javax_swing_JComponent().test(true); |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
36 |
} |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
37 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
38 |
protected JComponent getObject() { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
39 |
return new SimpleJComponent(); |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
40 |
} |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
41 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
42 |
protected JComponent getAnotherObject() { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
43 |
return new CustomJComponent(); |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
44 |
} |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
45 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
46 |
public static final class SimpleJComponent extends JComponent { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
47 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
48 |
} |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
49 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
50 |
public static final class CustomJComponent extends JComponent { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
51 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
52 |
public CustomJComponent() { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
53 |
ui = new CustomUI(); |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
54 |
} |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
55 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
56 |
@Override |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
57 |
public ComponentUI getUI() { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
58 |
return ui; |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
59 |
} |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
60 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
61 |
@Override |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
62 |
public void setUI(final ComponentUI newUI) { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
63 |
ui = newUI; |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
64 |
} |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
65 |
} |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
66 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
67 |
public static final class CustomUI extends ComponentUI { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
68 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
69 |
public boolean getFlag() { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
70 |
throw new Error(); |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
71 |
} |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
72 |
|
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
73 |
public void setFlag(final boolean flag) { |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
74 |
throw new Error(); |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
75 |
} |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
76 |
} |
2e3991b65560
8131754: AquaTreeUI.getCollapsedIcon() issue reported in java beans tests with a modular build
serb
parents:
diff
changeset
|
77 |
} |