| 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 |
|
|
| |
|
| 43.5% |
Uncovered Elements: 13 (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 |
|
|
| |
|
| 40.9% |
Uncovered Elements: 13 (22) |
Complexity: 5 |
Complexity Density: 0.36 |
|
| 36 |
11 |
public static boolean setAPQHandlers(Desktop desktop)... |
| 37 |
|
{ |
| 38 |
11 |
if (Platform.isJS()) |
| 39 |
|
{ |
| 40 |
0 |
return false; |
| 41 |
|
} |
| 42 |
11 |
if (FlatDesktop.isSupported(Action.APP_ABOUT)) |
| 43 |
|
{ |
| 44 |
0 |
FlatDesktop.setAboutHandler(() -> { |
| 45 |
0 |
desktop.aboutMenuItem_actionPerformed(null); |
| 46 |
|
}); |
| 47 |
0 |
setAbout = true; |
| 48 |
|
} |
| 49 |
11 |
if (FlatDesktop.isSupported(Action.APP_PREFERENCES)) |
| 50 |
|
{ |
| 51 |
0 |
FlatDesktop.setPreferencesHandler(() -> { |
| 52 |
0 |
desktop.preferences_actionPerformed(null); |
| 53 |
|
}); |
| 54 |
0 |
setPreferences = true; |
| 55 |
|
} |
| 56 |
11 |
if (FlatDesktop.isSupported(Action.APP_QUIT_HANDLER)) |
| 57 |
|
{ |
| 58 |
0 |
QuitHandler.setQuitHandler(); |
| 59 |
0 |
setQuit = true; |
| 60 |
|
} |
| 61 |
|
|
| 62 |
11 |
return setAbout || setPreferences || setQuit; |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
} |