Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Editor problems with external files(Opening files which are outside the workspace create errors)
Editor problems with external files [message #498973] Thu, 19 November 2009 06:59 Go to next message
Andreas Winkler is currently offline Andreas Winkler
Messages: 14
Registered: July 2009
Junior Member
Hi

I am working on an editor where at the moment I use external files loaded through IDE.openEditorOnFileStore( page, fileStore ); as found in the FAQs.

When using my own DocumentProvider which extends FileDocumentProvider I get an error message instead of the editor.
This also happens if I test the xml example plugin which can be created when making a new plugin.

Just as a sidenote:
I tested both plugins also with the eclipse framework and both show the same results: opening via the OpenFile... menu I get an error. When I add the file to an project and then open the file it works just fine: I see the editor!

Any suggestions?

Regards
Andreas
Re: Editor problems with external files [message #498985 is a reply to message #498973] Thu, 19 November 2009 07:45 Go to previous messageGo to next message
Wim Jongman is currently offline Wim Jongman
Messages: 418
Registered: July 2009
Senior Member
Hi Andreas,

Can you provide a stack trace?

Best regards,

Wim Jongman


> Hi
>
> I am working on an editor where at the moment I use external files loaded
through IDE.openEditorOnFileStore( page, fileStore ); as found in the FAQs.
>
> When using my own DocumentProvider which extends FileDocumentProvider I get
an error message instead of the editor.
> This also happens if I test the xml example plugin which can be created
when making a new plugin.
>
> Just as a sidenote:
> I tested both plugins also with the eclipse framework and both show the
same results: opening via the OpenFile... menu I get an error. When I add the
file to an project and then open the file it works just fine: I see the
editor!
>
> Any suggestions?
>
> Regards
> Andreas
Re: Editor problems with external files [message #499001 is a reply to message #498973] Thu, 19 November 2009 08:38 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
Andreas Winkler wrote:
> Hi
>
> I am working on an editor where at the moment I use external files
> loaded through IDE.openEditorOnFileStore( page, fileStore ); as found
> in the FAQs.
>
> When using my own DocumentProvider which extends FileDocumentProvider
> I get an error message instead of the editor.
> This also happens if I test the xml example plugin which can be
> created when making a new plugin.
The TextFileDocumentProvider which uses file buffers underneath is made
to support external files. If you decide not to use that class then you
have to re-implement all that functionality.

Dani
>
> Just as a sidenote:
> I tested both plugins also with the eclipse framework and both show
> the same results: opening via the OpenFile... menu I get an error.
> When I add the file to an project and then open the file it works just
> fine: I see the editor!
>
> Any suggestions?
>
> Regards
> Andreas
Re: Editor problems with external files [message #499184 is a reply to message #499001] Fri, 20 November 2009 05:46 Go to previous messageGo to next message
Andreas Winkler is currently offline Andreas Winkler
Messages: 14
Registered: July 2009
Junior Member
Hi,

I don't know how to get stack trace cause I don't get any error in the log. Just the word ERROR is displayed in the editorArea.
While debugging I found out that in StorageDocumentProvider.getEncoding the element is checked if it is instanceof IStorageEditorInput which it obviously isn't. And that's where createDocument can't set the document content and therefor returns null as the document.
super.createDocument( element )
is called in my DocumentProvider which extends FileDocumentProvider.
element is an Object of org.eclipse.ui.ide.FileStoreEditorInput

My Editor extends AbstractDecoratedTextEditor, but the same error occurs when extending TextEditor instead.

Regards
Andreas

[Updated on: Fri, 20 November 2009 05:47]

Report message to a moderator

Re: Editor problems with external files [message #499801 is a reply to message #499184] Tue, 24 November 2009 04:00 Go to previous message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
Andreas Winkler wrote:
> Hi,
>
> I don't know how to get stack trace cause I don't get any error in the
> log. Just the word ERROR is displayed in the editorArea.
> While debugging I found out that in
> StorageDocumentProvider.getEncoding the element is checked if it is
> instanceof IStorageEditorInput which it obviously isn't. And that's
> where createDocument can't set the document content and therefor
> returns null as the document. super.createDocument( element ) happens
> in my DocumentProvider which extends FileDocumentProvider.
> element is an Object of org.eclipse.ui.ide.FileStoreEditorInput
>
> My Editor extends AbstractDecoratedTextEditor, but the same error
> occurs when extending TextEditor instead.
As said before your document provider is wrong.

Dani
>
> Regards
> Andreas
>
>
Previous Topic:RCP Jetty..absolute path for htmls
Next Topic:Cant create a product
Goto Forum:
  


Current Time: Fri Jul 25 08:58:10 EDT 2014

Powered by FUDForum. Page generated in 0.01726 seconds