Problem view and IMarker [message #157437] |
Sat, 27 October 2007 21:27  |
Eclipse User |
|
|
|
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 09:00   |
Eclipse User |
|
|
|
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 12:50   |
Eclipse User |
|
|
|
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 11:50  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.05839 seconds