From: Jeff E. <JEm...@lg...> - 2004-02-12 15:27:22
|
I doubt the problem is the callback interface. Jython classes do that well. As far as I know, Eclipse instantiates plugin classes by reflection. You might have difficulty with that. Try instantiating your class by reflection (java.lang.Class.forName().newInstance()) in your own little test program. -----Original Message----- From: Thomas Patzke [mailto:Tho...@we...] Sent: Thursday, February 12, 2004 7:51 AM To: jyt...@li... Subject: [Jython-users] helloworld eclipse plugin Hello, is it possible to implement an Eclipse plugin in Jython instead of Java? I tried the following helloworld example from the Eclipse book, converted to Jython. It compiles, but (due to the callbacks?), it does not run in the Eclipse Runtime Workbench. --------------- import org.eclipse.jface.action.IAction import org.eclipse.jface.viewers.ISelection import org.eclipse.ui.IWorkbenchWindow import org.eclipse.ui.IWorkbenchWindowActionDelegate import org.eclipse.jface.dialogs.MessageDialog class Hello(IWorkbenchWindowActionDelegate): def run(self,action): MessageDialog.openInformation(Null,Null,'Hello Jython!') def selectionChanged(self,action,selection): pass def dispose(self): pass def init(self,window): pass ----------------- Thanks, Thomas ____________________________________________________________________________ __ Erdbeben im Iran: Zehntausende Kinder brauchen Hilfe. UNICEF hilft den Kindern - helfen Sie mit! https://www.unicef.de/spe/spe_03.php ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Samuele P. <ped...@bl...> - 2004-02-12 16:45:47
|
At 09:25 12.02.2004 -0600, Jeff Emanuel wrote: >I doubt the problem is the callback interface. Jython classes do >that well. > >As far as I know, Eclipse instantiates plugin classes by reflection. yes, and each plugin has its own classloader which either satisfies a load request or delegate to the classloaders of the plugins you have explicitly declared to "import". >You might have difficulty with that. Try instantiating your class >by reflection (java.lang.Class.forName().newInstance()) in your own >little test program. even this is supposed to work, even more so with jythonc (I suppose he used that) compiled classes: Jython 2.2aNewstyle on java1.4.0_02 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import java >>> >>> class C(java.lang.Object): ... def __init__(self): print "make a C" ... >>> java.lang.Class.newInstance(C) make a C <__main__.C instance 1> >>> it's likely a setup vs. imports issue or just the Null/None thing. In Eclipse like in all "containers" imports can be tricky. |
From: Julio P. A. <pe...@lu...> - 2004-02-12 16:55:03
|
I have my jython interpreter, I could move trough last written lines, I could define in my console.py no to go back with left key, keymap.bind('enter', self.enter) keymap.bind('tab', self.tab) keymap.bind(key, self.escape) keymap.bind('up', self.uphistory) keymap.bind('down', self.downhistory) def left: //I define not to go back but what I do not want is to use backspace to delete the prompt, like the python interpreter. prompt> | I will apreciate whatever suggestion on this, Thanks in advance, -----Mensaje original----- De: jyt...@li... [mailto:jyt...@li...]En nombre de Jeff Emanuel Enviado el: jueves, 12 de febrero de 2004 16:26 Para: 'Thomas Patzke' CC: 'jyt...@li...' Asunto: RE: [Jython-users] helloworld eclipse plugin I doubt the problem is the callback interface. Jython classes do that well. As far as I know, Eclipse instantiates plugin classes by reflection. You might have difficulty with that. Try instantiating your class by reflection (java.lang.Class.forName().newInstance()) in your own little test program. -----Original Message----- From: Thomas Patzke [mailto:Tho...@we...] Sent: Thursday, February 12, 2004 7:51 AM To: jyt...@li... Subject: [Jython-users] helloworld eclipse plugin Hello, is it possible to implement an Eclipse plugin in Jython instead of Java? I tried the following helloworld example from the Eclipse book, converted to Jython. It compiles, but (due to the callbacks?), it does not run in the Eclipse Runtime Workbench. --------------- import org.eclipse.jface.action.IAction import org.eclipse.jface.viewers.ISelection import org.eclipse.ui.IWorkbenchWindow import org.eclipse.ui.IWorkbenchWindowActionDelegate import org.eclipse.jface.dialogs.MessageDialog class Hello(IWorkbenchWindowActionDelegate): def run(self,action): MessageDialog.openInformation(Null,Null,'Hello Jython!') def selectionChanged(self,action,selection): pass def dispose(self): pass def init(self,window): pass ----------------- Thanks, Thomas ____________________________________________________________________________ __ Erdbeben im Iran: Zehntausende Kinder brauchen Hilfe. UNICEF hilft den Kindern - helfen Sie mit! https://www.unicef.de/spe/spe_03.php ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Julio P. A. <pe...@lu...> - 2004-02-12 17:02:44
|
I mean keymap.bind('left', self.escape) def left: //I define not to go back -----Mensaje original----- De: Julio Pernia Aznar [mailto:pe...@lu...] Enviado el: jueves, 12 de febrero de 2004 17:56 Para: 'jyt...@li...' Asunto: delete the interpreter prompt I have my jython interpreter, I could move trough last written lines, I could define in my console.py no to go back with left key, keymap.bind('enter', self.enter) keymap.bind('tab', self.tab) keymap.bind(key, self.escape) keymap.bind('up', self.uphistory) keymap.bind('down', self.downhistory) def left: //I define not to go back but what I do not want is to use backspace to delete the prompt, like the python interpreter. prompt> | I will apreciate whatever suggestion on this, Thanks in advance, -----Mensaje original----- De: jyt...@li... [mailto:jyt...@li...]En nombre de Jeff Emanuel Enviado el: jueves, 12 de febrero de 2004 16:26 Para: 'Thomas Patzke' CC: 'jyt...@li...' Asunto: RE: [Jython-users] helloworld eclipse plugin I doubt the problem is the callback interface. Jython classes do that well. As far as I know, Eclipse instantiates plugin classes by reflection. You might have difficulty with that. Try instantiating your class by reflection (java.lang.Class.forName().newInstance()) in your own little test program. -----Original Message----- From: Thomas Patzke [mailto:Tho...@we...] Sent: Thursday, February 12, 2004 7:51 AM To: jyt...@li... Subject: [Jython-users] helloworld eclipse plugin Hello, is it possible to implement an Eclipse plugin in Jython instead of Java? I tried the following helloworld example from the Eclipse book, converted to Jython. It compiles, but (due to the callbacks?), it does not run in the Eclipse Runtime Workbench. --------------- import org.eclipse.jface.action.IAction import org.eclipse.jface.viewers.ISelection import org.eclipse.ui.IWorkbenchWindow import org.eclipse.ui.IWorkbenchWindowActionDelegate import org.eclipse.jface.dialogs.MessageDialog class Hello(IWorkbenchWindowActionDelegate): def run(self,action): MessageDialog.openInformation(Null,Null,'Hello Jython!') def selectionChanged(self,action,selection): pass def dispose(self): pass def init(self,window): pass ----------------- Thanks, Thomas ____________________________________________________________________________ __ Erdbeben im Iran: Zehntausende Kinder brauchen Hilfe. UNICEF hilft den Kindern - helfen Sie mit! https://www.unicef.de/spe/spe_03.php ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |