Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simplifying fully qualified names in Eclipse

Does someone know a plugin for Eclipse that replaces fully qualified Java class names with the simple one and the corresponding import where possible? It would be even better if it could be performed as a Save Action.

like image 579
thSoft Avatar asked Apr 15 '10 10:04

thSoft


People also ask

What is a qualified method name in Java?

A qualified name consists of a name, a " . " token, and an identifier. In determining the meaning of a name (§6.5), the Java language takes into account the context in which the name appears. It distinguishes among contexts where a name must denote (refer to) a package (§6.5.


2 Answers

No. But you can use Add Import command (Ctrl+Shift+M) on each fully qualified identifier to convert it to an import + a short name.

like image 94
Thorbjørn Ravn Andersen Avatar answered Sep 27 '22 02:09

Thorbjørn Ravn Andersen


Here's a plugin offering this functionality called Clean Qualified Types Plugin (CQTP): http://blog.mi-ernst.de/projekte/

like image 23
thSoft Avatar answered Sep 26 '22 02:09

thSoft