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