Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Problem view and IMarker
Problem view and IMarker [message #157437] Sun, 28 October 2007 01:27 Go to next message
Eclipse UserFriend
Originally posted by: ijerez2001.msn.com

Hello,

I have a problem with IMarkers.
I have show the problem view but when I try to write a new problem with this
code:

final IFile file =
org.eclipse.emf.workspace.util.WorkspaceSynchronizer.getFile (diagram.eResource());
IMarker marker = file.createMarker(IMarker.PROBLEM);
marker.setAttribute(IMarker.PROBLEM, "An example");

I look that the IFile object (file) is always null.
The element "diagram" is the diagram of my gmf editor.
What am I doing bad?
Is there another way to get the IResource?

Thanks
Re: Problem view and IMarker [message #157484 is a reply to message #157437] Mon, 29 October 2007 13:00 Go to previous messageGo to next message
Boris Blajer is currently offline Boris BlajerFriend
Messages: 217
Registered: July 2009
Senior Member
Hi Iván,

Are you in the RCP mode? With RCP, there is no guarantee that EMF
resources actually map to any resource in Eclipse, e.g., because RCP has
no notion of resources. While GMF-RCP does have a dependency on
org.eclipse.core.resources, it is assumed that it may go away in the
future. Thus, the URIs GMF creates for EMF resource in the RCP mode are
not platform-related (not platform:/..., but file:/...), and cannot be
interpreted by WorkspaceSynchronizer.

Best regards,
Boris


Iván Jerez wrote:
> Hello,
>
> I have a problem with IMarkers.
> I have show the problem view but when I try to write a new problem with
> this code:
>
> final IFile file =
> org.eclipse.emf.workspace.util.WorkspaceSynchronizer.getFile (diagram.eResource());
>
> IMarker marker = file.createMarker(IMarker.PROBLEM);
> marker.setAttribute(IMarker.PROBLEM, "An example");
>
> I look that the IFile object (file) is always null.
> The element "diagram" is the diagram of my gmf editor.
> What am I doing bad?
> Is there another way to get the IResource?
>
> Thanks
Re: Problem view and IMarker [message #157530 is a reply to message #157484] Mon, 29 October 2007 16:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ijerez2001.gmail.com

I am in RCP mode, with a GMF editor.
I am trying now with this code:
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IResource resource = workspace.getRoot();
IMarker marker = resource.createMarker(IMarker.PROBLEM);
marker.setAttribute(IMarker.MESSAGE, "This is a example");

But it don´t work well. It create a IMarker problem, but an error occur.
The error say:
"An error has occurred. See error log for more details.
null argument:"

Thanks

"Boris Blajer" <boris.blajer@borland.com> escribió en el mensaje de
noticias:fg4lh0$kh3$1@build.eclipse.org...
> Hi Iván,
>
> Are you in the RCP mode? With RCP, there is no guarantee that EMF
> resources actually map to any resource in Eclipse, e.g., because RCP has
> no notion of resources. While GMF-RCP does have a dependency on
> org.eclipse.core.resources, it is assumed that it may go away in the
> future. Thus, the URIs GMF creates for EMF resource in the RCP mode are
> not platform-related (not platform:/..., but file:/...), and cannot be
> interpreted by WorkspaceSynchronizer.
>
> Best regards,
> Boris
>
>
> Iván Jerez wrote:
>> Hello,
>>
>> I have a problem with IMarkers.
>> I have show the problem view but when I try to write a new problem with
>> this code:
>>
>> final IFile file =
>> org.eclipse.emf.workspace.util.WorkspaceSynchronizer.getFile (diagram.eResource());
>> IMarker marker = file.createMarker(IMarker.PROBLEM);
>> marker.setAttribute(IMarker.PROBLEM, "An example");
>>
>> I look that the IFile object (file) is always null.
>> The element "diagram" is the diagram of my gmf editor.
>> What am I doing bad?
>> Is there another way to get the IResource?
>>
>> Thanks
Re: Problem view and IMarker [message #157713 is a reply to message #157530] Tue, 30 October 2007 15:50 Go to previous message
Eclipse UserFriend
Originally posted by: ijerez2001.msn.com

I know whit was the problem.
The problem was that the null arguments were the icon for the problem view.
There weren´t icons.

"Iván Jerez" <ijerez2001@gmail.com> escribió en el mensaje de
noticias:fg531t$bm2$1@build.eclipse.org...
>I am in RCP mode, with a GMF editor.
> I am trying now with this code:
> IWorkspace workspace = ResourcesPlugin.getWorkspace();
> IResource resource = workspace.getRoot();
> IMarker marker = resource.createMarker(IMarker.PROBLEM);
> marker.setAttribute(IMarker.MESSAGE, "This is a example");
>
> But it don´t work well. It create a IMarker problem, but an error occur.
> The error say:
> "An error has occurred. See error log for more details.
> null argument:"
>
> Thanks
>
> "Boris Blajer" <boris.blajer@borland.com> escribió en el mensaje de
> noticias:fg4lh0$kh3$1@build.eclipse.org...
>> Hi Iván,
>>
>> Are you in the RCP mode? With RCP, there is no guarantee that EMF
>> resources actually map to any resource in Eclipse, e.g., because RCP has
>> no notion of resources. While GMF-RCP does have a dependency on
>> org.eclipse.core.resources, it is assumed that it may go away in the
>> future. Thus, the URIs GMF creates for EMF resource in the RCP mode are
>> not platform-related (not platform:/..., but file:/...), and cannot be
>> interpreted by WorkspaceSynchronizer.
>>
>> Best regards,
>> Boris
>>
>>
>> Iván Jerez wrote:
>>> Hello,
>>>
>>> I have a problem with IMarkers.
>>> I have show the problem view but when I try to write a new problem with
>>> this code:
>>>
>>> final IFile file =
>>> org.eclipse.emf.workspace.util.WorkspaceSynchronizer.getFile (diagram.eResource());
>>> IMarker marker = file.createMarker(IMarker.PROBLEM);
>>> marker.setAttribute(IMarker.PROBLEM, "An example");
>>>
>>> I look that the IFile object (file) is always null.
>>> The element "diagram" is the diagram of my gmf editor.
>>> What am I doing bad?
>>> Is there another way to get the IResource?
>>>
>>> Thanks
>
Previous Topic:RCP Validation and Problem View
Next Topic:Exception when creating connections with Feature Seq Initializer value other than the default value
Goto Forum:
  


Current Time: Wed Jul 03 17:22:02 GMT 2024

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

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

Back to the top