Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » extension point documentProviders
extension point documentProviders [message #234024] Thu, 18 June 2009 08:52 Go to next message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
Hi everyone,

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
Re: extension point documentProviders [message #234072 is a reply to message #234024] Thu, 18 June 2009 11:54 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Peter,

I suppose corresponding document provider is hadrcoded in generated ???DiagramEditor.getDocumentProvider(IEditorInput
input) method, so you have to modify generated code.

-----------------
Alex Shatalin
Re: extension point documentProviders [message #234108 is a reply to message #234072] Thu, 18 June 2009 13:22 Go to previous messageGo to next message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
Thank you, Alex,

> 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
Re: extension point documentProviders [message #234116 is a reply to message #234108] Thu, 18 June 2009 15:10 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Peter,

> Does this extension point make any sense then?
If you need it (for extensibility) you can modify generated code to use it.

-----------------
Alex Shatalin
Re: extension point documentProviders [message #234385 is a reply to message #234116] Mon, 22 June 2009 08:05 Go to previous messageGo to next message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
Hi Alex,

>> 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
Re: extension point documentProviders [message #234414 is a reply to message #234385] Mon, 22 June 2009 10:45 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Peter,

You can comment out generated ???DiagramEditor.getDocumentProvider() method
so super implementation will be used (calling document provider registry).

-----------------
Alex Shatalin
Re: extension point documentProviders [message #234450 is a reply to message #234414] Mon, 22 June 2009 13:18 Go to previous messageGo to next message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
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.

Any idea what I could do?

Thanks,
Peter
Re: extension point documentProviders [message #234457 is a reply to message #234450] Mon, 22 June 2009 13:27 Go to previous messageGo to next message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
Peter Lang wrote:

> 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
Re: extension point documentProviders [message #234642 is a reply to message #234457] Thu, 25 June 2009 09:35 Go to previous message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
>> 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".

Do you know the reason for this?
Any workaround you could think of?

Thanks,
Peter
Previous Topic:Problems with label referencing a derived attribute
Next Topic:TargetMetaFeature
Goto Forum:
  


Current Time: Thu Apr 09 18:08:39 GMT 2020

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

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

Back to the top