DocumentProvider for external opened files [message #795295] |
Fri, 10 February 2012 04:49  |
Eclipse User |
|
|
|
Hi!
Does anyone know a way to connect own documentproviders with external files in Eclipse?
My plugin.xml looks like
<extension point="org.eclipse.ui.editors.documentProviders">
<provider
class="my.path.to.tbpl.documentprovider.TBPLDocumentProvider"
extensions="tbpl"
id="my.path.to.tbpl.documentprovider.TBPLDocumentProvider">
</provider>
</extension>
If I open a file (IFile/ FileEditorInput) located in the workspace all will work fine.
But if I open a file outside the workspace, the default documentprovider (TextFileDocumentProvider) is opened.
The problem is, that the DocumentProviderRegistry computes only the file extension if the input is an IFile. For IFileStore it looks only at the class name of the input.
Therefore I extended my documentprovider extensionpoint to
...
inputTypes="org.eclipse.ui.IFileEditorInput,org.eclipse.ui.ide.FileStoreEditorInput"
...
Now it will work.
But now the documentprovider is used for every file located in and outside the workspace. (That means all files, not only *.tbpl would use the documentprovider).
So my question is: is it possible to create an own EditorInput (like an IEditorInputProvider) to connect the documentProvider with? Or does anyone know how to do some stuff like this?
Or is it a bug in eclipse, that the file extensions are only used for "IFile" and not for "IFileStore"
Thanks!
Adreamus
|
|
|
|
|
Re: DocumentProvider for external opened files [message #800881 is a reply to message #800823] |
Fri, 17 February 2012 11:20  |
Eclipse User |
|
|
|
On 17.02.2012 15:55, M Dahlem wrote:
> but that is not possible, because I use the document provider with
> given editors (css/html/ text...) and not with an created one.
Well, I guess you should not try to fiddle with the document provider of
existing editors.
Dani
|
|
|
Powered by
FUDForum. Page generated in 0.04270 seconds