org.eclipse.tptp.platform.analysis.codereview.cpp.quickfix
Class CppCodeReviewQuickFix
java.lang.Object
org.eclipse.tptp.platform.analysis.core.quickfix.AbstractAnalysisQuickFix
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
|
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
CppCodeReviewQuickFix
public CppCodeReviewQuickFix()
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()