1

I am using the latest Eclipse 4.7 Eclipse. I am trying to build a language sensitive editor for a pure e4 RCP application. I have modeled my editor after the example XML Text Editor template project (generated from File->New->Plug-in project). I have modified it and extended it to support my custom language (loosely based on specialized XML tags/elements/attributes). I can run this plugin on its own from the default product “org.eclipse.platform.ide” and it works just fine. But I am trying to include this plug-in into my own pure e4 RCP application and I am having a challenge in figuring out how to present my custom editor.

I try to follow the tutorial from Vogella found here: http://www.vogella.com/tutorials/EclipseEditors/article.html#add-simple-content-assist

I even purchased the Vogella book.

But that example looks nothing like the standard XML Text Editor example. From the tutorial, it mentions that to launch the editor programmatically, it implies that you need to create your own implementation of IEditorInput – but how does this relate to how the example XML Text Editor provides input for the editor through extending the FileDocuementProvider?

Perhaps the XML Text Editor example is the old 3.X way of doing things and I need to refactor my editor. I can do this – but then are there pure e4 RCP Text Editor examples similar in functionality to the XML Text Editor example? I really do need the syntax highlighting, validation, support markers, etc. found in the XML Editor example. Where can I go to learn how to do this?

greg-449
  • 109,219
  • 232
  • 102
  • 145
Scott
  • 11
  • 2
  • Frankly this is really hard. Anything that uses `org.eclipse.ui.xxxxx` is 3.x compatibility mode, not pure e4. You can only use the `org.eclipse.jface` parts of the editor support which means most tutorials can't be used. Also note that pure e4 doesn't have any of the IFile file support, or markers. – greg-449 Jun 23 '17 at 20:24
  • Thank you for that. I presume that learning how write the text editor is beyond the existing text books and I have been looking for days now for on-line tutorials and have not come up with anything useful. So - if I am forced to use compatibility mode for my editor, then how do I programmatically launch my e3 type editor from my e4 application? In some cases I will be launching the editor from an e4 type command handler. I already have used the Application model to layout the 2 perspectives. I want my editor to appear in a certain part - or is all of this out the windows as well? – Scott Jun 24 '17 at 21:28
  • You can't easily use an e3 editor from pure e4 because it will require most of the 3.x compatibility code which needs a lot of initialization. As I said if you want things like Markers then you need to use e3 anyway. – greg-449 Jun 25 '17 at 06:58
  • To create a pure e4 text editor you could use the efxclipse code editor framework. Afaik the samples are based on JavaFX. In case this is something you wish to explore you should have a look at the JavaFX renderers for e4, also a part of efxclipse. https://tomsondev.bestsolution.at/2016/06/06/efxclipse-2-4-0-released/ – christoph.keimel Jun 25 '17 at 16:39

0 Answers0