|
Re: MarkerUtil problem [message #418606 is a reply to message #418604] |
Mon, 21 April 2008 22:04 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Kristian,
IMarkers, being objects associated with IFiles, can only be applied for
workspace resources. It's a basic Eclipse limitation that we can't do
anything about in EMF...
Kristian Sons wrote:
> Hello!
>
> I want validation failures to be displayed in the ProblemsView. I use
> an Editor generated by the ecore genmodel. For a live validation I do
> the following:
>
> IStatus status = validator.validate(notification);
> if (!status.isOK()) {
> if (status.isMultiStatus()) {
> status = status.getChildren()[0];
> }
> try
> {
> MarkerUtil.createMarkers(status);
> }
> catch (CoreException e)
> {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
> This will not create any markers since in:
>
> file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(
> new Path(fileResourcePath.toString()));
>
> file is alway null. It seems to me that this function is only for
> resources in the workspace. But the getTarget().eResource().getURI()
> will return a absoulte path to the file I loaded.
>
>
> Thanks for help and best regards,
> Kristian
>
>
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02781 seconds