Skip to main content



      Home
Home » Newcomers » Newcomers » Opening editor programmatically
Opening editor programmatically [message #20816] Sun, 30 January 2005 20:05 Go to next message
Eclipse UserFriend
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 #21759 is a reply to message #20816] Mon, 31 January 2005 15:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cm11.hdm-stuttgart.de

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.
>
>
Re: Opening editor programmatically [message #23248 is a reply to message #21759] Tue, 01 February 2005 23:14 Go to previous message
Eclipse UserFriend
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.
>>
>>
Previous Topic:Problems runnign Eclipse 3.0.0
Next Topic:Displaying Tables
Goto Forum:
  


Current Time: Fri Apr 25 19:24:26 EDT 2025

Powered by FUDForum. Page generated in 0.08251 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top