Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How does an editor determine a file content type?
How does an editor determine a file content type? [message #334935] Tue, 10 March 2009 17:55 Go to next message
Frank Du is currently offline Frank DuFriend
Messages: 91
Registered: July 2009
Member
Hi All,

I encountered an issue about how editor determines the content type of a
document.

I use an in-memory object to provide XML content, instead of an in-disk
file. I implement the relative IEditorInput and IDocumentProvider.

The editor can open the XML content properly. However, it can't recognize
the xml content type. Is there anything I missed in setting everything up?

Thank you so much for the help in advance!

Best Regards,

Frank Du
Re: How does an editor determine a file content type? [message #334945 is a reply to message #334935] Wed, 11 March 2009 08:42 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
Did you extend content-type extension?

- Prakash
--
http://blog.eclipse-tips.com


"Frank Du" <du.qixing@gmail.com> wrote in message
news:6d9d93cb63b0863f805f41f3c41319de$1@www.eclipse.org...
> Hi All,
>
> I encountered an issue about how editor determines the content type of a
> document.
>
> I use an in-memory object to provide XML content, instead of an in-disk
> file. I implement the relative IEditorInput and IDocumentProvider.
> The editor can open the XML content properly. However, it can't recognize
> the xml content type. Is there anything I missed in setting everything up?
>
> Thank you so much for the help in advance!
>
> Best Regards,
>
> Frank Du
>
Re: How does an editor determine a file content type? [message #334951 is a reply to message #334945] Wed, 11 March 2009 16:26 Go to previous messageGo to next message
Frank Du is currently offline Frank DuFriend
Messages: 91
Registered: July 2009
Member
No, I didn't extend content-type extension. The editing content is from a
in-memory object, instead of disk file. Then we can't define the extension
by using file extensions, right?

Then, what could we describe the input file to the editor?

Thank you so much!
Frank


Prakash G.R. wrote:

> Did you extend content-type extension?

> - Prakash
Re: How does an editor determine a file content type? [message #334968 is a reply to message #334935] Thu, 12 March 2009 16:46 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Frank Du wrote:
> Hi All,
>
> I encountered an issue about how editor determines the content type of
> a document.
>
> I use an in-memory object to provide XML content, instead of an
> in-disk file. I implement the relative IEditorInput and
> IDocumentProvider.
> The editor can open the XML content properly. However, it can't
> recognize the xml content type. Is there anything I missed in setting
> everything up?
Your document provider must implement
org.eclipse.ui.editors.text.IStorageDocumentProvider and return the
correct content type of your in-memory object.

Dani
>
> Thank you so much for the help in advance!
>
> Best Regards,
>
> Frank Du
>
Re: How does an editor determine a file content type? [message #335063 is a reply to message #334968] Thu, 19 March 2009 23:01 Go to previous messageGo to next message
Frank Du is currently offline Frank DuFriend
Messages: 91
Registered: July 2009
Member
Hi Dani,

Thank you for the reply. I tried to debug all related methods in
StorageDocumentProvider class. However, the method is not called during
opening a in-disk xml file. Is there any other class used to determine the
content type?

Frank


Daniel Megert wrote:

> Frank Du wrote:
> Your document provider must implement
> org.eclipse.ui.editors.text.IStorageDocumentProvider and return the
> correct content type of your in-memory object.

> Dani
>>
>> Thank you so much for the help in advance!
>>
>> Best Regards,
>>
>> Frank Du
>>
Re: How does an editor determine a file content type? [message #335065 is a reply to message #335063] Fri, 20 March 2009 07:00 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Frank Du wrote:
> Hi Dani,
>
> Thank you for the reply. I tried to debug all related methods in
> StorageDocumentProvider class. However, the method is not called
> during opening a in-disk xml file.
Note that this only works for editors based on the platform.text framework.

Dani
> Is there any other class used to determine the content type?
>
> Frank
>
>
> Daniel Megert wrote:
>
>> Frank Du wrote:
>> Your document provider must implement
>> org.eclipse.ui.editors.text.IStorageDocumentProvider and return the
>> correct content type of your in-memory object.
>
>> Dani
>>>
>>> Thank you so much for the help in advance!
>>>
>>> Best Regards,
>>>
>>> Frank Du
>>>
>
>
Previous Topic:how to specify GTK?
Next Topic:Localizing about.html
Goto Forum:
  


Current Time: Fri Apr 26 21:05:02 GMT 2024

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

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

Back to the top