Building a searchbar into an Eclipse View Plugin

2019-08-06 03:13发布

问题:

I'm looking for some ideas/resources on how to approach building a search bar on top of an existing view eclipse plugin. I want something similar to what the Task List view in eclipse has:

http://help.targetprocess.com/images/integration_api/eclipse3.png?1337868355

The view I want to build this on is just a simple list of objects, basically exactly like the simple view tutorials eclipse PDE provides. Nothing complicated.

I've searched around and there doesn't seem to be much information on this. If anyone could give me some guidance on how to start, that would be great.

Thanks for any help!

回答1:

You want to create an SWT Text component with style SEARCH. There is an SWT snippet showing the applicable style combinations. That gives you the input field with the icon and some message, but you still have to implement the necessary filtering on the list yourself.



回答2:

I don't think you will find anything written about doing this as it's pretty low level. What I would do is just to look at the source code of the thing that has what you want. And you can steal it as you like (provided you follow the EPL rules).