Bug 25684 - SelectionEngine to be made API?
Summary: SelectionEngine to be made API?
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 2.1 M4   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-04 06:57 EST by Claude Knaus CLA
Modified: 2002-11-18 06:09 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claude Knaus CLA 2002-11-04 06:57:12 EST
To implement the browser-line navigation feature (press Ctrl and hover over a 
declaration - in HEAD), I need the SelectionEngine.checkSelection() 
functionality. My workaround so far was to use the code from double click 
strategy to highlight the text corresponding to the declaration. I was 
wondering if there were plans to make this class and method API.
Comment 1 Philipe Mulet CLA 2002-11-04 09:06:11 EST
Not currently. 
Comment 2 Philipe Mulet CLA 2002-11-05 06:58:25 EST
Could be promoted to CharOperation...

David, what do you think ?
Comment 3 David Audel CLA 2002-11-07 06:40:39 EST
checkSelection() can not be easily promoted to CharOperation because this 
method change the value of several fields of SelectionEngine.
- int actualSelectionStart
- int actualSelectionEnd
- char[] selectedIdentifier
- char[] qualifiedSelection
Comment 4 David Audel CLA 2002-11-07 06:44:10 EST
Claude, you can easily create your own method.
Use 'org.eclipse.jdt.core.ToolFactory#createScanner()' and copy the algorithm 
of 'SelectionEngine#checkSelection()' (replace 'Scanner' by 'IScanner' 
and 'scanner.startPosition' by 'scanner.getCurrentTokenStartPosition()' 
and 'scanner.currentPosition' by 'scanner.getCurrentTokenEndPosition() + 1').
Comment 5 Claude Knaus CLA 2002-11-07 10:21:44 EST
Well, I rather stick to the double click strategy for now. I don't feel like 
duplicating that much code.
Comment 6 David Audel CLA 2002-11-18 06:09:28 EST
checkSelection can not be promoted to API.

Closing.