public ProjectNode(
      TopLinkSessionsAdapter topLinkSessions,
      TreeNodeValueModel parent,
      SCPlugin plugin,
      ApplicationContext context) {

    super(topLinkSessions, parent, plugin, context);
    this.firstTimeReadOnlyFlagWasDetected = topLinkSessions.getPath().canWrite();
  }
  public boolean save(File mostRecentSaveDirectory, WorkbenchContext workbenchContext) {
    TopLinkSessionsAdapter sessions = this.topLinkSessions();
    File path = sessions.getPath();
    boolean saved = false;

    // - There is no directory before the file name and it starts with Sessions,
    //   we assume this is an untitled sessions.xml
    // - The location might have been marked read only, always do a Save As
    if (path.getPath().startsWith(SCSessionsPropertiesManager.UNTITLED_FILE_NAME)) {
      saved = saveAs(mostRecentSaveDirectory, workbenchContext);
    } else {
      // The Read-Only flag was changed after the file was opened
      if (!path.canWrite()) {
        // Show an error message and ask if we should try again
        if (firstTimeReadOnlyFlagWasDetected) {
          showErrorReadOnlyMessage(workbenchContext);
          firstTimeReadOnlyFlagWasDetected = false;

          // We can try to save again, use Save As path
          if (canRetryToSave(workbenchContext)) {
            saved = saveAs(mostRecentSaveDirectory, workbenchContext);

            if (saved) {
              displayStringChanged();
            }
          }
        }
        // - A Read-Only file was opened and needs to be saved
        // - The save is invoked again on a Read-Only file, right away use the Save As path
        else {
          saved = saveAs(mostRecentSaveDirectory, workbenchContext);
        }
      }
      // The file is not an untitled file, the file is not marked as Read-Only
      // then attempt to save it
      else {
        saved = saveImp(path, workbenchContext);
        firstTimeReadOnlyFlagWasDetected = false;

        if (saved) {
          displayStringChanged();
        }
      }
    }
    return saved;
  }