| Summary: | API promotion for JavaEditor (internal -> public) | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Gabriel BARBIER <barbier.gabriel> |
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | daniel_megert, remy.suen |
| Version: | 3.6 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Could you not instead analyze the IJavaElement and then ask the editor's selection provider to select the range of text in question? (In reply to comment #1) > Could you not instead analyze the IJavaElement and then ask the editor's > selection provider to select the range of text in question? Hello, We are using a model of the java application (not the text) and we have not the information of location (line, range ...). So if you have a tip to retrieve the range (and the length) from a jdt element, I guess I could use following method: /** * Selects and reveals the specified range in this text editor. * * @param offset the offset of the selection * @param length the length of the selection */ void selectAndReveal(int offset, int length); (In reply to comment #2) > We are using a model of the java application (not the text) and we have not the > information of location (line, range ...). An IJavaElement may be an ISourceReference. You can query for location information from there. Looking at JavaEditor's setSelection(IJavaElement) implementation may provide you with some hints. Whoops, that conflict didn't work out well. See methods in org.eclipse.jdt.ui.JavaUI. Thanks for your help. JavaUI fit perfectly. Gabriel |
Hello, In MoDisco project, we are using some methods from org.eclipse.jdt.internal.ui.javaeditor.JavaEditor to select a specific element of AST in an opened editor. This class is considered as internal, so I would like to ask for its promotion as public. It is mainly to avoid use of @SuppressWarnings("restriction") as required to join the Helios train. Example of usage: ((JavaEditor) result).setSelection(method); Used by components: - org.eclipse.gmt.modisco.java.discoverer - org.eclipse.gmt.modisco.usecase.modelfilter.methodcalls Best regards Gabriel