Custom editor for ".class" [message #948703] |
Thu, 18 October 2012 05:30  |
Eclipse User |
|
|
|
Hi
I need to create new editor for class files located in jar file.
Build path contains jar file.
I configured plugin.xml
I have a.b.c.MyClassEditor that extends MyJavaEditor
Editor extension point
<editor name="My Class Editor"
icon="icons/my_class_editor.png"
class="a.b.c.MyClassEditor"
default="true"
id="a.b.c.MyClassEditor">
<contentTypeBinding contentTypeId="a.b.c.contenttype.myClassFile" />
</editor>
Content type extension point
<content-type id="a.b.c.contenttype.myClassFile"
file-extensions="class"
base-type="org.eclipse.jdt.core.javaClass"
name="My Class"
priority="high">
<describer class="a.b.b.myContentDescriber">
</describer>
</content-type>
When I try to open ".class" file the editor that opens is org.eclipse.jdt.ui.ClassFileEditor instead of mine.
I debugged the code and saw that
In ContentTypeCatalog the method internalFindContentTypesFor found 2 suitable content types (javaClass and my) and every time returns javaClass content type as default and as I wanted that my content will be returned.
[/code]
I also have My Java Source Editor for ".java" files, it is configured in same way, but here it works perfectly.
Content type extension point
<content-type id="a.b.c.contenttype.myJavaFile"
base-type="org.eclipse.jdt.core.javaSource"
file-extensions="java"
name="My Java File"
priority="high">
<describer class="a.b.b.myContentDescriber">
</describer>
</content-type>
Editor extension point
<editor name="My Java Editor"
icon="icons/my_java_editor.png"
class="a.b.c.MyJavaEditor"
id="a.b.c.MyJavaEditor">
<contentTypeBinding contentTypeId="a.b.c.contenttype.myJavaFile" />
</editor>
What is wrong?
Thank you
Evgeny
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03868 seconds