|
|
|
|
Re: Set Custom Marker on ClassFile [message #506646 is a reply to message #506615] |
Fri, 08 January 2010 13:37 |
Ben H Messages: 13 Registered: July 2009 |
Junior Member |
|
|
Hi Daniel,
thanks for you help so far. I tried your way, but didnt really got it to
work. Now I tried to create only to create the marker on the
WorkspaceRoot and then adding a SimpleMarkerAnnotation to the
annotationModel of the DocumentProvider of the editor.
That worked so far, but even if I set the Marker persistent, the
annotation in the editor isnt persistent. The bookmark remains and is
shown in the BookmarksView, but the ClassFileEditor doesnt have the
marker on a restart of eclipse.
Do you have an idea?
Thanks in advance,
Ben
schrieb Daniel Megert:
> Ben Herfurth wrote:
>> Hi Daniel,
>>
>> schrieb Daniel Megert:
>>> You need to attach it to another resource, e.g. the workspace root. See
>> how can I do this?
>>> also org.eclipse.jdt.core.JavaCore.addJavaElementMarkerAttributes (Map,
>>> IJavaElement)
>>>
>>> Dani
>>
>> So first thing i have to do is, to attach the ClassFile to the
>> workspaceRoot.
> No, you don't have to "attach" anything.
>> Then i add the MarkerAttributes via the JavaCore-Method.
>> Then i can create the marker on the WorkspaceRoot-Resource? Is that
>> correct?
> Yes.
>
> Dani
>>
>> Thanks in advance,
>> Ben
|
|
|
Re: Set Custom Marker on ClassFile [message #506650 is a reply to message #506646] |
Fri, 08 January 2010 13:58 |
Dani Megert Messages: 3802 Registered: July 2009 |
Senior Member |
|
|
Ben Herfurth wrote:
> Hi Daniel,
>
> thanks for you help so far. I tried your way, but didnt really got it
> to work. Now I tried to create only to create the marker on the
> WorkspaceRoot and then adding a SimpleMarkerAnnotation to the
> annotationModel of the DocumentProvider of the editor.
> That worked so far, but even if I set the Marker persistent, the
> annotation in the editor isnt persistent. The bookmark remains and is
> shown in the BookmarksView, but the ClassFileEditor doesnt have the
> marker on a restart of eclipse.
> Do you have an idea?
Normally the editor's marker annotation model only knows about markers
on the resource. If you do special things like having markers on the
workspace root you need to handle this yourself. The
org.eclipse.jdt.internal.ui.javaeditor.ClassFileMarkerAnnota tionModel
does something like that.
Dani
>
> Thanks in advance,
> Ben
>
> schrieb Daniel Megert:
>> Ben Herfurth wrote:
>>> Hi Daniel,
>>>
>>> schrieb Daniel Megert:
>>>> You need to attach it to another resource, e.g. the workspace root.
>>>> See
>>> how can I do this?
>>>> also org.eclipse.jdt.core.JavaCore.addJavaElementMarkerAttributes (Map,
>>>> IJavaElement)
>>>>
>>>> Dani
>>>
>>> So first thing i have to do is, to attach the ClassFile to the
>>> workspaceRoot.
>> No, you don't have to "attach" anything.
>>> Then i add the MarkerAttributes via the JavaCore-Method.
>>> Then i can create the marker on the WorkspaceRoot-Resource? Is that
>>> correct?
>> Yes.
>>
>> Dani
>>>
>>> Thanks in advance,
>>> Ben
>
|
|
|
Powered by
FUDForum. Page generated in 0.03812 seconds