Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problems pane integration
Problems pane integration [message #418459] Wed, 16 April 2008 17:38 Go to next message
Jimmy Royer is currently offline Jimmy RoyerFriend
Messages: 16
Registered: July 2009
Junior Member
Hi guys,

I need some pointers..

I'm trying to integrate the problems pane within our project which is
using EMF. I've noticed the org.eclipse.emf.validation.marker.MarkerUtil
class which allows one to create markers from IStatus objects. I added the
functionality in this way:

Collection<EObject> eobjects = ...
final IStatus status = validator.validate(eobjects);
MarkerUtil.createMarkers(status);

Now markers created from the status are showing into the problems pane. I
have a minor problem though, when I double-click an entry, it opens the
text editor as the default editor instead of the generated EMF editor. Yet
I set the "extensions" property of the org.eclipse.ui.editors extension
for the entry of the editor. It does work correctly on the workstation of
a user. I looked in the preference page of my application instance for the
file association of the file type I need to open via Window > Preferences
> General > Editors > File Associations. There, I have the correct file
associations set (the generated editor I want to use with the
corresponding file types) but it keeps opening up the text editor. Any
pointers on that?

Second and EMF related, I'd like that when the user double-click on an
entry in the problems pane, the faulty EObject is selected in the opened
editor. Just like the editor for "genmodel" files, after pressing the
"Create markers" button when errors were detected. After some debugging
session of the MarkerUtil.createMarkers method, I see a location is
attached to the Marker object. For this selection to happen, should a
fragment be appended to the URI, targeting the EObject which is faulty?
for example: platform:/resource/project/model.ecore#//@items.0. In any
case, can you give me any pointers to make it work?

Thanks,
Jimmy Royer

P.S. Please feel free to forward this mail to the RCP mailing list as my
first question might not be EMF related. I didn't find if we could
cross-post and how.
Re: Problems pane integration [message #418470 is a reply to message #418459] Wed, 16 April 2008 21:15 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Jimmy,

Find some comments in-line, below.

HTH,

Christian


Jimmy Royer wrote:

> Hi guys,
>
> I need some pointers..
>
> I'm trying to integrate the problems pane within our project which is
> using EMF. I've noticed the org.eclipse.emf.validation.marker.MarkerUtil
> class which allows one to create markers from IStatus objects. I added the
> functionality in this way:
>
> Collection<EObject> eobjects = ...
> final IStatus status = validator.validate(eobjects);
> MarkerUtil.createMarkers(status);

While you're looking at MarkerUtil, you might want to check out this
enhancement request:

https://bugs.eclipse.org/218765


> Now markers created from the status are showing into the problems pane. I
> have a minor problem though, when I double-click an entry, it opens the
> text editor as the default editor instead of the generated EMF editor. Yet
> I set the "extensions" property of the org.eclipse.ui.editors extension
> for the entry of the editor. It does work correctly on the workstation of
> a user. I looked in the preference page of my application instance for the
> file association of the file type I need to open via Window > Preferences
>> General > Editors > File Associations. There, I have the correct file
> associations set (the generated editor I want to use with the
> corresponding file types) but it keeps opening up the text editor. Any
> pointers on that?

In EMF 2.4, we now have support for content-type-based associations of your
resources to your editor. Perhaps, if you haven't regenerated a plugin.xml
from Eclipse 3.3/EMF 2.3, then some other content-type registration is
interfering? I'm not sure ... Ed or somebody in the Platform newsgroup may
be more helpful with this.


> Second and EMF related, I'd like that when the user double-click on an
> entry in the problems pane, the faulty EObject is selected in the opened
> editor. Just like the editor for "genmodel" files, after pressing the
> "Create markers" button when errors were detected. After some debugging
> session of the MarkerUtil.createMarkers method, I see a location is
> attached to the Marker object. For this selection to happen, should a
> fragment be appended to the URI, targeting the EObject which is faulty?
> for example: platform:/resource/project/model.ecore#//@items.0. In any
> case, can you give me any pointers to make it work?

Yes, the URI would have to include a fragment in order to be able to locate
a particular object. If that's not happening, then it looks like a bug in
the MarkerUtil. All that should be necessary to get the appropriate URI
for the problem marker is to pass the target object into the
EcoreUtil.getURI(EObject) method.


> Thanks,
> Jimmy Royer
>
> P.S. Please feel free to forward this mail to the RCP mailing list as my
> first question might not be EMF related. I didn't find if we could
> cross-post and how.
Previous Topic:Deleting a Resource
Next Topic:models
Goto Forum:
  


Current Time: Thu Apr 25 15:26:24 GMT 2024

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

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

Back to the top