Duplicate .java file in Eclipse
eclipse, java, swing
Solution
In an Explorer view, select a file, right click and choose Copy. Now select the folder it's in, right click and choose Paste. You'll get a dialog asking for a new name, and you're done. Note that if you do this to a Java class, the new name will be used to rename the class in the file as well.
Problem
I'm looking for something like the refactoring function in Eclipse but for copying files, i.e. I want to keep the existing file, but add another one (typically an enum or similar). Currently I do this by manually copying the file in the file system, then refreshing the folder in Project Explorer, then opening the file through Project Explorer, then search 'n replace, then I can start working. It can be a bit tedious as I often do this for 10+ files when I add a new major feature.