org.eclipse.cdt.internal.ui.viewsupport
Class FindNameForSelectionVisitor

java.lang.Object
  extended by org.eclipse.cdt.core.dom.ast.ASTVisitor
      extended by org.eclipse.cdt.internal.ui.viewsupport.FindNameForSelectionVisitor

public class FindNameForSelectionVisitor
extends org.eclipse.cdt.core.dom.ast.ASTVisitor

Searches for a name related to the given selection. The first choice will be the largest name inside the selection. If it does not exist the smallest name surounding the selection is taken.

Since:
4.0
See Also:
IASTNode.accept(ASTVisitor)

Field Summary
 
Fields inherited from class org.eclipse.cdt.core.dom.ast.ASTVisitor
PROCESS_ABORT, PROCESS_CONTINUE, PROCESS_SKIP, shouldVisitComments, shouldVisitDeclarations, shouldVisitDeclarators, shouldVisitDeclSpecifiers, shouldVisitEnumerators, shouldVisitExpressions, shouldVisitInitializers, shouldVisitNames, shouldVisitParameterDeclarations, shouldVisitProblems, shouldVisitStatements, shouldVisitTranslationUnit, shouldVisitTypeIds
 
Constructor Summary
FindNameForSelectionVisitor(java.lang.String filePath, int selectionStart, int selectionLength)
           
 
Method Summary
 org.eclipse.cdt.core.dom.ast.IASTName getSelectedName()
          After the visitor was accepted by an ast-node you can query the selected name.
 int visit(org.eclipse.cdt.core.dom.ast.IASTDeclaration declaration)
           
 int visit(org.eclipse.cdt.core.dom.ast.IASTName name)
           
 
Methods inherited from class org.eclipse.cdt.core.dom.ast.ASTVisitor
leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindNameForSelectionVisitor

public FindNameForSelectionVisitor(java.lang.String filePath,
                                   int selectionStart,
                                   int selectionLength)
Method Detail

getSelectedName

public org.eclipse.cdt.core.dom.ast.IASTName getSelectedName()
After the visitor was accepted by an ast-node you can query the selected name.

Returns:
the name found for the selection, or null.
Since:
4.0

visit

public int visit(org.eclipse.cdt.core.dom.ast.IASTDeclaration declaration)
Overrides:
visit in class org.eclipse.cdt.core.dom.ast.ASTVisitor

visit

public int visit(org.eclipse.cdt.core.dom.ast.IASTName name)
Overrides:
visit in class org.eclipse.cdt.core.dom.ast.ASTVisitor