Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to highlight a text with my plugin?
How to highlight a text with my plugin? [message #1785991] Mon, 23 April 2018 18:23 Go to next message
Eclipse UserFriend
Hi,

I'm trying to develop an Eclipse Plugin. I have a tree view in my plugin and my tree elements have the source code's statement(like catch block, for loop, etc. in default Eclipse Editor).Now i want this; when user clicks the any of item in the view, (i mean select a statement) this statement should be highlighted in editor.

To achieve my goal, I don't want to create a new editor in eclipse, I want to extend the default java editor to highlight some words.


Thanks in advance.

[Updated on: Fri, 27 April 2018 10:08] by Moderator

Re: How to highlight a text with my plugin? [message #1786114 is a reply to message #1785991] Wed, 25 April 2018 13:49 Go to previous messageGo to next message
Eclipse UserFriend
The Java editors are instances of JavaEditor. JavaEditor supports setSelection(IJavaElement) to select a high-level element (e.g., a method or field). JavaEditor is also an AbstractTextEditor, which treats its content as a long string called a Document, and supports both selectAndReveal(int offset, int length). You'll need to figure out where your corresponding element lives in the document.
Re: How to highlight a text with my plugin? [message #1786209 is a reply to message #1785991] Thu, 26 April 2018 19:34 Go to previous messageGo to next message
Eclipse UserFriend
I will do this with source code analysis which word/words should i need to highlight.
Re: How to highlight a text with my plugin? [message #1786210 is a reply to message #1786114] Thu, 26 April 2018 19:35 Go to previous message
Eclipse UserFriend
Quote:
The Java editors are instances of JavaEditor. JavaEditor supports setSelection(IJavaElement) to select a high-level element (e.g., a method or field). JavaEditor is also an AbstractTextEditor, which treats its content as a long string called a Document, and supports both selectAndReveal(int offset, int length). You'll need to figure out where your corresponding element lives in the document.




Thank you so much, hopefully it may help.

[Updated on: Fri, 27 April 2018 10:07] by Moderator

Previous Topic:convert eclipse rcp project into Maven2 project
Next Topic:how to create a page with a web-site link
Goto Forum:
  


Current Time: Wed Jul 16 01:42:09 EDT 2025

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

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

Back to the top