Package org.eclipse.php.internal.core.corext.dom

Examples of org.eclipse.php.internal.core.corext.dom.SelectionAnalyzer


      Program root = getAST(typeRoot);
      if (root == null)
        return oldSourceRange;
      Selection selection = Selection.createFromStartLength(
          oldSourceRange.getOffset(), oldSourceRange.getLength());
      SelectionAnalyzer selAnalyzer = new SelectionAnalyzer(selection,
          true);
      root.accept(selAnalyzer);
      return internalGetNewSelectionRange(oldSourceRange, typeRoot,
          selAnalyzer);
    } catch (ModelException e) {
View Full Code Here


   *         within the AST subtree identified by <code>scope</code>.
   * @throws JavaModelException
   */
  public static IASTFragment createFragmentForSourceRange(SourceRange range,
      ASTNode scope, IDocument document) throws Exception {
    SelectionAnalyzer sa = new SelectionAnalyzer(
        Selection.createFromStartLength(range.getOffset(),
            range.getLength()), false);
    scope.accept(sa);
    if (isSingleNodeSelected(sa, range, document, scope))
      return ASTFragmentFactory.createFragmentForFullSubtree(
          sa.getFirstSelectedNode(), null);
    if (isEmptySelectionCoveredByANode(range, sa))
      return ASTFragmentFactory.createFragmentForFullSubtree(
          sa.getLastCoveringNode(), null);
    return ASTFragmentFactory.createFragmentForSubPartBySourceRange(
        sa.getLastCoveringNode(), range, scope, document);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.corext.dom.SelectionAnalyzer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.