Skip to main content


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 11:59 Go to next message
Andreas Winkler is currently offline Andreas WinklerFriend
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 12:45 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
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 13:38 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
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 10:46 Go to previous messageGo to next message
Andreas Winkler is currently offline Andreas WinklerFriend
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 10:47]

Report message to a moderator

Re: Editor problems with external files [message #499801 is a reply to message #499184] Tue, 24 November 2009 09:00 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
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 Apr 19 01:03:10 GMT 2024

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

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

Back to the top