Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log browser exception rather than print stack trace #36

Open
github-actions bot opened this issue Jan 4, 2021 · 0 comments
Open

log browser exception rather than print stack trace #36

github-actions bot opened this issue Jan 4, 2021 · 0 comments
Labels
todo Needs to be done todo-log TODO related to logging

Comments

@github-actions
Copy link

github-actions bot commented Jan 4, 2021

log browser exception rather than print stack trace

// TODO log browser exception rather than print stack trace

        
        // create and set tray icon's popup menu
        useSwingPopupMenu();
        // useAWTPopupMenu();
        
        // set about and quit initial menu item action handlers
        setInitialAboutActionHandler();
        setInitialQuitActionHandler();
    }
    
    /**  */
    private void useSwingPopupMenu() { popupMenu = new SwingPopupMenu(trayIcon); }
    
    /**  */
    private void useAWTPopupMenu() {
        popupMenu = new AWTPopupMenu();
        trayIcon.setPopupMenu((PopupMenu) popupMenu.getPopupMenu());
    }
    
    /** Initial about handler opens aboutUri in a browser. */
    private void setInitialAboutActionHandler() {
        popupMenu.setOnAboutSelected(action -> {
            try {
                Desktop.getDesktop().browse(aboutUri);
            } catch (IOException e) {
                // TODO log browser exception rather than print stack trace
                e.printStackTrace();
            }
        });
    }
    
    /** Initial quit handler exits JavaFX and removes icon from system tray. */
    private void setInitialQuitActionHandler() {
        popupMenu.setOnQuitSelected(action -> {
            System.out.println("Quit was selected");
            
            // exit JavaFX and remove system tray icon
            Platform.exit();
            tray.remove(trayIcon);
            System.exit(0);
        });
    }
    
    /**

56b59b05436a4b065ece052ac3313ab10c3a1088

@github-actions github-actions bot added the todo Needs to be done label Jan 4, 2021
@jhenly jhenly added the todo-log TODO related to logging label Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
todo Needs to be done todo-log TODO related to logging
Projects
None yet
Development

No branches or pull requests

1 participant