1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.gui; |
22 |
|
|
23 |
|
import com.formdev.flatlaf.extras.FlatDesktop; |
24 |
|
import com.formdev.flatlaf.extras.FlatDesktop.Action; |
25 |
|
|
26 |
|
import jalview.util.Platform; |
27 |
|
|
|
|
| 0% |
Uncovered Elements: 23 (23) |
Complexity: 5 |
Complexity Density: 0.36 |
|
28 |
|
public class APQHandlers |
29 |
|
{ |
30 |
|
public static boolean setAbout = false; |
31 |
|
|
32 |
|
public static boolean setPreferences = false; |
33 |
|
|
34 |
|
public static boolean setQuit = false; |
35 |
|
|
|
|
| 0% |
Uncovered Elements: 22 (22) |
Complexity: 5 |
Complexity Density: 0.36 |
|
36 |
0 |
public static boolean setAPQHandlers(Desktop desktop)... |
37 |
|
{ |
38 |
0 |
if (Platform.isJS()) |
39 |
|
{ |
40 |
0 |
return false; |
41 |
|
} |
42 |
0 |
if (FlatDesktop.isSupported(Action.APP_ABOUT)) |
43 |
|
{ |
44 |
0 |
FlatDesktop.setAboutHandler(() -> { |
45 |
0 |
desktop.aboutMenuItem_actionPerformed(null); |
46 |
|
}); |
47 |
0 |
setAbout = true; |
48 |
|
} |
49 |
0 |
if (FlatDesktop.isSupported(Action.APP_PREFERENCES)) |
50 |
|
{ |
51 |
0 |
FlatDesktop.setPreferencesHandler(() -> { |
52 |
0 |
desktop.preferences_actionPerformed(null); |
53 |
|
}); |
54 |
0 |
setPreferences = true; |
55 |
|
} |
56 |
0 |
if (FlatDesktop.isSupported(Action.APP_QUIT_HANDLER)) |
57 |
|
{ |
58 |
0 |
QuitHandler.setQuitHandler(); |
59 |
0 |
setQuit = true; |
60 |
|
} |
61 |
|
|
62 |
0 |
return setAbout || setPreferences || setQuit; |
63 |
|
} |
64 |
|
|
65 |
|
} |