views:

268

answers:

2

I extended from org.eclipse.ui.editors and defined the editor-id in plugin.xml as "MyEditorId". I wrote corresponding editor class. Then I tried to open the editor from a view with this code.

page.openEditor(input, "MyEditorId");

But I am getting "PartInitException". i.e apllication is not recognising the editor by it's id. I have checked that there is no spelling mistake in the referenced editor-id. Why is editor not getting recognised?

A: 

Quick checks:

VonC
A: 

Hey, thanks VonC. I was missing the icon definition. I am able to open editor with the icon definition now.

It's kind of strange that icon is a mandatory attribute for the editor extension. It may even be left blank. Without the icon definition the editor defined never gets into the editor registry when plugin extension are read. Ain't that a little weird ?!

Chandan .
Sorry, I missed your answer: you should made a comment on my answer for me to be notified. You can also complete your question to display the right solution... and of course select my answer if you think it is correct ;)
VonC
your answer is complete. you listed all possibilities why editor wouldn't show up. however my problem was with missing icon! and yeah, i gotta learn forum etiquette now as i am new here :)
Chandan .
No problem. Glad to have been of assistance ;)
VonC