org.eclipse.wst.jsdt.ui.text.java
Interface IQuickFixProcessor


public interface IQuickFixProcessor

Interface to be implemented by contributors to the extension point org.eclipse.wst.jsdt.ui.quickFixProcessors.

Since 3.2, each extension specifies the marker types it can handle, and hasCorrections(IJavaScriptUnit, int) and getCorrections(IInvocationContext, IProblemLocation[]) are called if (and only if) quick fix is required for a problem of these types.

Note, if a extension does not specify marker types it will be only called for problem of type org.eclipse.wst.jsdt.core.problem, org.eclipse.wst.jsdt.core.buildpath_problem and org.eclipse.wst.jsdt.core.task; compatible with the behavior prior to 3.2

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Method Summary
 IJavaCompletionProposal[] getCorrections(IInvocationContext context, IProblemLocation[] locations)
          Collects corrections or code manipulations for the given context.
 boolean hasCorrections(IJavaScriptUnit unit, int problemId)
          Returns true if the processor has proposals for the given problem.
 

Method Detail

hasCorrections

boolean hasCorrections(IJavaScriptUnit unit,
                       int problemId)
Returns true if the processor has proposals for the given problem. This test should be an optimistic guess and be very cheap.

Parameters:
unit - the compilation unit
problemId - the problem Id. The id is of a problem of the problem type(s) this processor specified in the extension point.
Returns:
true if the processor has proposals for the given problem

getCorrections

IJavaCompletionProposal[] getCorrections(IInvocationContext context,
                                         IProblemLocation[] locations)
                                         throws CoreException
Collects corrections or code manipulations for the given context.

Parameters:
context - Defines current compilation unit, position and a shared AST
locations - Problems are the current location.
Returns:
the corrections applicable at the location or null if no proposals can be offered
Throws:
CoreException - CoreException can be thrown if the operation fails