Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-search-dev] Creating potential matches with new search UI

Hi Martin,

thank you for these clarifications about potential matches.
If I understand you correctly, there's no standard possibility (through one of the extension points of the search plugin) to create different types of matches. I have a good idea how to define the colour preference in a view preference. However, I didn't find out yet, how I can create matches so that they use my colour.

Right now, our plugin creates Match[] arrays and feeds them to AbstractTextSearchResult#addMatches - end of the story. I guess that it, somehow translates matches into markers (or annotations?) internally. Can I influence this translation in some way, i.e. set the colour of my match, have more than one match type? Does it involve defining own subclasses of (Text)Marker? Or rather Annotations? How could I control these markers?

My problem is currently that I have no clue where to start, so I'd be happy about good hints.

Thanks in advance,

Steffen

Martin Aeschlimann wrote:
Hi Steffen,
good point. The potential matches preference can be considered old legacy
from the old search and I wouldn't mind getting rid of it. It is still used
by Java search, but only to color the matches in the result view. It has no
influence to the search annotations shown in the editor. As you said,
there's no API for the color preference key, the Java plugin just
hard-codes it (bad!).
If the potential matches color is for use for you, I suggest to define one
yourself on your own preference dialog. That preference dialog would best
be a view preference (means it is available through the search view menu
only, not in the global preferences).
If I find time, I'll do the same for the Java search and eliminate the
global preference.

Martin

From: Steffen Ryll <steffen.ryll@xxxxxxxxxxxxxxxxxxxxxxxxxx> To: platform-search-dev@xxxxxxxxxxx) Cc: Oleksandr Panchenko <panchenko@xxxxxxxxxxxxxxxxxx> Date: 11.06.2008 17:40 Subject: [platform-search-dev] Creating potential matches with new search UI
Hi all,

I'm currently involved in a project where our plugin embeds a custom
search engine into Eclipse. These days we discovered the colour setting
for potential matches (configurable on the Search preference Page).

The question we could not find any response to yet is, how can we create
such potential matches programmatically?

We are using NewSearchUI so far, which also has a method
arePotentialMatchesIgnored(). However, we could not find a facility to
create such potential match markers. SearchUI contains a constants
hinting at that, but we are not sure how that shall be used. And, could
we mix SearchUI and NewSearchUI functionality?!? I guess not...


A few words about the intention of our project:
For searching source code, we use an index (improve speed). We want to
enrich Java code with include additional information, such as Javadoc
texts belonging to a called method. Hence, we might find a hit that is
not literally included in source code, but virtually belongs to it. We
would like to indicate such hits as potential matches with a different
colour.



Back to the top