Comments (3)
I had used the below code to search the result from your code ,but It cannot search the result firstly the "contentProvider" object is empty,but if you invoked these code secondly ,it will get the search result .it's very strange .
QuickTextQuery newFilter = createFilter();
System.out.println("search content is:"+newFilter);
if (this.searcher==null) {
if (!newFilter.isTrivial()) {
searcher = new QuickTextSearcher(newFilter, context.createPriorityFun(), new QuickTextSearchRequestor(){
@OverRide
public void add(LineItem match) {
System.out.println("QuickTextSearchRequestor add function..."+contentProvider.getNumberOfElements());
contentProvider.add(match);
smallProvider.add(match);
myitem.add(match);
contentProvider.refresh();
}
@Override
public void clear() {
System.out.println("QuickTextSearchRequestor clear function...");
contentProvider.reset();
contentProvider.refresh();
}
@Override
public void revoke(LineItem match) {
System.out.println("QuickTextSearchRequestor revoke function...");
contentProvider.remove(match);
contentProvider.refresh();
}
@Override
public void update(LineItem match) {
contentProvider.refresh();
}
});
}
}else {
//The QuickTextSearcher is already active update the query
this.searcher.setQuery(newFilter);
}
if (progressJob!=null) {
progressJob.schedule();
}
System.out.println("content find is:"+contentProvider.getNumberOfElements()+",content are :\n"+contentProvider.items.toString());
from eclipse-integration-commons.
The quick text searcher is 'asynchronous' and adds and removes results to
the search requestor over time. There never is a final 'result'.
The responsibility of the SearchRequestor is to update the evolving results
in the UI as they arrive or get revoked.
So you can not perform a search and get 'the result'.
I think your test code launches a search and then immediately prints the
number of results once.
So it really only prints the few results that have already been found in
the few milliseconds since the
result got started. The search is still running and would find more results
later if you let it.
If you want to have a more meaningful test, you should keep the quickserach
object alive (i.e. not call
'cancel' on it and print the number of results in your contentProvider each
time it changes
(i.e. each time 'add', 'update', 'revoke' or 'clear' is called on the
requestor.)
You should see more results getting added over time.
If you change the query the live results will be updated (i.e. depending on
the query change
either the results will be cleared completely and search restarted, or the
search keeps going
and some already found elements are selectively 'revoked'.
Kris
On Mon, Nov 3, 2014 at 6:07 AM, Alter [email protected] wrote:
I had used the below code to search the result from your code ,but It
cannot search the result firstly the "contentProvider" object is empty,but
if you invoked these code secondly ,it will get the search result .it's
very strange .QuickTextQuery newFilter = createFilter();
System.out.println("search content is:"+newFilter);
if (this.searcher==null) {
if (!newFilter.isTrivial()) {
searcher = new QuickTextSearcher(newFilter, context.createPriorityFun(),
new QuickTextSearchRequestor(){
@OverRide https://github.com/Override
public void add(LineItem match) {
System.out.println("QuickTextSearchRequestor add
function..."+contentProvider.getNumberOfElements());
contentProvider.add(match);
smallProvider.add(match);
myitem.add(match);
contentProvider.refresh();
}@Override public void clear() { System.out.println("QuickTextSearchRequestor clear function..."); contentProvider.reset(); contentProvider.refresh(); } @Override public void revoke(LineItem match) { System.out.println("QuickTextSearchRequestor revoke function..."); contentProvider.remove(match); contentProvider.refresh(); } @Override public void update(LineItem match) { contentProvider.refresh(); } }); } }else { //The QuickTextSearcher is already active update the query this.searcher.setQuery(newFilter); } if (progressJob!=null) { progressJob.schedule(); } System.out.println("content find is:"+contentProvider.getNumberOfElements()+",content are :\n"+contentProvider.items.toString());
—
Reply to this email directly or view it on GitHub
#11 (comment)
.
from eclipse-integration-commons.
@kdvolder ,
thanks very much for your support .i had researched your code and now implement in my plugin .
it's really very awesome with 'asynchronous" status to check the result ....
thanks for your guys .i will under your plugin license for my plugin ...
Alter
from eclipse-integration-commons.
Related Issues (12)
- Add File -> New -> Gradle project for Spring and Java perspective
- Not able to use the update sites from Eclipse Mars HOT 2
- Dashboard 3rd tab with configured plugin list HOT 3
- Eclipse Quick Text Search can't find text after line longer than 1000 chars HOT 6
- is there a way to include in quick search also "derived resources" HOT 1
- Add File -> New -> Maven project for Spring and Java perspective HOT 1
- cannot build for e37. Succeeded only with mvn -Pe42 HOT 2
- Can't install Quick Search for Eclipse into Eclipse 4.3 for JEE Developers HOT 1
- Make Quick Search dialog not modal HOT 7
- change keybinding for Quick Search HOT 1
- [question] Is it possible to use Spring UAA plugin and server to collect non-Spring project usage data HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eclipse-integration-commons.