org.eclipse.xtext.ui.editor.quickfix
Class XtextQuickAssistProcessor

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.quickfix.AbstractIssueResolutionProviderAdapter
      extended by org.eclipse.xtext.ui.editor.quickfix.XtextQuickAssistProcessor
All Implemented Interfaces:
org.eclipse.jface.text.quickassist.IQuickAssistProcessor

public class XtextQuickAssistProcessor
extends AbstractIssueResolutionProviderAdapter
implements org.eclipse.jface.text.quickassist.IQuickAssistProcessor


Field Summary
 
Fields inherited from class org.eclipse.xtext.ui.editor.quickfix.AbstractIssueResolutionProviderAdapter
DEFAULT_IMAGE
 
Constructor Summary
XtextQuickAssistProcessor()
           
 
Method Summary
 boolean canAssist(org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext invocationContext)
          Tells whether this assistant has assists for the given invocation context.
 boolean canFix(org.eclipse.jface.text.source.Annotation annotation)
          Tells whether this processor has a fix for the given annotation.
 org.eclipse.jface.text.contentassist.ICompletionProposal[] computeQuickAssistProposals(org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext invocationContext)
          Returns a list of quick assist and quick fix proposals for the given invocation context.
protected  org.eclipse.jface.text.contentassist.ICompletionProposal create(org.eclipse.jface.text.Position posisition, IssueResolution resolution)
           
protected  java.util.Set<org.eclipse.jface.text.source.Annotation> getApplicableAnnotations(IXtextDocument document, org.eclipse.jface.text.source.IAnnotationModel annotationModel, int offset)
           
 java.lang.String getErrorMessage()
          Returns the reason why this quick assist processor was unable to produce any completion proposals.
 IssueUtil getIssueUtil()
           
protected  void sortQuickfixes(java.util.List<org.eclipse.jface.text.contentassist.ICompletionProposal> quickFixes)
           
 
Methods inherited from class org.eclipse.xtext.ui.editor.quickfix.AbstractIssueResolutionProviderAdapter
getImage, getResolutionProvider, getResolutions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XtextQuickAssistProcessor

public XtextQuickAssistProcessor()
Method Detail

getErrorMessage

public java.lang.String getErrorMessage()
Description copied from interface: org.eclipse.jface.text.quickassist.IQuickAssistProcessor
Returns the reason why this quick assist processor was unable to produce any completion proposals.

Specified by:
getErrorMessage in interface org.eclipse.jface.text.quickassist.IQuickAssistProcessor
Returns:
an error message or null if no error occurred

canFix

public boolean canFix(org.eclipse.jface.text.source.Annotation annotation)
Description copied from interface: org.eclipse.jface.text.quickassist.IQuickAssistProcessor
Tells whether this processor has a fix for the given annotation.

Note: This test must be fast and optimistic i.e. it is OK to return true even though there might be no quick fix.

Specified by:
canFix in interface org.eclipse.jface.text.quickassist.IQuickAssistProcessor
Parameters:
annotation - the annotation
Returns:
true if the assistant has a fix for the given annotation

canAssist

public boolean canAssist(org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext invocationContext)
Description copied from interface: org.eclipse.jface.text.quickassist.IQuickAssistProcessor
Tells whether this assistant has assists for the given invocation context.

Specified by:
canAssist in interface org.eclipse.jface.text.quickassist.IQuickAssistProcessor
Parameters:
invocationContext - the invocation context
Returns:
true if the assistant has a fix for the given annotation

computeQuickAssistProposals

public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeQuickAssistProposals(org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext invocationContext)
Description copied from interface: org.eclipse.jface.text.quickassist.IQuickAssistProcessor
Returns a list of quick assist and quick fix proposals for the given invocation context.

Specified by:
computeQuickAssistProposals in interface org.eclipse.jface.text.quickassist.IQuickAssistProcessor
Parameters:
invocationContext - the invocation context
Returns:
an array of completion proposals or null if no proposals are available

create

protected org.eclipse.jface.text.contentassist.ICompletionProposal create(org.eclipse.jface.text.Position posisition,
                                                                          IssueResolution resolution)

sortQuickfixes

protected void sortQuickfixes(java.util.List<org.eclipse.jface.text.contentassist.ICompletionProposal> quickFixes)

getApplicableAnnotations

protected java.util.Set<org.eclipse.jface.text.source.Annotation> getApplicableAnnotations(IXtextDocument document,
                                                                                           org.eclipse.jface.text.source.IAnnotationModel annotationModel,
                                                                                           int offset)
                                                                                    throws org.eclipse.jface.text.BadLocationException
Throws:
org.eclipse.jface.text.BadLocationException

getIssueUtil

public IssueUtil getIssueUtil()