Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumsextension point documentProviders
https://www.eclipse.org/forums/index.php/mv/msg/74943/234024/#msg_234024
I'm trying to use the extension point
" org.eclipse.gmf.runtime.diagram.ui.resources.editor.document Providers "
but I don't seem to get it to work.
I guess it's just some silly mistake I make...
Here's what I do in custom plugin.xml:
<extension
point=" org.eclipse.gmf.runtime.diagram.ui.resources.editor.document Providers ">
<provider
extensions=".xxx_diagram"
class="org.xxx.CustomXxxDocumentProvider"
id="org.xxx.CustomXxxDocumentProvider">
</provider>
</extension>
The constructor of CustomXxxDocumentProvider does not get called when I
open/create a diagram file of type xxx_diagram.
extensions is "." + my diagram filename extension, also tried with model
filename extension
class org.xxx.CustomXxxDocumentProvider exists (plugin.xml validation
displays a warning otherwise).
It extends my generated XxxDocumentProvider which extens
AbstractDocumentProvider, implementing IDocumentProvider as requested.
Is there a way I can debug this, any log if there are problems with an
extension point?
Thanks in advance,
Peter]]>Peter Lang2009-06-18T08:52:14-00:00Re: extension point documentProviders
https://www.eclipse.org/forums/index.php/mv/msg/74943/234072/#msg_234072
I suppose corresponding document provider is hadrcoded in generated ???DiagramEditor.getDocumentProvider(IEditorInput
input) method, so you have to modify generated code.
-----------------
Alex Shatalin]]>Alexander Shatalin2009-06-18T11:54:07-00:00Re: extension point documentProviders
https://www.eclipse.org/forums/index.php/mv/msg/74943/234108/#msg_234108
> I suppose corresponding document provider is hadrcoded in generated
???DiagramEditor.getDocumentProvider(IEditorInput
> input) method, so you have to modify generated code.
Yes, looks like...
Does this extension point make any sense then?
Peter]]>Peter Lang2009-06-18T13:22:07-00:00Re: extension point documentProviders
https://www.eclipse.org/forums/index.php/mv/msg/74943/234116/#msg_234116
> Does this extension point make any sense then?
If you need it (for extensibility) you can modify generated code to use it.
-----------------
Alex Shatalin]]>Alexander Shatalin2009-06-18T15:10:41-00:00Re: extension point documentProviders
https://www.eclipse.org/forums/index.php/mv/msg/74943/234385/#msg_234385
>> Does this extension point make any sense then?
> If you need it (for extensibility) you can modify generated code to use it.
Out of curiosity, could you provide an example / hint on how to do that?
Thanks,
Peter]]>Peter Lang2009-06-22T08:05:57-00:00Re: extension point documentProviders
https://www.eclipse.org/forums/index.php/mv/msg/74943/234414/#msg_234414
You can comment out generated ???DiagramEditor.getDocumentProvider() method
so super implementation will be used (calling document provider registry).
-----------------
Alex Shatalin]]>Alexander Shatalin2009-06-22T10:45:19-00:00Re: extension point documentProviders
https://www.eclipse.org/forums/index.php/mv/msg/74943/234450/#msg_234450
> You can comment out generated ???DiagramEditor.getDocumentProvider() method
> so super implementation will be used (calling document provider registry).
I tried it, but getDocumentProvider does not get called.
getDocumentProvider is not used, setDocumentProvider is called by
DiagramDocumentEditor.updateDocumentProvider.
So I changed setDocumentProvider to call
setDocumentProvider(super.getDocumentProvider(input));
in my XxxDiagramEditor.
In DocumentProviderRegistry.getDocumentProvider
editorInput.getAdapter(IFile.class) returns null, so file-extensions are
not used to find documentProvider.
Any idea what I could do?
Thanks,
Peter]]>Peter Lang2009-06-22T13:18:38-00:00Re: extension point documentProviders
https://www.eclipse.org/forums/index.php/mv/msg/74943/234457/#msg_234457
> Hello Alex,
>> You can comment out generated ???DiagramEditor.getDocumentProvider() method
>> so super implementation will be used (calling document provider registry).
> I tried it, but getDocumentProvider does not get called.
> getDocumentProvider is not used, setDocumentProvider is called by
> DiagramDocumentEditor.updateDocumentProvider.
> So I changed setDocumentProvider to call
> setDocumentProvider(super.getDocumentProvider(input));
> in my XxxDiagramEditor.
> In DocumentProviderRegistry.getDocumentProvider
> editorInput.getAdapter(IFile.class) returns null, so file-extensions are
> not used to find documentProvider.
Reason for this seems to be that URI.isPlatformResource() returns false,
since segments[0] is the first directory of my path, and not "resource".
> Any idea what I could do?
> Thanks,
> Peter]]>Peter Lang2009-06-22T13:27:50-00:00Re: extension point documentProviders
https://www.eclipse.org/forums/index.php/mv/msg/74943/234642/#msg_234642
>> so super implementation will be used (calling document provider registry).
> I tried it, but getDocumentProvider does not get called.
> getDocumentProvider is not used, setDocumentProvider is called by
> DiagramDocumentEditor.updateDocumentProvider.
> So I changed setDocumentProvider to call
> setDocumentProvider(super.getDocumentProvider(input));
> in my XxxDiagramEditor.
> In DocumentProviderRegistry.getDocumentProvider
> editorInput.getAdapter(IFile.class) returns null, so file-extensions are
> not used to find documentProvider.
> Reason for this seems to be that URI.isPlatformResource() returns false,
> since segments[0] is the first directory of my path, and not "resource".
Do you know the reason for this?
Any workaround you could think of?