Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Problems with Search (hacked) in 2.1
Problems with Search (hacked) in 2.1 [message #42643] Wed, 21 May 2003 14:56 Go to next message
Eclipse UserFriend
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
Re: Problems with Search (hacked) in 2.1 [message #42931 is a reply to message #42643] Wed, 21 May 2003 16:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Hi Paul,

text search was changed in 2.1 to use the new IResourceProxy instead of
IResource when visiting workspace resources. This was done during the
performance tuning phase: the proxies are much cheaper than the
resources itself as long as the contents itself is not requested.

Some of the text search code is no longer package visible in 2.1 (but
still declared internal). The problem in your code is probably somewhere
in a visitor or in one of the calls - most likely in your copy of the
text search engine. If you need additional help and don't want to share
the code here you can directly mail to me. In addition I suggest to file
a RFE in bugzilla which specifies which APIs you missed in performing
your task.

HTH
Dani
Re: Problems with Search (hacked) in 2.1 [message #45694 is a reply to message #42931] Fri, 23 May 2003 10:09 Go to previous messageGo to next message
Eclipse UserFriend
Daniel Megert wrote:

> ... If you need additional help and don't want to share
> the code here you can directly mail to me.

Many thanks -- that worked (was a simple problem, but took "other eyes", and
expert ones, to see).


> In addition I suggest to file
> a RFE in bugzilla which specifies which APIs you missed in performing
> your task.

Um, "RFE"? I'd be glad to do it.

Thanks,
Paul K
Re: Problems with Search (hacked) in 2.1 [message #46098 is a reply to message #45694] Fri, 23 May 2003 11:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Paul T. Keyser wrote:

>>In addition I suggest to file
>>a RFE in bugzilla which specifies which APIs you missed in performing
>>your task.
>>
>>
>
>Um, "RFE"? I'd be glad to do it.
>
Request For Enhancement ;-)

Dani
Re: Problems with Search (hacked) in 2.1 [message #46663 is a reply to message #46098] Fri, 23 May 2003 14:55 Go to previous message
Eclipse UserFriend
OK: https://bugs.eclipse.org/bugs/show_bug.cgi?id=38062

Thanks again,
Paul K

Daniel Megert wrote:

> Paul T. Keyser wrote:
>
> >>In addition I suggest to file
> >>a RFE in bugzilla which specifies which APIs you missed in performing
> >>your task.
> >>
> >>
> >
> >Um, "RFE"? I'd be glad to do it.
> >
> Request For Enhancement ;-)
>
> Dani
Previous Topic:Key Binding for Maximize Editor Window
Next Topic:Eclipse and Log4J
Goto Forum:
  


Current Time: Tue Jul 15 23:37:56 EDT 2025

Powered by FUDForum. Page generated in 0.27247 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top