@Override public boolean ensureProjectSaved(IGanttProject project){
  if (project.isModified()) {
    UIFacade.Choice saveChoice=myWorkbenchFacade.showConfirmationDialog(i18n.getText("msg1"),i18n.getText("warning"));
    if (UIFacade.Choice.CANCEL == saveChoice) {
      return false;
    }
    if (UIFacade.Choice.YES == saveChoice) {
      try {
        saveProject(project);
        return !project.isModified();
      }
 catch (      Exception e) {
        myWorkbenchFacade.showErrorDialog(e);
        return false;
      }
    }
  }
  return true;
}

@ Override public boolean ensureProjectSaved ( IGanttProject project ) { if ( project . isModified ( ) ) { UIFacade . Choice saveChoice = myWorkbenchFacade . showConfirmationDialog ( i18n . getText ( "msg1" ) , i18n . getText ( "warning" ) ) ; if ( UIFacade . Choice . CANCEL == saveChoice ) { return false ; } if ( UIFacade . Choice . YES == saveChoice ) { try { saveProject ( project ) ; return ! project . isModified ( ) ; } catch ( Exception e ) { myWorkbenchFacade . showErrorDialog ( e ) ; return false ; } } } return true ; }
check if the project has been modified , before creating or opening another project
