Exemplo n.º 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")
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 4
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
Exemplo n.º 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")
Exemplo n.º 8
0
 def testAutoCompleteString(self):
     f = "foo"
     list = jintrospect.getAutoCompleteList("f", locals())
     self.assert_(len(list) > 0)
     self.assert_(list.index("startswith") > 0)
Exemplo n.º 9
0
 def testAutoCompleteString(self):
     f = "foo"
     list = jintrospect.getAutoCompleteList("f", locals())
     self.assert_(len(list) > 0)
     self.assert_(list.index("startswith") > 0)
Exemplo n.º 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")
Exemplo n.º 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)
Exemplo n.º 12
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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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")
Exemplo n.º 17
0
 def testGetAutoCompleteList(self):
     s = String("Unit Test")
     list = jintrospect.getAutoCompleteList("s", locals())
     self.assertNotEmpty(list)
     self.assertContains(list, "contains")
Exemplo n.º 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)