|
|
|
|
|
|
Re: Participtiong in Java search queries [message #334758 is a reply to message #334727] |
Thu, 26 February 2009 09:48 |
Alex Berezkin Messages: 7 Registered: July 2009 |
Junior Member |
|
|
Daniel Megert wrote:
> Alex Berezkin wrote:
>> Daniel Megert wrote:
>>
>>> Alex Berezkin wrote:
>>>> It really doesn't work. Maybe there is really another project
>>>> nature. Then, how can I check the project nature?
>>> You see it in the .project file.
>>>> Or maybe I should run Search in some special way? I use standard
>>>> Java Search...
>>> Via code or via UI?
>>
>> Via UI.
>>
>> OK, it seems to me that I have not described the problem sufficiently.
>> Now I'll try to do it in full.
>>
>> Suppose that my plugin is located in a project named org.example. I
>> want my plugin to search something with some special way in a standard
>> Java projects. For this I make the following:
>>
>> 1). Declare an extension in plugin.xml file. This extension looks like
>> following:
>>
>> <extension
>> point="org.eclipse.jdt.ui.queryParticipants">
>> <queryParticipant
>> name="Example Query Participant"
>> nature="org.eclipse.jdt.core.javanature"
>> class="org.example.ui.QueryParticipant"
>> id="org.example.ui.QueryParticipant">
>> </queryParticipant>
>> </extension>
>>
>> 2). Implement IQueryParticipant interface in a class
>> org.example.ui.QueryParticipant. Implemented methods of the interface
>> and the constructor are just the stubs that display only the debug
>> messages.
>>
>> 3). Run the platform with my plugin, check that it has started
>> successfully.
>>
>> 4). Create the standard Java project via UI (File -> New -> Project ->
>> Java Project).
>>
>> 5). Select a Java project (or the Java file) in the Project Explorer,
>> then invoke Search via UI (Search -> Search) and try to search
>> something with all the possible ways. In this moment I expect my
>> plugin to appear with some activity, but my expectations fail.
> This looks OK. I suggest you start with -debug and also take a look at
> the .log. In addition check that your participant is public and has a
> 0-arg constructor.
> Dani
>>
>> Maybe, I can not specify a search extension for standard projects in
>> such a way? Maybe I can extend search only in user-defined project types?
>>
>> Thanks a lot, Daniel, for your participating.
>>
>>
I looked into the .log, and I have found that the environment really tries
to start the participant, but fails with exception. It turned out, that
QueryParticipant is not able to show any info messages. Therefore, I am
starting to realize the search in a proper way.
Thank you very much for discussion.
|
|
|
Powered by
FUDForum. Page generated in 0.05631 seconds