pydev-code

Hi everyone,
I have a plug-in that extends org.eclipse.ui.popupMenus
in order to add an action to the context menu of the PyDev
editor. Here's the relevant portion of my plugin.xml file:
<viewerContribution
id="org.eclipse.olm.editor_extensions.python_add_comment"
targetID="#PythonEditorContext">
<action
class="org.eclipse.olm.pinkhippo.editor_extensions.AddCommentDelegate"
icon="icons/sample.gif"
id="org.eclipse.olm.editor_extensions.editor_actions.add_comment"
label="Add Comment"
menubarPath="additions"/>
</viewerContribution>
Unfortunately, the code that handles this action and implements
IEditorActionDelegate has to access the editor, in the following way:
...
public void run(IAction action) {
if( editor.getEditorInput() != null &&
editor.getEditorInput() instanceof IFileEditorInput &&
editor instanceof AbstractTextEditor){
...
I say 'unfortunately', because PyDev seems to be complaining
about illegal access of some internal module. Here's the error message:
Error received...
tried to access field
org.python.pydev.ui.pythonpathconf.InterpreterInfo.modulesManager from
class com.python.pydev.analysis.additionalinfo.builders.InterpreterObserver
tried to access field
org.python.pydev.ui.pythonpathconf.InterpreterInfo.modulesManager from
class com.python.pydev.analysis.additionalinfo.builders.InterpreterObserver
java.lang.IllegalAccessError: tried to access field
org.python.pydev.ui.pythonpathconf.InterpreterInfo.modulesManager from
class com.python.pydev.analysis.additionalinfo.builders.InterpreterObserver
at com.python.pydev.analysis.additionalinfo.builders.InterpreterObserver.notifyDefaultPythonpathRestored(InterpreterObserver.java:58)
at com.python.pydev.analysis.additionalinfo.builders.InterpreterObserver$1.run(InterpreterObserver.java:96)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Moreover, since this error occurs the action that I tried to insert in the
context menu of the PyDev editor never appears there. The same code
runs perfectly for the context menu of the Java editor (i.e.
#CompilationUnitEditorContext
as the targetID).
Can anyone tell me what I am doing wrong here?
Is it possible to extend the context menu of the PyDev editor?
Thanks,
Florian
PS: I am running Eclipse 3.2 on Linux, Ubuntu 7.04
and PyDev 1.3.8.

Community

Help

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details