fix #774 infinite loop in net.sourceforge.phpeclipse.builder.IdentifierIndexManager...
[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  * Context information for quick fix and quick assist processors.
18  * <p>
19  * Note: this interface is not intended to be implemented.
20  * </p>
21  * 
22  * @since 3.0
23  */
24 public interface IInvocationContext {
25
26         /**
27          * @return Returns the current compilation unit.
28          */
29         ICompilationUnit getCompilationUnit();
30
31         /**
32          * @return Returns the offset of the current selection
33          */
34         int getSelectionOffset();
35
36         /**
37          * @return Returns the length of the current selection
38          */
39         int getSelectionLength();
40
41         /**
42          * Returns an AST of the compilation unit, possibly only a partial AST
43          * focused on the selection offset (see
44          * {@link net.sourceforge.phpdt.core.dom.ASTParser#setFocalPosition(int)}).
45          * The returned AST is shared and therefore protected and cannot be
46          * modified. The client must check the AST API level and do nothing if they
47          * are given an AST they can't handle. (see
48          * {@link net.sourceforge.phpdt.core.dom.AST#apiLevel()}).
49          * 
50          * @return Returns the root of the AST corresponding to the current
51          *         compilation unit.
52          */
53         CompilationUnit getASTRoot();
54
55         /**
56          * Convenience method to evaluate the AST node covering the current
57          * selection.
58          * 
59          * @return Returns the node that covers the location of the problem
60          */
61         // ASTNode getCoveringNode();
62         /**
63          * Convenience method to evaluate the AST node that is covered by the
64          * current selection.
65          * 
66          * @return Returns the node that is covered by the location of the problem
67          */
68         // ASTNode getCoveredNode();
69 }