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
9 * IBM Corporation - initial API and implementation
11 *******************************************************************************/
12 package org.eclipse.jdt.ui.text.java;
14 import org.eclipse.core.runtime.CoreException;
18 * Interface to be implemented by contributors to the extension point
19 * <code>org.eclipse.jdt.ui.quickAssistProcessors</code>.
23 public interface IQuickAssistProcessor {
26 * Evaluates if quick assists can be created for the given context. This evaluation must be precise.
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
32 boolean hasAssists(IInvocationContext context) throws CoreException;
35 * Collects quick assists for the given context.
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
42 * @throws CoreException CoreException can be thrown if the operation fails
44 IJavaCompletionProposal[] getAssists(IInvocationContext context, IProblemLocation[] locations) throws CoreException;