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;
17 * Context information for quick fix and quick assist processors.
19 * Note: this interface is not intended to be implemented.
24 public interface IInvocationContext {
27 * @return Returns the current compilation unit.
29 ICompilationUnit getCompilationUnit();
32 * @return Returns the offset of the current selection
34 int getSelectionOffset();
37 * @return Returns the length of the current selection
39 int getSelectionLength();
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()}).
50 * @return Returns the root of the AST corresponding to the current
53 CompilationUnit getASTRoot();
56 * Convenience method to evaluate the AST node covering the current
59 * @return Returns the node that covers the location of the problem
61 // ASTNode getCoveringNode();
63 * Convenience method to evaluate the AST node that is covered by the
66 * @return Returns the node that is covered by the location of the problem
68 // ASTNode getCoveredNode();