pythoneclipseeclipse-ecf

Using ECF shared editing with Python


I can use the shared editing feature of ECF with Java fine perfectly fine. When I try to do it with Python files it also works, but there is no syntax highlighting.

I installed PyDev to get syntax highlighting, but then the context menu does not have the "share editor" option. I removed PyDev and the option came back. I installed Dynamic Languages Toolkit in hopes that its Python syntax highlighting was compatible and I got the same effect (context menu lacks the "share editor" option).

Is there a way to have a shared editing session with Python files and syntax highlighting?


Solution

  • You have to add the context menu into the PyDev editor manually.

    You can do this by setting up a plugin with the following inplugin.xml:

    <plugin>
       <extension point="org.eclipse.ui.menus">
      <menuContribution 
            locationURI="popup:org.python.pydev.editor.PythonEditor.EditorContext">
        <dynamic
            class="org.eclipse.ecf.docshare.menu.DocShareRosterMenuContributionItem"
            id="com.foo.MyVeryOwnEditorContextID.dynamic1">
        </dynamic>
      </menuContribution>
    </extension>
    </plugin>
    

    Here, org.python.pydev.editor.PythonEditor.EditorContext is the context id of the PyDev Editor.
    If you want to add the context menu item to another editor you'll have to change this id. It can be found by pressing Shift-Alt-F1 while using in editor you want to add it to.

    com.foo.MyVeryOwnEditorContextID.dynamic1 simply has to be a unique id of your choice.

    You then have to put the plugin .jar file into your plugins folder in the eclipse directory.