]> git.uio.no Git - ifi-stolz-refaktor.git/blob - case-study/jdt-after/ui/org/eclipse/jdt/ui/text/java/IQuickAssistProcessor.java
d037dcb0a4c2c76a7abb65e966c8485ac03b693a
[ifi-stolz-refaktor.git] / case-study / jdt-after / ui / org / eclipse / jdt / ui / text / java / IQuickAssistProcessor.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *
11  *******************************************************************************/
12 package org.eclipse.jdt.ui.text.java;
13
14 import org.eclipse.core.runtime.CoreException;
15
16
17 /**
18  * Interface to be implemented by contributors to the extension point
19  * <code>org.eclipse.jdt.ui.quickAssistProcessors</code>.
20  *
21  * @since 3.0
22  */
23 public interface IQuickAssistProcessor {
24
25         /**
26          * Evaluates if quick assists can be created for the given context. This evaluation must be precise.
27          *
28          * @param context The invocation context
29          * @return Returns <code>true</code> if quick assists can be created
30          * @throws CoreException CoreException can be thrown if the operation fails
31          */
32         boolean hasAssists(IInvocationContext context) throws CoreException;
33
34         /**
35          * Collects quick assists for the given context.
36          *
37          * @param context Defines current compilation unit, position and a shared AST
38          * @param locations The locations of problems at the invocation offset. The processor can decide to only
39          *                      add assists when there are no errors at the selection offset.
40          * @return Returns the assists applicable at the location or <code>null</code> if no proposals
41          *                      can be offered.
42          * @throws CoreException CoreException can be thrown if the operation fails
43          */
44         IJavaCompletionProposal[] getAssists(IInvocationContext context, IProblemLocation[] locations) throws CoreException;
45
46 }