Problems with Search (hacked) in 2.1 [message #42643] |
Wed, 21 May 2003 14:56  |
Eclipse User |
|
|
|
WinXP, R2.0.2=>2.1
I needed to have the SearchResults View display something other than the
filename, when doing a "TextSearch" in our plugin, so I wound up
supplying our own LabelProvider in
TextSearchResultCollector.aboutToStart(), like this:
public void aboutToStart () throws CoreException {
fView= SearchUI.getSearchResultView();
fMatchCount= 0;
fLastUpdateTime= 0;
if (fView != null) {
fView.searchStarted(
new TextSearchActionGroupFactory(),
fOperation.getSingularLabel(),
fOperation.getPluralLabelPattern(),
fOperation.getImageDescriptor(),
TextSearchPage.EXTENSION_POINT_ID,
new NodeLabeler(),
// new FileLabelProvider(FileLabelProvider.SHOW_LABEL_PATH),
new GotoMarkerAction(),
new GroupByKeyComputer(),
fOperation);
}
}
(NodeLabeler is pretty basic, and works fine)
In order to be able to do that, I had in the end to copy (and reorganize
imports upon) about a dozen classes (since they were package-access or
had package-access constructors or methods); in 2.0.2 this worked; but
when I upgraded to 2.1, it broke (no blame: I knew I was using internal
stuff). However, now I cannot get the same procedure to work (copying
all relevant package-limited classes) -- the TextSearch runs, and then
crashes like this:
java.lang.ClassCastException:
org.eclipse.core.internal.resources.ResourceProxy
at
org.eclipse.core.internal.resources.Resource$1.visitElement( Resource.java:54)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:76)
at
org.eclipse.core.internal.watson.ElementTreeIterator.iterate (ElementTreeIterator.java:119)
at
org.eclipse.core.internal.resources.Resource.accept(Resource .java:60)
at
com.foo.bar.wizards.search.AmountOfWorkCalculator.process(Am ountOfWorkCalculator.java:44)
at
com.foo.bar.wizards.search.TextSearchEngine.search(TextSearc hEngine.java:46)
at
com.foo.bar.wizards.search.TextSearchOperation.execute(TextS earchOperation.java:51)
What is up with ResourceProxy? Do we have to reconfigure our whole
system to use those instead of Resources now?
Thanks,
Paul
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.27247 seconds