Jump to: navigation, search

JDT Core Programmer Guide

Revision as of 01:33, 19 June 2012 by Ayushman jain.in.ibm.com (Talk | contribs) (JDT Core User Guide moved to JDT Core Programmer Guide: This is more for the implementation details than the usage details)


JDT Core in Eclipse Help

How to Train the JDT Dragon by Ayushman Jain and Stephan Herrmann

JDT Tutorial from EclipseCon 2012 by Ayushman and Stephan is available on github - Please follow instructions here Tutorial handouts

Java Model

Java model is a lightweight model for views.

Search Engine

Indexes of declarations, references and type hierarchy relationships.

Searching steps:

  1. Get the file names from indexes
  2. Parse the file and find out matching nodes
  3. Resolve types and narrow down matches reported from index
  4. Create the appropriate model element

Using the APIs, an example

Create a search pattern:

SearchPattern pattern = SearchPattern.createPattern(
 "foo(*) int", 

Create a search scope:

IJavaSearchScope scope = SearchEngine.createWorkspaceScope();

Collect results using SearchRequestor subclass:

SearchRequestor requestor = new SearchRequestor() {
 public void acceptSearchMatch(SearchMatch match) {

Start search:

new SearchEngine().search(
 new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant()}, 
 null /*progress monitor*/


Precise, fully resolved compiler parse tree.