| org.netbeans.modules.gsf.api.DeclarationFinder
DeclarationFinder | public interface DeclarationFinder (Code) | | author: Tor Norbye |
Inner Class :final public class DeclarationLocation | |
Inner Class :public interface AlternativeLocation extends Comparable<AlternativeLocation> | |
Method Summary | |
DeclarationLocation | findDeclaration(CompilationInfo info, int caretOffset) Find the declaration for the program element that is under the caretOffset
Return a Set of regions that should be renamed if the element under the caret offset is
renamed. | public OffsetRange | getReferenceSpan(Document doc, int caretOffset) Check the caret offset in the document and determine if it is over a span
of text that should be hyperlinkable ("Go To Declaration" - in other words,
locate the reference and return it. |
findDeclaration | DeclarationLocation findDeclaration(CompilationInfo info, int caretOffset)(Code) | | Find the declaration for the program element that is under the caretOffset
Return a Set of regions that should be renamed if the element under the caret offset is
renamed.
Return
Declaration.NONE if the declaration can not be found, otherwise return
a valid DeclarationLocation.
|
getReferenceSpan | public OffsetRange getReferenceSpan(Document doc, int caretOffset)(Code) | | Check the caret offset in the document and determine if it is over a span
of text that should be hyperlinkable ("Go To Declaration" - in other words,
locate the reference and return it. When the user drags the mouse with a modifier
key held this will be hyperlinked, and so on.
Remember that when looking up tokens in the token hierarchy, you will get the token
to the right of the caret offset, so check for these conditions
(sequence.move(offset); sequence.offset() == offset) and check both
sides such that placing the caret between two tokens will match either side.
OffsetRange.NONE if the caret is not over a valid reference span,otherwise return the character range for the given hyperlink tokens |
|
|