public void projectOpened(final Project project) {
   if (ApplicationManager.getApplication().isHeadlessEnvironment()) return;
   String path = getProjectPath(project);
   if (path != null) {
     markPathRecent(path);
   }
   SystemDock.updateMenu();
 }
 public void projectClosed(final Project project) {
   Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
   if (openProjects.length > 0) {
     String path = getProjectPath(openProjects[openProjects.length - 1]);
     if (path != null) {
       markPathRecent(path);
     }
   }
   SystemDock.updateMenu();
 }