title: Hook to Save Action in Eclipse plugin
body: <p>I want to create a Google Closure Compiler plugin for Eclipse. I already have a popup menu entry to compile a JavaScript file to its minified version. But it would be more than helpful if every time you save a <code>*.js</code> that minified version would be generated automatically. I read/heard about natures and builders, extension points and <code>IResourceChangeListener</code>. But I did not manage to figure out what I should use and especially how to get it to work.</p>
  
  <p>Is there a working example of a plugin that does "the same kind of thing" so I can work from that or a tutorial to write such?</p>
  
  <p>With the answer below I searched for projects that use the <code>IResourceChangeListener</code> and came up with this code:</p>
  
  <p>Manifest: <a href="http://codepaste.net/3yahwe" rel="nofollow noreferrer">http://codepaste.net/3yahwe</a></p>
  
  <p><code>plugin.xml</code>: <a href="http://codepaste.net/qek3rw" rel="nofollow noreferrer">http://codepaste.net/qek3rw</a></p>
  
  <p>Activator: <a href="http://codepaste.net/s7xowm" rel="nofollow noreferrer">http://codepaste.net/s7xowm</a></p>
  
  <p>DummyStartup: <a href="http://codepaste.net/rkub82" rel="nofollow noreferrer">http://codepaste.net/rkub82</a></p>
  
  <p>MinifiedJavascriptUpdater: <a href="http://codepaste.net/koweuh" rel="nofollow noreferrer">http://codepaste.net/koweuh</a></p>
  
  <p>There in the <code>MinifiedJavascriptUpdater.java</code> which holds the code for the <code>IResourceChangeListener</code> the <code>resourceChanged()</code> function is never reached.</p>