1  /*******************************************************************************
 
   2  * Copyright (c) 2000, 2004 IBM Corporation and others.
 
   3  * All rights reserved. This program and the accompanying materials 
 
   4  * are made available under the terms of the Common Public License v1.0
 
   5  * which accompanies this distribution, and is available at
 
   6  * http://www.eclipse.org/legal/cpl-v10.html
 
   9  *     IBM Corporation - initial API and implementation
 
  10  *******************************************************************************/
 
  11 package net.sourceforge.phpdt.internal.ui.text.java;
 
  13 import net.sourceforge.phpdt.core.ICompilationUnit;
 
  14 import net.sourceforge.phpdt.core.dom.CompilationUnit;
 
  18  * Context information for quick fix and quick assist processors.
 
  20  * Note: this interface is not intended to be implemented.
 
  25 public interface IInvocationContext {
 
  28          * @return Returns the current compilation unit.
 
  30         ICompilationUnit getCompilationUnit();
 
  33          * @return Returns the offset of the current selection
 
  35         int getSelectionOffset();
 
  38          * @return Returns the length of the current selection
 
  40         int getSelectionLength();
 
  43          * Returns an AST of the compilation unit, possibly only a partial AST focused on the selection
 
  44          * offset (see {@link net.sourceforge.phpdt.core.dom.ASTParser#setFocalPosition(int)}).
 
  45          * The returned AST is shared and therefore protected and cannot be modified.
 
  46          * The client must check the AST API level and do nothing if they are given an AST
 
  47          * they can't handle. (see {@link net.sourceforge.phpdt.core.dom.AST#apiLevel()}).
 
  48          * @return Returns the root of the AST corresponding to the current compilation unit.
 
  50         CompilationUnit getASTRoot();
 
  53          * Convenience method to evaluate the AST node covering the current selection.
 
  54          * @return Returns the node that covers the location of the problem
 
  56 //      ASTNode getCoveringNode();
 
  59          * Convenience method to evaluate the AST node that is covered by the current selection.
 
  60          * @return Returns the node that is covered by the location of the problem
 
  62 //      ASTNode getCoveredNode();