title: How to refactor a static inner class to a top level class in Eclipse?
body: <p>I am having trouble finding the correct refactor option for the following scenario:</p>
  
  <p>I have code like this (in Outer.java):</p>
  
  <pre><code>public class Outer {
  
      // ... class stuff
  
      public static class Inner {
          // ... inner class stuff   
      }
  }
  </code></pre>
  
  <p>I am looking for a way to select Inner, and have it converted to a top level class, in it's own <code>.java</code> source file. I know this is pretty easy to do manually with copy/paste etc., but the inner class is referenced in a lot of places, and I would like the refactor option to handle the change everywhere it is referenced.</p>
  
  <p>I have tried the option <code>Refactor -&gt; Extract Class...</code> but that does something weird with a field called <code>data</code> that I don't quite understand.</p>
  
  <p>Eclipse version is 3.5.1 Galileo.</p>
  
  <p>How do I refactor a static inner class to be a top level class?</p>
  
  <hr>
  
  <p>Edit: Can't believe I overlooked the option to do this. Thanks for all your correct answers, +1 to you all. I'll still need to accept an answer, so if there is any more useful info, e.g. gotchas with the script, there is still a purpose to leaving an answer.</p>