Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » avoiding import statements while implementing interfaces in classes
avoiding import statements while implementing interfaces in classes [message #292191] Fri, 30 September 2005 05:15 Go to next message
Eclipse UserFriend
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
Re: avoiding import statements while implementing interfaces in classes [message #292192 is a reply to message #292191] Fri, 30 September 2005 07:23 Go to previous messageGo to next message
Eclipse UserFriend
This is probably best asked in the eclipse.tools.jdt group.

PW
Re: avoiding import statements while implementing interfaces in classes [message #292196 is a reply to message #292192] Fri, 30 September 2005 09:01 Go to previous message
Eclipse UserFriend
Hi,

I've posted it there also. I'll keep checking at both places. I hope
someone gives me the solution.

Sushma
Previous Topic:EditorPart - isDirty method
Next Topic:Change in FTP Support from Eclipse 2.1 to 3.1?
Goto Forum:
  


Current Time: Thu Sep 25 11:24:53 EDT 2025

Powered by FUDForum. Page generated in 0.04015 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top