示例#1
0
 def testStaticJavaMethods(self):
     """ Instances of Java classes should not show static methods as completion choices. """
     static_methods = jintrospect.getAutoCompleteList(
         "String", {"String": String})
     self.assert_("valueOf" in static_methods,
                  "'valueOf' missing from static method list")
     instance_methods = jintrospect.getAutoCompleteList(
         "s", {"s": String("Test")})
     self.assert_("valueOf" not in instance_methods,
                  "'valueOf' should not be in the instance method list")
示例#2
0
    def showPopup(self, event=None):
        """show code completion popup"""

        try:
            line = self.getText()
            list = jintrospect.getAutoCompleteList(line, self.locals, includeSingle=self.include_single_underscore_methods, includeDouble=self.include_double_underscore_methods)
            if len(list) > 0:
                self.popup.showMethodCompletionList(list, self.getDisplayPoint())

        except Exception, e:
            pass
示例#3
0
    def showPopup(self, event=None):
        """show code completion popup"""

        try:
            line = self.getText()
            list = jintrospect.getAutoCompleteList(line, self.locals, includeSingle=self.include_single_underscore_methods, includeDouble=self.include_double_underscore_methods)
            if len(list) > 0:
                self.popup.showMethodCompletionList(list, self.getDisplayPoint())

        except Exception, e:
            print >> sys.stderr, "Error getting completion list: ", e
示例#4
0
文件: console.py 项目: omusico/siga
    def showPopup(self, event=None):

        line = self.getinput()
        # this is silly, I have to add the '.' and the other code removes it.
        line = line[:-1]  # remove \n
        line = line + "."
        # print >> sys.stderr, "line:",line

        # TODO get this code into Popup
        # TODO handle errors gracefully
        try:
            list = jintrospect.getAutoCompleteList(line, self.locals)
        except Exception, e:
            # TODO handle this gracefully
            print >>sys.stderr, e
            return
示例#5
0
    def showPopup(self, event=None):

        line = self.getinput()
        # this is silly, I have to add the '.' and the other code removes it.
        line = line[:-1]  # remove \n
        line = line + '.'
        #print >> sys.stderr, "line:",line

        # TODO get this code into Popup
        # TODO handle errors gracefully
        try:
            list = jintrospect.getAutoCompleteList(line, self.locals)
        except Exception, e:
            # TODO handle this gracefully
            print >> sys.stderr, e
            return
 def testJavaAccessorAsProperty(self):
     instance_methods = jintrospect.getAutoCompleteList("s", {"s" : String("Test")})
     self.assert_("class" in instance_methods, "'class' property should be in the instance method list")
 def testStaticJavaMethods(self):
     """ Instances of Java classes should not show static methods as completion choices. """
     static_methods = jintrospect.getAutoCompleteList("String", {"String" : String})
     self.assert_("valueOf" in static_methods, "'valueOf' missing from static method list")
     instance_methods = jintrospect.getAutoCompleteList("s", {"s" : String("Test")})
     self.assert_("valueOf" not in instance_methods, "'valueOf' should not be in the instance method list")
 def testAutoCompleteString(self):
     f = "foo"
     list = jintrospect.getAutoCompleteList("f", locals())
     self.assert_(len(list) > 0)
     self.assert_(list.index("startswith") > 0)
示例#9
0
 def testAutoCompleteString(self):
     f = "foo"
     list = jintrospect.getAutoCompleteList("f", locals())
     self.assert_(len(list) > 0)
     self.assert_(list.index("startswith") > 0)
示例#10
0
 def testJavaAccessorAsProperty(self):
     instance_methods = jintrospect.getAutoCompleteList(
         "s", {"s": String("Test")})
     self.assert_("class" in instance_methods,
                  "'class' property should be in the instance method list")
示例#11
0
 def testStaticPropertyFromAncestorInterface(self):
     from javax.xml.transform.stream import StreamResult
     list = jintrospect.getAutoCompleteList("StreamResult", locals())
     self.assert_(len(list) > 0)
     self.assert_(list.index("PI_ENABLE_OUTPUT_ESCAPING") > -1)
 def testStaticCompletion(self):
     from java.util import Calendar
     list = jintrospect.getAutoCompleteList("Calendar", locals())
     self.assert_(len(list) > 0)
     self.assert_(list.index("getInstance") > -1)
示例#13
0
 def testStaticCompletion(self):
     from java.util import Calendar
     list = jintrospect.getAutoCompleteList("Calendar", locals())
     self.assert_(len(list) > 0)
     self.assert_(list.index("getInstance") > -1)
示例#14
0
 def testStaticAutoComplete(self):
     from java.util.logging import Level
     list = jintrospect.getAutoCompleteList("Level", locals())
     self.assertEquals(10, len(list))
     self.assert_(list.index("INFO") > -1)
示例#15
0
 def testStaticMethodFromAncestor(self):
     from javax.swing.border import EtchedBorder
     list = jintrospect.getAutoCompleteList("EtchedBorder", locals())
     #print list
     self.assert_(len(list) > 0)
     self.assert_(list.index("getInteriorRectangle") > -1)
 def testGetAutoCompleteList(self):
     s = String("Unit Test")
     list = jintrospect.getAutoCompleteList("s", locals())
     self.assertNotEmpty(list)
     self.assertContains(list, "contains")
示例#17
0
 def testGetAutoCompleteList(self):
     s = String("Unit Test")
     list = jintrospect.getAutoCompleteList("s", locals())
     self.assertNotEmpty(list)
     self.assertContains(list, "contains")
示例#18
0
 def testStaticPropertyFromAncestor(self):
     from javax.swing import JButton
     list = jintrospect.getAutoCompleteList("JButton", locals())
     self.assert_(len(list) > 0)
     self.assert_(list.index("TEXT_CHANGED_PROPERTY") > -1)