TPTP 4.5.0 Platform Project
Public API Specification

org.eclipse.tptp.platform.analysis.codereview.cpp.quickfix
Class CppCodeReviewQuickFix

java.lang.Object
  extended by org.eclipse.tptp.platform.analysis.core.quickfix.AbstractAnalysisQuickFix
      extended by org.eclipse.tptp.platform.analysis.codereview.cpp.quickfix.CppCodeReviewQuickFix
All Implemented Interfaces:
org.eclipse.core.runtime.IExecutableExtension, IAnalysisQuickFix
Direct Known Subclasses:
RuleDeclarationMultipleDeclarationsQuickFix

public abstract class CppCodeReviewQuickFix
extends AbstractAnalysisQuickFix

Base class for all quickfixes that can be applied to a CodeReviewResult. It is based on the similar implementation for JDT.

See Also:
Also, it is waiting for CDT refactoring support, for more info, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=75364 This class takes care of updating the results once a quickfix has been applied so that the line numbers are updated and other results that are also fixed by this quickfix do not show up anymore. It defines a method fixCodeReviewResult( IASTNode theNode, IAnalysisResult result ) that must be implemented by every class that wants to perform a quickfix

Field Summary
static org.eclipse.core.runtime.IProgressMonitor EMPTY_MONITOR
           
static java.lang.String TEXT_CHANGE
           
static java.lang.String TEXT_CHANGE_UNDO
           
 
Constructor Summary
CppCodeReviewQuickFix()
           
 
Method Summary
abstract  org.eclipse.text.edits.TextEdit fixCodeReviewResult(org.eclipse.cdt.core.dom.ast.IASTNode theNode, org.eclipse.jface.text.IDocument docToChange)
          Perform the actual quickfix
 org.eclipse.text.edits.TextEdit getTextEdit()
           
 org.eclipse.core.resources.IFile getWorkingCompilationUnit()
           
 org.eclipse.core.runtime.IStatus quickfix(AbstractAnalysisResult result)
          Makes sure that all the results are updated after a Java CodeReview quickfix has been applied
 
Methods inherited from class org.eclipse.tptp.platform.analysis.core.quickfix.AbstractAnalysisQuickFix
getId, getLabel, setId, setInitializationData, setLabel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT_CHANGE

public static final java.lang.String TEXT_CHANGE
See Also:
Constant Field Values

TEXT_CHANGE_UNDO

public static final java.lang.String TEXT_CHANGE_UNDO
See Also:
Constant Field Values

EMPTY_MONITOR

public static final org.eclipse.core.runtime.IProgressMonitor EMPTY_MONITOR
Constructor Detail

CppCodeReviewQuickFix

public CppCodeReviewQuickFix()
Method Detail

fixCodeReviewResult

public abstract org.eclipse.text.edits.TextEdit fixCodeReviewResult(org.eclipse.cdt.core.dom.ast.IASTNode theNode,
                                                                    org.eclipse.jface.text.IDocument docToChange)
Perform the actual quickfix

Parameters:
result - The result that describes the problem in the source code
Returns:
true if the quickfix operated successfully; return false otherwise

quickfix

public org.eclipse.core.runtime.IStatus quickfix(AbstractAnalysisResult result)
Makes sure that all the results are updated after a Java CodeReview quickfix has been applied

Specified by:
quickfix in interface IAnalysisQuickFix
Specified by:
quickfix in class AbstractAnalysisQuickFix
Parameters:
result - The result to be quickfiexed
Returns:
a status

getWorkingCompilationUnit

public org.eclipse.core.resources.IFile getWorkingCompilationUnit()

getTextEdit

public org.eclipse.text.edits.TextEdit getTextEdit()

TPTP 4.5.0 Platform Project
Public API Specification