How does SearchableConfigurable work

Hi,

I try to make the settings of a plugin searchable. I tried implementing/subclassing SearchableConfigurable, SearchableConfigurable.Parent, SearchableConfigurable.Parent.Abstract, but without any success.

The setting is as follows. In the tree of the Settings window there is a node called "Osmorc" and a subnode of it is called "Project Settings". On the "Project Settings" page there is a label "Framework Instance".

When I type in "Framework" into the search box at the top of the tree, I want this label to be highlighted.
When I start typing while on the "Project Settings" page I shortly see how the label is highlighted, but then the whole tree of the plugin vanishes and so does the page. So the important thing seems to be to make sure that the tree contains the node since as soon as the page is shown the highlighting is done automatically by IDEA.

So how do I make the "Project Settings" node appear for a search for "Framework"?
How does one use all the interfaces and classes in that area? What is "Runnable enableSearch(String option)" used for?

Thanks in advance,
Robert

0
3 comments

Hello Robert,

on the startup you have to register options index via SearchableOptionsRegistrar.addOption()
as well as implementing SearchableConfigurable.

SerchableConfigurable.Parent should be used if you want to plug subtree
to the options tree

Thank you
-


Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

Hi,

I try to make the settings of a plugin searchable. I tried
implementing/subclassing SearchableConfigurable,
SearchableConfigurable.Parent, SearchableConfigurable.Parent.Abstract,
but without any success.

The setting is as follows. In the tree of the Settings window there is
a node called "Osmorc" and a subnode of it is called "Project
Settings". On the "Project Settings" page there is a label "Framework
Instance".

When I type in "Framework" into the search box at the top of the tree,
I want this label to be highlighted.

When I start typing while on the "Project Settings" page I shortly see
how the label is highlighted, but then the whole tree of the plugin
vanishes and so does the page. So the important thing seems to be to
make sure that the tree contains the node since as soon as the page is
shown the highlighting is done automatically by IDEA.

So how do I make the "Project Settings" node appear for a search for
"Framework"?

How does one use all the interfaces and classes in that area? What is
"Runnable enableSearch(String option)" used for?

Thanks in advance,
Robert



0

Hello Anna,

Thanks for the hint, but could you elaborate a bit about the meanings of the parameters of SearchableOptionsRegistrar.addOption. What are option, hit and path?
In the Settings window I have the following nodes
---- Project Settings [Some Project] -----
....
Osmorc
- Project Settings
- IDE Settings
     - Framework Definitions
     - Library Bundling
...

"Osmorc" and "IDE Options" both implement Configurable.Composite among others.
Let's say on "Project Settings" and "Framework Definitions" the word "Framework" should be findable?
On "Library Bundling" the word "Library" should be findable.
In both cases the UI has some element (mostly a label somewhere) that contains the text that should be found there.

And what about the Parent interface. Should "Osmorc" and "IDE Options" implement this interface? What's the difference to not implementing it. Do I only need to use addOption only for the parents, if this interface is implemented?

How would the calls to addOption look like?
Unfortunately there is no example plugin that uses this API.
IntelliJad is the plugin developers best friend, but getting the right information directly from the source would be much more convenient.

Cheers and thanks iin advance,
  Robert

0

I just noticed that my second post on this topic wasn't cross posted to
the newsgroups. So here a second try, now directly to the newsgroup:

Hello Anna,

Thanks for the hint, but could you elaborate a bit about the meanings of
the parameters of SearchableOptionsRegistrar.addOption. What are option,
hit and path?

In the Settings window I have the following nodes

-


Project Settings -



....

Osmorc

- Project Settings

- IDE Settings

- Framework Definitions

- Library Bundling

...



"Osmorc" and "IDE Options" both implement Configurable.Composite among
others.

Let's say on "Project Settings" and "Framework Definitions" the word
"Framework" should be findable?

On "Library Bundling" the word "Library" should be findable.

In both cases the UI has some element (mostly a label somewhere) that
contains the text that should be found there.



And what about the Parent interface. Should "Osmorc" and "IDE Options"
implement this interface? What's the difference to not implementing it.
Do I only need to use addOption only for the parents, if this interface
is implemented?



How would the calls to addOption look like?

Unfortunately there is no example plugin that uses this API.

IntelliJad is the plugin developers best friend, but getting the right
information directly from the source would be much more convenient.



Cheers and thanks in advance,

Robert

0

Please sign in to leave a comment.