Fritz Duchardt
Fritz Duchardt

Reputation: 11880

Intellij IDEA copy package + class name for Spring application config

Is there a quick way to copy class package + name to the clip board, e.g.

de.mypackage.unit.HelloWorld

As a Spring developer I need this on a regular basis to define beans in the application-context.xml and I find myself copy and pasting the stuff manually this wasting valuable seconds.

I am aware of Ctrl + Alt + Shift + c to copy class references, but the format is not quite right:

de/mypackage/unit/HelloWorld.java:73

Upvotes: 3

Views: 1636

Answers (2)

leo
leo

Reputation: 3684

"Copy Reference" puts multiple formats to the clipboard. At least that's what I presume after a quick test. IIRC, this behaviour changed some month ago.

  • Pasting into a javadoc comment section puts the fully qualified class or method name.
  • Pasting somewhere else in the file, or into another application, only gives you the class or method name.

Upvotes: 1

yole
yole

Reputation: 97168

If you put your caret on the class name, the "Copy Reference" action (Ctrl-Alt-Shift-C) will put exactly what you need into the clipboard.

Note that IntelliJ IDEA supports class name completion in application-context.xml as well.

Upvotes: 1

Related Questions