Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to create Marker on elements which are not IResource?(How can we create the Markers on the elements which are not IResource)
How to create Marker on elements which are not IResource? [message #510612] Wed, 27 January 2010 19:37 Go to next message
Eclipse UserFriend
Any tips on how to create the Marker on the element which is not of type IResource, but just any PlatformObject sub-type.

Just like a class can have methods which are not the actual resources, so we can show both IResource and simple platform objects in project explorer, but how to create the markers on the non resource items?

I know JDT does this by creating the marker on "SourceMethod" which is not the actual resource? Any tips will be helpful here.

TIA

Re: How to create Marker on elements which are not IResource? [message #510653 is a reply to message #510612] Thu, 28 January 2010 03:36 Go to previous messageGo to next message
Eclipse UserFriend
SH wrote:
> Any tips on how to create the Marker on the element which is not of
> type IResource, but just any PlatformObject sub-type.
>
> Just like a class can have methods which are not the actual resources,
> so we can show both IResource and simple platform objects in project
> explorer, but how to create the markers on the non resource items?
>
> I know JDT does this by creating the marker on "SourceMethod" which is
> not the actual resource? Any tips will be helpful here.
We attach the marker to the workspace root and set attributes that allow
to recognize the element (e.g. Java element handle identifier).

Dani
>
> TIA
>
>
Re: How to create Marker on elements which are not IResource? [message #510885 is a reply to message #510653] Thu, 28 January 2010 19:24 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Dani,

I see, so the marker is actually set on the IResource of the workbench root, than I wonder, where is the code for showing the "SourceMethod" with the problem marker icon in the project explorer and package explorer, how is that handled? So, do you guys do this manually somewhere? Can you point me to the code?

Also, how does open the problem view double clicks works for you than, because if the marker is not set on the actual IResource, than IDE.openEditor(IWorkbenchPage, IMarker) simply returns null.
Re: How to create Marker on elements which are not IResource? [message #511669 is a reply to message #510885] Tue, 02 February 2010 03:46 Go to previous messageGo to next message
Eclipse UserFriend
MG wrote:
> Thanks Dani,
>
> I see, so the marker is actually set on the IResource of the workbench
> root, than I wonder, where is the code for showing the "SourceMethod"
> with the problem marker icon
JDT does not add errors to non-resources.
> in the project explorer and package explorer, how is that handled? So,
> do you guys do this manually somewhere? Can you point me to the code?
>
> Also, how does open the problem view double clicks works for you than,
> because if the marker is not set on the actual IResource, than
> IDE.openEditor(IWorkbenchPage, IMarker) simply returns null.
This won't work out of the box but if you have your own editor then you
can let it handle the workspace root as input and then fetch the info
from the marker.

Dani
Re: How to create Marker on elements which are not IResource? [message #511700 is a reply to message #511669] Tue, 02 February 2010 10:15 Go to previous messageGo to next message
Eclipse UserFriend
Hello there,

I can handle the editor open event, no problem, my main concern is how, will the marker icon will be shown on my resource in project explorer? How will project explorer know, that it needs to show marker icon on my domain model element which is not IResource?
Re: How to create Marker on elements which are not IResource? [message #511709 is a reply to message #511700] Tue, 02 February 2010 10:51 Go to previous message
Eclipse UserFriend
MG wrote:
> Hello there,
>
> I can handle the editor open event, no problem, my main concern is
> how, will the marker icon will be shown on my resource in project
> explorer? How will project explorer know, that it needs to show marker
> icon on my domain model element which is not IResource?
It won't.

Dani
Previous Topic:How to open Java Editor
Next Topic:Error - Help
Goto Forum:
  


Current Time: Sat Mar 15 01:49:23 EDT 2025

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

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

Back to the top