title: Netbeans API: How to save a file, or all files in the current project?
body: <p>I'm developing a plugin module for Netbeans using the provided API in order to provide support for a new programming language.</p>
  
  <p>I've created an Action in the Context Menu, using the MIME-type defined in a File Type.</p>
  
  <p>I looking for a method to save the file that's being selected. Preferably only if it's changed.</p>
  
  <p>Also is it possible to save all the changes in all the files of the project?</p>
  
  <p>Part of my code from the Action Listener class:</p>
  
  <pre><code>    @Override
      public void actionPerformed(ActionEvent ev) {
          FileObject f = context.getPrimaryFile();
          String path = f.getPath();     
          String name = f.getName();
  
          //Save file here
  
          ExecutionDescriptor descriptor = new ExecutionDescriptor()
                  .controllable(true)
                  .frontWindow(true)
                  .preExecution(before)
                  .postExecution(after);
          ExecutionService exeService = ExecutionService.newService(
                  new ProcessLaunch(cmdLine),
                  descriptor, "Run " + name);
          Future&lt;Integer&gt; exitCode = exeService.run();
  
      } 
  </code></pre>