Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "JDT Core Programmer Guide"
m (→Overview) |
(→Overview) |
||
Line 2: | Line 2: | ||
[http://help.eclipse.org/indigo/index.jsp?nav=/3 JDT Core] in Eclipse Help | [http://help.eclipse.org/indigo/index.jsp?nav=/3 JDT Core] in Eclipse Help | ||
− | [ | + | [https://github.com/aupsy/org.eclipsecon2012.misc.tutorial/blob/master/Slides/How%20To%20Train%20the%20JDT%20Dragon%20combined.ppt 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 [https://github.com/aupsy/org.eclipsecon2012.misc.tutorial/tree/master/Handouts Tutorial handouts] | ||
+ | |||
== Java Model == | == Java Model == | ||
Java model is a lightweight model for views. | Java model is a lightweight model for views. |
Revision as of 01:30, 19 June 2012
Overview
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:
- Get the file names from indexes
- Parse the file and find out matching nodes
- Resolve types and narrow down matches reported from index
- Create the appropriate model element
Using the APIs, an example
Create a search pattern:
SearchPattern pattern = SearchPattern.createPattern( "foo(*) int", IJavaSearchConstants.METHOD, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH );
Create a search scope:
IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
Collect results using SearchRequestor subclass:
SearchRequestor requestor = new SearchRequestor() { public void acceptSearchMatch(SearchMatch match) { System.out.println(match.getElement()); } };
Start search:
new SearchEngine().search( pattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant()}, scope, requestor, null /*progress monitor*/ );
AST
Precise, fully resolved compiler parse tree.