Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » [CommonNavigator][RCP][GMF]: "Text editor does not have a document provider"
[CommonNavigator][RCP][GMF]: "Text editor does not have a document provider" [message #201460] Mon, 11 August 2008 19:51 Go to next message
Eclipse UserFriend
Originally posted by: rolfes.daniel.web.de

Hi,

i am trying to get the CommonNavigator working in my
GMF-RCP-Application. I want to use Ressources so i followed this tutorial:
http://wiki.eclipse.org/index.php/Common_Navigator_Framework

I can create a new diagram-file and it is shown in the Tree of my
navigator. This works fine.
But when i try to open a created element with a double-click, i get the
following exception:
"Text editor does not have a document provider"

So i debugged and found the following:

In class XXXDiagramEditor (extends DiagramDocumentEditor):

protected void setDocumentProvider(IEditorInput input) {
if (input instanceof URIEditorInput) {
setDocumentProvider(EpcDiagramEditorPlugin.getInstance()
.getDocumentProvider());
} else {
super.setDocumentProvider(input);
}
}

input is instanceof FileEditorInput but it has to be a URIEditorInput,
afaiu.

What did i miss? How can the files be openend with my specific editor?
I probably have to define something in my plugin.xml?

Thanks,
Daniel
Re: [CommonNavigator][RCP][GMF]: "Text editor does not have a documentprovider" [message #201541 is a reply to message #201460] Tue, 12 August 2008 08:16 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello D. Rolfes,

GMF is able to generate "pure" RCP version of diagram editor now. This means
- no dependencies from the eclipse resources, so no FileEditorInput available
in a classpath.
If you need be able to work with eclipse resources then I suggest you to
generate normal (not RCP) version of diagram and put all the necessary plugins
into your version of "RCP+" platform.

-----------------
Alex Shatalin
Re: [CommonNavigator][RCP][GMF]: "Text editor does not have a documentprovider" [message #201665 is a reply to message #201541] Tue, 12 August 2008 17:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rolfes.daniel.web.de

Hi,

thanks a lot for your answer. I'm not quite sure if i understood this
correctly. Could you explain what you mean with "RCP+"?
I generated a non-RCP version. Beeing curious what has changed, i
searched for "FileEditorInput" and found out that there were changes in
XXXDiagramEditor, XXXDiagramEditorUtil and XXXDocumentProvider. So i
basically tried to just exchange these classes with the ones in my RCP
version. Open on doubleclick actually works now! But there are other
problems now with saving files, creating new files and probably way more.
So this is probably not a good idea.
Is is not possible to use CommonNavigator and GMF in a RCP application?

I would be really glad, if you know a better approach for my intention:
- RCP Application
- Use GMF Editors
- Display files, folders, projects of a workspace in a Viewer.
- Open the diagrams with the associated GMF editor


Thanks,
Daniel

Alex Shatalin schrieb:
> Hello D. Rolfes,
>
> GMF is able to generate "pure" RCP version of diagram editor now. This
> means - no dependencies from the eclipse resources, so no
> FileEditorInput available in a classpath.
> If you need be able to work with eclipse resources then I suggest you to
> generate normal (not RCP) version of diagram and put all the necessary
> plugins into your version of "RCP+" platform.
>
> -----------------
> Alex Shatalin
>
>
Re: [CommonNavigator][RCP][GMF]: "Text editor does not have a documentprovider" [message #201740 is a reply to message #201665] Wed, 13 August 2008 08:58 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello D. Rolfes,

> thanks a lot for your answer. I'm not quite sure if i understood this
> correctly. Could you explain what you mean with "RCP+"?
I mean, AFAIK pure Rich Client Platform ( http://wiki.eclipse.org/RCP_FAQ#What_is_the_Eclipse_Rich_Cli ent_Platform.3F)
plugin set does not include resources plugins ( http://wiki.eclipse.org/RCP_FAQ#Is_the_resources_plug-in_.28 org.eclipse.core.resources.29_considered_part_of_the_Rich_Cl ient_Platform.3F).
As a result you should not be able to work with workspace structure in RCP
version of your application, but you can add more plugins to the RCP plugin
set to let it work with the eclipse resources. This “extended” RCP platform
I called “RCP+”. :-)

> version. Open on doubleclick actually works now! But there are other
> problems now with saving files, creating new files and probably way
> more.
Well, I suggest you to investigate these problems – I suppose the reason
is some necessary plugins absence.

> Is is not possible to use CommonNavigator and GMF in a RCP
> application?
If you are going to browse eclipse workspace (use Project Explorer) then
this is not an RCP version anymore. ;-)

> - Display files, folders, projects of a workspace in a Viewer.
I suggest you to generate non-RCP version of GMF and then try to minimize
a number of puligs in the eclipse distribution used to execute your application.

-----------------
Alex Shatalin
Re: [CommonNavigator][RCP][GMF]: "Text editor does not have a documentprovider" [message #201796 is a reply to message #201740] Wed, 13 August 2008 11:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rolfes.daniel.web.de

Hi,
i really appreciate your answers. I'm struggling with this task for a
while now.

Just to make my intention clear:
- I create a RCP application to get rid of all the unnecessary toolbars,
menues, etc.

Generating a non-RCP version means i have to manually remove all these
toolbars, menues etc.?

- i would like the users to create GMF-diagram-files, folders, projects
in a "workspace".

The Eclipse Project Explorer for example does all this perfect. Because
of this, i try to use this code, so i do not have to write my own.

To summarize this:
If i want to use the Project Explorer, i should generate a non
RCP-version and manually remove all the unnecessary toolbars, menues etc.?
If i want to have an RCP version, i have to write my own View with my
own code to manage files, folders, projects in a workspace?


> ...but you can add more plugins to the RCP
> plugin set to let it work with the eclipse resources. This “extended”
> RCP platform I called “RCP+”. :-)
>
Ah ok, i see. I think i did have a "RCP+" version, because i followed
this tutorial
( http://wiki.eclipse.org/index.php/Common_Navigator_Framework #How_to_use_the_CNF_with_Resources_in_an_RCP_Application)
to get the CommonNavigator working.

>> Open on doubleclick actually works now! But there are other
>> problems now with saving files, creating new files and probably way
>> more.
> Well, I suggest you to investigate these problems – I suppose the reason
> is some necessary plugins absence.
>
Everything seems to work now. There is only one problem i have to solve:
I'm creating new files with the wizard. Changes of this file while
editing are marked with a "*" next to the filename in the toolbar. I can
save these changes with Control-S.
But when i open the file from the CommonNavigator and edit them, the "*"
does not appear and the CONTROL-S does nothing. Closing the file leads
to a Messagebox ("The File has changed. Do you want to save..") Clicking
"O.K" saves the file.
Do you have an idea where i should look?


Thanks,
Daniel
Re: [CommonNavigator][RCP][GMF]: "Text editor does not have a documentprovider" [message #201865 is a reply to message #201796] Wed, 13 August 2008 16:30 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello D. Rolfes,

> - I create a RCP application to get rid of all the unnecessary
> toolbars,
> menues, etc.
> Generating a non-RCP version means i have to manually remove all these
> toolbars, menues etc.?
Are you talking about GMF menues/toolbars of Eclipse one?
I'm suggesting you to generate non-RCP version of GMF diagram editor (I think
the difference between RCP and non-RCP version is mostly in a resource-dependent
plugin usages), then add this diagram into the RCP platform with added eclipse
resource/navigator plugins and then try adding all necessary plugins required
by GMF-generated code there. I think it is much easy then removing al the
menues.

> If i want to use the Project Explorer, i should generate a non
> RCP-version and manually remove all the unnecessary toolbars, menues
> etc.?
Right. Or as I said vice versa - add generated non-RCP plugin into the RCP
version of the platform and put all required plugins there in addition.

> Ah ok, i see. I think i did have a "RCP+" version, because i followed
> this tutorial
Right - in accordance with this tutorial following plugins were added to
the RCP plugin set:

org.eclipse.ui.navigator
org.eclipse.ui.navigator.resources
org.eclipse.ui.ide
org.eclipse.core.resources

> But when i open the file from the CommonNavigator and edit them, the
> "*" > does not appear and the CONTROL-S does nothing. Closing the file
leads
There should be ???DocumentProvider.ResourceSetModificationListener inner
class generated. This class is responsible for setting "dirty" flag for the
editor - see ???DocumentProvider.fireElementDirtyStateChanged(myInfo.getE ditorInput(),
modified); You can try to debug this code to see the reason why "*" is not
visible on openning diagram editor from the CommonNavigator.

-----------------
Alex Shatalin
Previous Topic:gmf bpmn tutorial
Next Topic:update gmf files directly
Goto Forum:
  


Current Time: Thu Apr 25 23:10:04 GMT 2024

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

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

Back to the top