Kai Grossjohann writes:
 > Create a file A.java with the following contents:
 > 
 > public class A {
 >     public static int main(String[] args)
 >     {
 >         A a = new A();
 >         a.@
 >     }
 > }
 > 
 > Position point on "@", delete the character, then hit C-c C-v . and
 > observe how it adds "import org.apache.ecs.xhtml.a;" to the beginning
 > of the file.

Because there is a class named a on hyour classpath, the JDEE assumes
that you are trying to complete a static member of that class and
therefore creates an import statement for class a. As it is unlikely
that you will ever intend to use class a in your programs, you can
easily deal with this problem by excluding the org.apache.ecs class
from importation via jde-import-excluded-classes.


 > 
 > Or this one: create a file Action.java that looks like this:
 > 
 > public class Action {
 >     public int foo() {
 >         return 42;
 >     }
 > }
 > 
 > Then create a file BTest.java that looks like this:
 > 
 > public class BTest extends Action {
 >     public int bar() {
 >         return this.
 >     }
 > }
 > 
 > Then position point after "this." and invoke jde-complete (in one of
 > its flavors).  Observe how it adds an import statement for
 > javax.swing.Action.

This is because javax.swing.Action is the only class on the classpath
at this point. Compile your Action class and then retry the completion.
The JDEE should then prompt you to choose one of the Action classes
to import.

Paul

 > 
 > Is it pilot error?
 > 
 > Is it just me?
 > 
 > Kai
 > 
 > PS: Using jde 2.3.4 on GNU Emacs 21.3.50.1 (i386-pc-linux-gnu, X
 >     toolkit, Xaw3d scroll bars) of 2004-11-02 on ketchup, modified by
 >     Debian.
 > 

Reply via email to