Beispiel #1
0
def find_public_methods(): 
    """
    retrieves all public methods of class
    """
    try:        
        fname=lisp.buffer_file_name()
        print "remember:" + lisp.buffer_name()
        os.environ['BUFFER'] = lisp.buffer_name()

        project = Project(fname)

        thing, start = thing_at_point(RIGHT3, LEFT3)
        thing = thing.replace(".","")
        print "thing:"+thing

        pos = lisp.point()
        type, foundpos = project.find_declaration_type(thing, fname, pos)

        typefile = project.find_file_for_thing(type, fname)
        c = Class(project, typefile)
        public_methods = c.list_all_public() 

        if (len(public_methods) == 0): 
            lisp.message("No public methods found")
        else:
            ready_output()    
            lisp.insert("\n")
            for item in public_methods:
                lisp.insert(item)
                lisp.insert("\n")
    except Exception, e:
        lisp.message(e)
Beispiel #2
0
def find_file_at_symbol():
    """
    finds file at point
    """
    fname=lisp.buffer_file_name()
    a = Project(fname)
    thing, start = thing_at_point(RIGHT1, LEFT1)
    file = a.find_file_for_thing(thing, fname)    
    lisp.message(file)
    lisp.find_file(file)
Beispiel #3
0
try:
    print a.find_prj_el("/tmp")
except Exception:
    print "exception raised"

print a.get_src_dir(currdir + "/./test")

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
print t.find_all_descendants("A")

print t.run_command('ls')

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
print t.find_file_for_thing("C", currdir + "/test/test/bla/B.java")

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
type, pos = t.find_declaration_type("anani", currdir + "/test/test/bla/B.java",
                                    423)

os.system("cp " + currdir + "/test/lib/commons-logging.jar /tmp/")
t = Project(currdir + "/./test")
print t.top_src_dir
t.unjar()

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
print t.find_file_for_thing("D", currdir + "/test/test/bla/B.java")
Beispiel #4
0
try:
    print a.find_prj_el("/tmp")
except Exception:
    print "exception raised"

print a.get_src_dir(currdir + "/./test")

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
print t.find_all_descendants("A")

print t.run_command('ls')

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
print t.find_file_for_thing("C", currdir + "/test/test/bla/B.java")

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
type, pos = t.find_declaration_type("anani", currdir + "/test/test/bla/B.java", 423)

os.system("cp " + currdir + "/test/lib/commons-logging.jar /tmp/")
t = Project(currdir + "/./test")
print t.top_src_dir
t.unjar()

t = Project(currdir + "/./test")
print "top src dir " + t.top_src_dir
print t.find_file_for_thing("D", currdir + "/test/test/bla/B.java")

s = "/home/burak/kod/pocketbudda/src/java/com/pocketbudda/UserHandlerBean.java"