Extending the editor [message #1064359] |
Tue, 18 June 2013 17:00  |
Eclipse User |
|
|
|
I need to extend the Java Editor in eclipse, via plugin, to syntax highlight a particular pattern and also be capable of taking text that fits this pattern and puts it into a custom view - basically, the java code will have variables in it for example:
public class {{^className^}}
and the view, having two columns, would contain a row:
className MyClass
I want to highlight that pattern in the source code (like a yellow background or something) and build in some integration between the custom view and the editor. Also, I will need to, at compile time, do a replace to put the actual value in palce of the variable in order for the compilation to use the value instead of the variable (while still displaying the variable in the editor).
I have read quite a bit now about markers, annotations and also about damage/repair reconciler type things but I'm not really sure which of these is appropriate for what I'm trying to do. I'm also not really sure how to hook them into the plugin via extension points.
If anyone can give me some starting pointers or point me to some decent documentation on all this (I have been googling quite a bit) I'd appreciate it.
|
|
|
|
|
|
|
Re: Extending the editor [message #1786770 is a reply to message #1066269] |
Thu, 10 May 2018 19:35  |
Eclipse User |
|
|
|
Hello guys,
I am interested in using the external editor in my plugin in a similar way to what you are discussing. I have been having some difficulties. First, I am importing the org.eclipse.jdt.internal.ui.javaeditor.CompulationUnitEditor and extending it from a class like so:
public class MyOwnEditor extends CompilationUnitEditor {
...
}
but this shows an error that "the hierarchy of the type MyOwnEditor is inconsistent."
How did you guys import the CompilationUnitEditor? Did you have to include an external jar for jdt?
I am importing the class by following the instructions here: [//stackoverflow dot com/a/95354/5390705].
It would be nice if you could provide an example project where you got it to work.
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.04011 seconds