RC2 compatibility
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / java / IInvocationContext.java
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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.ui.text.java;
12
13 import net.sourceforge.phpdt.core.ICompilationUnit;
14 import net.sourceforge.phpdt.core.dom.CompilationUnit;
15
16
17 /**
18  * Context information for quick fix and quick assist processors.
19  * <p>
20  * Note: this interface is not intended to be implemented.
21  * </p>
22  *
23  * @since 3.0
24  */
25 public interface IInvocationContext {
26
27         /**
28          * @return Returns the current compilation unit.
29          */
30         ICompilationUnit getCompilationUnit();
31
32         /**
33          * @return Returns the offset of the current selection
34          */
35         int getSelectionOffset();
36         
37         /**
38          * @return Returns the length of the current selection
39          */
40         int getSelectionLength();
41                         
42         /**
43          * Returns an AST of the compilation unit, possibly only a partial AST focused on the selection
44          * offset (see {@link org.eclipse.jdt.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 org.eclipse.jdt.core.dom.AST#apiLevel()}).
48          * @return Returns the root of the AST corresponding to the current compilation unit.
49          */
50         CompilationUnit getASTRoot();
51         
52         /**
53          * Convenience method to evaluate the AST node covering the current selection.
54          * @return Returns the node that covers the location of the problem
55          */
56 //      ASTNode getCoveringNode();
57
58         /**
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
61          */     
62 //      ASTNode getCoveredNode();
63
64 }