public class APQHandlers
{
- protected static boolean setAPQHandlers = false;
-
public static boolean setAPQHandlers(GDesktop desktop)
{
FlatDesktop.setAboutHandler(() -> {
response.cancelQuit();
}
});
-
- setAPQHandlers = true;
-
- return setAPQHandlers;
+ // if we got to here, no exceptions occurred when we set the handlers.
+ return true;
}
}
*/
private void jbInit() throws Exception
{
+ boolean apqHandlersSet = false;
/**
* APQHandlers sets handlers for About, Preferences and Quit actions
* peculiar to macOS's application menu. APQHandlers will check to see if a
*/
try
{
- APQHandlers.setAPQHandlers(this);
+ apqHandlersSet = APQHandlers.setAPQHandlers(this);
} catch (Exception e)
{
System.out.println("Cannot set APQHandlers");
FileMenu.add(loadState);
FileMenu.addSeparator();
FileMenu.add(quit);
- if (!APQHandlers.setAPQHandlers)
+ if (!apqHandlersSet)
{
HelpMenu.add(aboutMenuItem);
}
HelpMenu.add(documentationMenuItem);
- if (!APQHandlers.setAPQHandlers)
+ if (!apqHandlersSet)
{
toolsMenu.add(preferences);
}