Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Participtiong in Java search queries
Participtiong in Java search queries [message #334675] Tue, 24 February 2009 13:56 Go to next message
Alex Berezkin is currently offline Alex BerezkinFriend
Messages: 7
Registered: July 2009
Junior Member
Hello,

I want my Eclipse plugin to participate in Java search quires. I have
found that I should do two things for this:

1). Declare an extension in plugin.xml file like an example there:
http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse. jdt.doc.isv/reference/extension-points/org_eclipse_jdt_ui_qu eryParticipants.html

2). Implement IQueryParticipant with name that corresponds to the one
declared in the plugin.xml file.

The implemented methods of IQueryParticipant interface are stubs that only
show the debug messages.

The project compiled and launched without a mistakes, plugin successfully
starts, but when I try to search something (with all possible ways), my
plugin doesn't show any activity.

Can anybody help me? What have I failed to take into an account?

Thanks a lot.
Re: Participtiong in Java search queries [message #334678 is a reply to message #334675] Tue, 24 February 2009 14:47 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Alex Berezkin wrote:
> Hello,
>
> I want my Eclipse plugin to participate in Java search quires. I have
> found that I should do two things for this:
>
> 1). Declare an extension in plugin.xml file like an example there:
> http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse. jdt.doc.isv/reference/extension-points/org_eclipse_jdt_ui_qu eryParticipants.html
>
>
> 2). Implement IQueryParticipant with name that corresponds to the one
> declared in the plugin.xml file.
>
> The implemented methods of IQueryParticipant interface are stubs that
> only show the debug messages.
>
> The project compiled and launched without a mistakes, plugin
> successfully starts, but when I try to search something (with all
> possible ways), my plugin doesn't show any activity.
>
> Can anybody help me? What have I failed to take into an account?
This should work. Are you sure that the project's nature matches the one
you specified?

Dani
>
> Thanks a lot.
>
>
Re: Participtiong in Java search queries [message #334680 is a reply to message #334678] Tue, 24 February 2009 15:35 Go to previous messageGo to next message
Alex Berezkin is currently offline Alex BerezkinFriend
Messages: 7
Registered: July 2009
Junior Member
It really doesn't work. Maybe there is really another project nature.
Then, how can I check the project nature? Or maybe I should run Search in
some special way? I use standard Java Search...

Daniel Megert wrote:

> Alex Berezkin wrote:
>> Hello,
>>
>> I want my Eclipse plugin to participate in Java search quires. I have
>> found that I should do two things for this:
>>
>> 1). Declare an extension in plugin.xml file like an example there:
>>
http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse. jdt.doc.isv/reference/extension-points/org_eclipse_jdt_ui_qu eryParticipants.html
>>
>>
>> 2). Implement IQueryParticipant with name that corresponds to the one
>> declared in the plugin.xml file.
>>
>> The implemented methods of IQueryParticipant interface are stubs that
>> only show the debug messages.
>>
>> The project compiled and launched without a mistakes, plugin
>> successfully starts, but when I try to search something (with all
>> possible ways), my plugin doesn't show any activity.
>>
>> Can anybody help me? What have I failed to take into an account?
> This should work. Are you sure that the project's nature matches the one
> you specified?

> Dani
>>
>> Thanks a lot.
>>
>>
Re: Participtiong in Java search queries [message #334698 is a reply to message #334680] Wed, 25 February 2009 10:50 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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?

Dani
>
> Daniel Megert wrote:
>
>> Alex Berezkin wrote:
>>> Hello,
>>>
>>> I want my Eclipse plugin to participate in Java search quires. I
>>> have found that I should do two things for this:
>>>
>>> 1). Declare an extension in plugin.xml file like an example there:
> http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse. jdt.doc.isv/reference/extension-points/org_eclipse_jdt_ui_qu eryParticipants.html
>
>>>
>>>
>>> 2). Implement IQueryParticipant with name that corresponds to the
>>> one declared in the plugin.xml file.
>>>
>>> The implemented methods of IQueryParticipant interface are stubs
>>> that only show the debug messages.
>>>
>>> The project compiled and launched without a mistakes, plugin
>>> successfully starts, but when I try to search something (with all
>>> possible ways), my plugin doesn't show any activity.
>>>
>>> Can anybody help me? What have I failed to take into an account?
>> This should work. Are you sure that the project's nature matches the
>> one you specified?
>
>> Dani
>>>
>>> Thanks a lot.
>>>
>>>
>
>
Re: Participtiong in Java search queries [message #334706 is a reply to message #334698] Wed, 25 February 2009 11:30 Go to previous messageGo to next message
Alex Berezkin is currently offline Alex BerezkinFriend
Messages: 7
Registered: July 2009
Junior Member
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.

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.
Re: Participtiong in Java search queries [message #334727 is a reply to message #334706] Wed, 25 February 2009 14:54 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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.
>
>
Re: Participtiong in Java search queries [message #334758 is a reply to message #334727] Thu, 26 February 2009 09:48 Go to previous message
Alex Berezkin is currently offline Alex BerezkinFriend
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.
Previous Topic:Showing Perspective shortcut in toolbar
Next Topic:RCP Release Strategy
Goto Forum:
  


Current Time: Thu Apr 25 12:17:31 GMT 2024

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

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

Back to the top