Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to highlight / paint a line which has custom marker?
How to highlight / paint a line which has custom marker? [message #490071] Wed, 07 October 2009 08:07 Go to next message
Prasanna K is currently offline Prasanna KFriend
Messages: 78
Registered: July 2009
Member
Hi all,

In my plug-in I have created a custom marker.
Here is how I have used the required extension point in plugin.xml :
<extension
       id="MyOrgMarker"
       name="MyOrgMarker"
       point="org.eclipse.core.resources.markers">
       <super
             type="org.eclipse.core.resources.marker">
       </super>
</extension>

To provide custom icon to the marker I have used following extension point :
<extension
	      point="org.eclipse.ui.ide.markerImageProviders">
    <imageprovider
          id="MyOrg.imageprovider1"
          icon="icons/myMarkerIcon.png"
          markertype="MyPlugin.MyOrgMarker">
    </imageprovider>
</extension>


And here is how I create the marker and jump to the part of file that has the marker:
IMarker marker = null;
marker = sourceIFile.createMarker("MyPlugin.MyOrgMarker");
marker.setAttribute(IMarker.LINE_NUMBER, line);
IDE.openEditor(page, marker);


The marker's icon appears on the left side column on the desired line and the entire line gets highlighted in blue.
If I click anywhere in the file the highlight goes away.

What I want is, instead of blue the line should be painted in orange or some other color and the highlight should stay even if user clicks somewhere in the editor.
How can I achieve this? Is there any extension point I'd be using for this? Or this has to be done by implementing some interface?

Please guide.
Thanks.
-[P]-
http://twitter.com/kaprasanna
Re: How to highlight / paint a line which has custom marker? [message #490095 is a reply to message #490071] Wed, 07 October 2009 10:13 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
kaprasi wrote:
> Hi all,
>
> In my plug-in I have created a custom marker.
> Here is how I have used the required extension point in plugin.xml :
>
> <extension
> id="MyOrgMarker"
> name="MyOrgMarker"
> point="org.eclipse.core.resources.markers">
> <super
> type="org.eclipse.core.resources.marker">
> </super>
> </extension>
>
> To provide custom icon to the marker I have used following extension
> point :
>
> <extension
> point="org.eclipse.ui.ide.markerImageProviders">
> <imageprovider
> id="MyOrg.imageprovider1"
> icon="icons/myMarkerIcon.png"
> markertype="MyPlugin.MyOrgMarker">
> </imageprovider>
> </extension>
>
>
> And here is how I create the marker and jump to the part of file that
> has the marker:
>
> IMarker marker = null;
> marker = sourceIFile.createMarker("MyPlugin.MyOrgMarker");
> marker.setAttribute(IMarker.LINE_NUMBER, line);
> IDE.openEditor(page, marker);
>
>
> The marker's icon appears on the left side column on the desired line
> and the entire line gets highlighted in blue.
> If I click anywhere in the file the highlight goes away.
>
> What I want is, instead of blue the line should be painted in orange
> or some other color and the highlight should stay even if user clicks
> somewhere in the editor.
Please check the archive: this question has been answered several times
already.

Dani
> How can I achieve this? Is there any extension point I'd be using for
> this? Or this has to be done by implementing some interface?
>
> Please guide.
> Thanks.
> -[P]-
> http://twitter.com/kaprasanna
Re: How to highlight / paint a line which has custom marker? [message #490120 is a reply to message #490095] Wed, 07 October 2009 12:44 Go to previous messageGo to next message
Prasanna K is currently offline Prasanna KFriend
Messages: 78
Registered: July 2009
Member
[quote title=Dani Megert wrote on Wed, 07 October 2009 06:13]
Please check the archive: this question has been answered several times
already.

Dani

I must say I am not able to find any help about this after digging the platform newsgroup archive for hours together.
Following are links to a few of the results that are either unanswered or something that not what I want :

http://dev.eclipse.org/newslists/news.eclipse.tools.jdt/msg1 8817.html
http://www.eclipse.org/newsportal/article.php?id=36791&g roup=eclipse.platform.rcp
http://www.java-forums.org/eclipse/6827-eclipse-plugin-marke rs.html

Article
http://eclipse.org/articles/Article-Mark%20My%20Words/mark-m y-words.html

It'd be enough if you point to such a archived discussion or some initial pointers from where I can research more.

Thanks.
Re: How to highlight / paint a line which has custom marker? [message #505055 is a reply to message #490120] Fri, 25 December 2009 20:55 Go to previous message
aravindo  is currently offline aravindo Friend
Messages: 1
Registered: December 2009
Junior Member
Hi Prasanna,
I have exactly the same requirement. I need to set the background color of a specific lines of text in the TextEditor.
Were you able to find a way to get it done and can you tell me how to do so.


Thanks,
Aravindo
Previous Topic:logging for org.eclipse.ui.menus extension and for the platform's handling of menus added by this?
Next Topic:About OleDB Connection
Goto Forum:
  


Current Time: Tue Mar 19 06:12:17 GMT 2024

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

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

Back to the top