Archive for the ‘plugin’ Category
Eclipse: Copy Qualified Java Name
Eclipse has a nice feature to copy qualified name from a resource and this is very useful to create documentation or working with XML. For example:
Say that I need the full qualified name from class CaseFormat. What I have to do is:
- Click on + beside CaseFormat.java.
- Right click on CaseFormat (not CaseFormat.java).
- Select Copy Qualified Name.
- There you go, you can paste the full qualified name of class CaseFormat anywhere you want.
But that’s kind of a lot of steps, isn’t it?
OK… you can create a keyboard shortcut for Copy Qualified Name but still you have to expand CaseFormat.java before you can do that. If you don’t expand the *.java node what you’ll get is: ‘/guava/src/com/google/common/base/CaseFormat.java’ instead of ‘com.google.common.base.CaseFormat’.
This problem is kind of annoying and if you have to do this a lot of time, will certainly damage your productivity.
So here is a tiny plugin to solve the problem.
com.satukubik.copyqualifiedname_1.0.0
You can download it, save it to your dropins folder, and restart Eclipse. After that a shortcut Ctrl+Shift+C is available for you to copy qualified java name without having to expand the *.java node.
For those who are curious, I’ve put the source code of the plugin here: http://code.google.com/a/eclipselabs.org/p/copyqualifiedjavaname/. Feel free to clone, suggest improvement, or report a bug.
Related posts:
- My top Eclipse keyboard shortcut
- Eclipse plugin: Introduce Static Imports
- Maven Plugin: Java Code Formatter
Eclipse: Copy Qualified Java Name originally appeared on satukubik on May 26, 2010.