Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add keywords to search preferences in Eclipse

I added a preference by using this example: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/plain/examples/org.eclipse.ui.examples.readmetool/Eclipse%20UI%20Examples%20Readme%20Tool/org/eclipse/ui/examples/readmetool/

For the actual reference refer to this page: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/plain/examples/org.eclipse.ui.examples.readmetool/Eclipse%20UI%20Examples%20Readme%20Tool/org/eclipse/ui/examples/readmetool/ReadmePreferencePage.java )

I only added one checkbox to test it, when I search any word in the checkbox in Preferences I do not see my view coming up but if I type something that currently Eclipse has, then it comes up (i.e. I type background and I can see the General tab staying and being bold).

I guess I somehow need to add search keywords to point to the current page (or something else). But I couldn't find how to add that, or what causes this problem.

So how can I perform searches within the Preferences window for preferences that I have created?

like image 970
Sarp Kaya Avatar asked Oct 27 '25 05:10

Sarp Kaya


1 Answers

There is a org.eclipse.ui.keywords extension point that allows to define keywords that can be assigned to a preference page.

For example:

<extension point="org.eclipse.ui.preferencePages"> 
  <page id="com.xyz.prefpage1" name="XYZ" class="..."> 
     <keywordReference id="xyz.Keyword"/>
  </page> 
</extension> 
<extension point="org.eclipse.ui.keywords">
  <keyword label="foo" id="xyz.Keyword"/>
</extension>    

With the above extension, the XYZ preference page can also be found under the keyword foo, i.e. it will be listed when you type foo in the search field.

like image 79
Rüdiger Herrmann Avatar answered Oct 29 '25 18:10

Rüdiger Herrmann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!