SourceForge has been redesigned. Learn more.
Close

code completion for java core classes

cichlasoma
2007-10-24
2013-03-15
  • cichlasoma

    cichlasoma - 2007-10-24

    well, nobody answering my question, i don't know whether it's too sily or whether nobody notices it, so i tryvto make a new thread of it.

    should the following code completion work?

    import javax.swing 
    from javax.swing import * 

    #b=JB/ctrl+space -> JButton - ok/ 
    b=JButton() 
    #b./nothing offered, ctrl+space -> "BEEP"/ 
    #JButton./nothing offered, ctrl+space -> "BEEP"/

     
    • Fabio Zadrozny

      Fabio Zadrozny - 2007-10-25

      It's hard for me to answer because I'm working in the cvs head, and I don't really have that version installed anymore (I know it works in the cvs -- because that's the specific area I've been working on).

      So, anyone else can answer it?

      Cheers,

      Fabio

       
    • cichlasoma

      cichlasoma - 2007-10-25

      thanks for the answer, Fabio!

       
    • Byron Foster

      Byron Foster - 2007-11-08

      works for me in 1.3.10.  However,  I can't get project libraries and classes to complete, still working on that.

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2007-11-08

        Can't you get JButton, JFrame, etc? That should work... try removing and setting your jython interpreter again (just to be sure it's not some cache issue with the previous interpreter).

         
        • Byron Foster

          Byron Foster - 2007-11-08

          Hello Fabio, Yes, JButton, JFrame etc, DO work. Everything in the system path works such as rt.jar. I am partially mistaken, I can also get project libraries to work (libraries added through the project's PYTHONPATH) now with 1.3.10, Nice!  However, I can't get class files to work out of a diretory even though I add the base directory using the 'Add source folders' dialog. So, for example I have the classic exploded WAR directory hierarchy with all my source files compiled to WEB-INF/classes, however, even though I include this path in PYTHONPATH, classes in this directory do not complete.  I understand that changes to classes in this directory would not dynamically update and would require a restart of the jython process.  It would also be nice if packages completed out side the context of an import statement, for example if have the following:

          from org.apache.velocity import app

          then if I type:
          app.

          The period would complete classes and further sub-packages of org.apache.velocity.app, which is already the behavior when typing packages for an import.

           
          • Fabio Zadrozny

            Fabio Zadrozny - 2007-11-09

            Pydev is currently in the process of integrating Java support with JDT (http://pydev.blogspot.com/), and this part of the integration is still not complete (after it's implemented you should create a java project for that and configure it for getting those completions), so, this is currently a work in progress (and unfortunately this won't work for now).

            The option would be having a way of creating a jar with your classes and adding it to the pythonpath (until that integration is finished).

            Cheers,

            Fabio

             
            • Byron Foster

              Byron Foster - 2007-11-15

              I tried jarring up the classes directory and adding the jar to the pythonpath.  Strangely, it partially worked, I can complete static members of classes, but regular methods don't show up in the completion list.  I also tried adding the jar to the system path with the same results.  Strange since regular method completion works for classes in the java runtime library.  I'm still looking into it.