DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page Plugin SearchEngine problem
Notices
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Sep 2008
Default Plugin SearchEngine problem - 09-17-2008, 12:05 PM

I am writing an export plugin that should export properties of a specific objects located in the class path .jar files. I am trying to use the SearchEngine.search for this task. The problem is that I am able to find only classes that are located in the source folder (only .java files) and I am not able to find the classes that are located in the .jar files.
I see that the project contains the .jar files, but the search doesn't match them.
Here is the code that I am using:
public void initModel() {
try {
IWorkspace workspace = ResourcesPlugin.getWorkspace();

// Get the Java model
IJavaModel javaModel = JavaCore.create(workspace.getRoot());

// Get all projects
IJavaProject javaProjects[] = javaModel.getJavaProjects();

// Create search pattern
SearchPattern pattern = SearchPattern.createPattern("jsystem.framework.sys tem.SystemObjectImpl",
IJavaSearchConstants.CLASS, IJavaSearchConstants.IMPLEMENTORS, SearchPattern.R_EXACT_MATCH);

IJavaSearchScope scope =
SearchEngine.createJavaSearchScope(javaProjects, IJavaSearchScope.SOURCES|IJavaSearchScope.APPLICAT ION_LIBRARIES);

try {
// Search...
SearchEngine searchEngine = new SearchEngine();
searchEngine.search(pattern, new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()},
scope, this, null);
} catch (CoreException ce){
notifyError("CoreException");
}

} catch (JavaModelException je) {
notifyError("JavaModelException");
}
}
Reply With Quote
Reply

Tags
eclipse, javadoc, plugin, search

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem installing plugin over local update site zmajmatic Eclipse 0 10-19-2008 12:27 PM
problem with classloader from plugin nev.clark Eclipse 9 09-30-2008 01:54 PM
rcp plugin dependency on non-plugin project Shefali23 Eclipse 1 07-24-2008 05:06 AM
Problem in creating plugin for RCP workdesk03 Eclipse 0 07-22-2008 03:42 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com