Question

I was wandering if it's possible to open a source code in text editor and display it with decorations (Java for example)? I don't need fancy eclipse editor features, just properly decorated source code with line numbers, it can even be read-only. I read that RCP have many limitations with text editors as it drags behind heavy plug-ins. Can it be done at all? Is it possible to navigate to particular line of code when file is opened? It would be really great if someone would point me out to the right direction or give some examples... Thanks in advance!

Was it helpful?

Solution

Eclipse (3.4.2) itself ships with a sample XML editor that implements syntax highlighting. Just create a new plugin project, select 'This plugin will make contributions to the UI' and choose 'No' for Rich client application. The following wizard page offers a 'Plugin with an editor' template, which is your friend.

It may be too simple to use it as real template for your task, but it demonstrate how to create colourful editors for text files.

OTHER TIPS

i'm implementing a eclipse plugin which focusing on TTCN language, the editor is the most important part for it. actually, i'm using Eclipse editor framework. i guess there are quite more useful features than you want. And it's easy to extended.As Andreads_D said, you can find reference to the basic example which eclipse provided defaultly. I guess you don't need to know everything about it, just fousing on your needs. Also you can reference https://quitus-kitt.googlecode.com/svn/trunk. Any problem, we can discuss. : )

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top