avoiding import statements while implementing interfaces in classes [message #292191] |
Fri, 30 September 2005 05:15  |
Eclipse User |
|
|
|
Hi Everyone,
My requirement is to not have any import statements in my code. I've
searched the forums and I found the following solution.
To use Windows-> Preferences-> Java-> editor-> Code assist -> "Add import
instead of qualified name".
This works fine until I try to add some unimplemented methods in classes
which implement some interfaces. In those interfaces, the full name is
given. Check the example.
--------------------------------------------------------
public interface someInterface {
public String getResponse(com.xxx.yyy.userClass instance);
}
public someClass implements com.xxx.yyy.someInterface
{
// By this time the yellow bulb appears and says to add unimplemented
//methods. If I
add them then it comes in the following way with an import //statement at
the top of the class (import com.xxx.yyy.userClass)
public String getResponse("userClass" instance) {
}
}
--------------------------------------------------------
I want the method to appear in the following way. Just the way I added it
in the interface.
--------------------------------------------------------
public String getResponse("com.xxx.yyy.userClass" instance) {
}
(I've added double quotes to distinguish between the signatures).
Everytime removing the import statement and adding the full name is
difficult. I want it to be done automatically.
Can anyone suggest something? Any help would be definitely welcome.
Thanks in advance,
Sushma
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04704 seconds