Opening editor programmatically [message #20816] |
Sun, 30 January 2005 20:05  |
Eclipse User |
|
|
|
Originally posted by: 0kcc.qlink.queensu.ca
Hi,
I am following eclipsefaq.org FAQ 302 trying to open my custom editor
programmatically, on something not a file. (My editor Extends EditorPart)
When I run the code given in FAQ302 with
editorID="org.eclipse.ui.DefaultTextEditor" the eclipse DefaultTextEditor
opens fine.
As soon as I change the editorID to my editor I get an exeception:
org.eclipse.ui.PartInitException: Editor initialization failed: ... Site
is incorrect.
Now, I think the exception is being thrown in the init method of my
editor, which has the deffinition:
public void init(IEditorSite site, IEditorInput input)throws
PartInitException{...}
Is the exception being generated because the site is not being supplied
correctly or at all?
Is there another method I can use to programmatically open my editor?
Thanks in advance.
|
|
|
|
Re: Opening editor programmatically [message #23248 is a reply to message #21759] |
Tue, 01 February 2005 23:14  |
Eclipse User |
|
|
|
Originally posted by: 0kcc.qlink.queensu.ca
Thanks,
I was missing setSite and setInput for some reason.
Christian Märkle wrote:
> Hi Kevin,
> check if your init() method looks like
> public void init(IEditorSite site, IEditorInput input) throws
> PartInitException {
> setSite(site);
> setInput(input);
> }
> or - this sounds oddly (but happened to me):
> check if you have two Editor classes with the same name but in different
> packages and the
> one which is referenced in plugin.xml is not the one you?re actually working
> in.
> Another good hint is to set a breakpoint in
> org.eclipse.ui.internal.EditorManager.createSite() and
> look what is missing.
> Regards,
> Chris
> "Kevin" <0kcc@qlink.queensu.ca> schrieb im Newsbeitrag
> news:ctk09e$dib$1@www.eclipse.org...
>> Hi,
>>
>> I am following eclipsefaq.org FAQ 302 trying to open my custom editor
>> programmatically, on something not a file. (My editor Extends EditorPart)
>>
>> When I run the code given in FAQ302 with
>> editorID="org.eclipse.ui.DefaultTextEditor" the eclipse DefaultTextEditor
>> opens fine.
>>
>> As soon as I change the editorID to my editor I get an exeception:
>> org.eclipse.ui.PartInitException: Editor initialization failed: ... Site
>> is incorrect.
>>
>> Now, I think the exception is being thrown in the init method of my
>> editor, which has the deffinition:
>> public void init(IEditorSite site, IEditorInput input)throws
>> PartInitException{...}
>>
>> Is the exception being generated because the site is not being supplied
>> correctly or at all?
>> Is there another method I can use to programmatically open my editor?
>>
>> Thanks in advance.
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.08251 seconds