public void updateActions(int delta) {
boolean areWindowsOpen = desktop.getAllFrames().length + delta > 0;
actionFactory.getSelectAllAction().setEnabled(areWindowsOpen);
Menu mainMenu = ((Menu) getJMenuBar());
mainMenu.getFileMenu().getSaveSessionMenuItem()
.setEnabled(areWindowsOpen);
mainMenu.getEditMenu().setEnabled(areWindowsOpen);
mainMenu.getWindowMenu().setEnabled(areWindowsOpen);
}