Class CUCorrectionProposal

All Implemented Interfaces:
ICUCorrectionProposal, ICommandAccess, IJavaCompletionProposal, ICompletionProposal, ICompletionProposalExtension5, ICompletionProposalExtension6
Direct Known Subclasses:
ASTRewriteCorrectionProposal

public class CUCorrectionProposal extends ChangeCorrectionProposal implements ICUCorrectionProposal
A proposal for quick fixes and quick assists that work on a single compilation unit. Either a text change is directly passed in the constructor or method addEdits(IDocument, TextEdit) is overridden to provide the text edits that are applied to the document when the proposal is evaluated.

The proposal takes care of the preview of the changes as proposal information.

Since:
3.8
  • Constructor Details

    • CUCorrectionProposal

      public CUCorrectionProposal(String name, ICompilationUnit cu, TextChange change, int relevance, Image image)
      Constructs a correction proposal working on a compilation unit with a given text change.
      Parameters:
      name - the name that is displayed in the proposal selection dialog
      cu - the compilation unit to which the change can be applied
      change - the change that is executed when the proposal is applied or null if implementors override addEdits(IDocument, TextEdit) to provide the text edits or createTextChange() to provide a text change
      relevance - the relevance of this proposal
      image - the image that is displayed for this proposal or null if no image is desired
    • CUCorrectionProposal

      public CUCorrectionProposal(String name, ICompilationUnit cu, TextChange change, int relevance)
      Constructs a correction proposal working on a compilation unit with a given text change. Uses the default image for this proposal.
      Parameters:
      name - the name that is displayed in the proposal selection dialog
      cu - the compilation unit to which the change can be applied
      change - the change that is executed when the proposal is applied or null if implementors override addEdits(IDocument, TextEdit) to provide the text edits or createTextChange() to provide a text change.
      relevance - the relevance of this proposal
    • CUCorrectionProposal

      protected CUCorrectionProposal(String name, ICompilationUnit cu, int relevance, Image image)
      Constructs a correction proposal working on a compilation unit.

      Users have to override addEdits(IDocument, TextEdit) to provide the text edits or createTextChange() to provide a text change.

      Parameters:
      name - the name that is displayed in the proposal selection dialog
      cu - the compilation unit on that the change works
      relevance - the relevance of this proposal
      image - the image that is displayed for this proposal or null if no image is desired
  • Method Details