Package org.eclipse.jdt.core.refactoring
Class CompilationUnitChange
- java.lang.Object
-
- org.eclipse.ltk.core.refactoring.Change
-
- org.eclipse.ltk.core.refactoring.TextEditBasedChange
-
- org.eclipse.ltk.core.refactoring.TextChange
-
- org.eclipse.ltk.core.refactoring.TextFileChange
-
- org.eclipse.jdt.core.refactoring.CompilationUnitChange
-
- All Implemented Interfaces:
IAdaptable
public class CompilationUnitChange extends TextFileChange
ATextFileChangethat operates on anICompilationUnitin the workspace.- Since:
- 1.3
-
-
Field Summary
-
Fields inherited from class org.eclipse.ltk.core.refactoring.TextFileChange
FORCE_SAVE, KEEP_SAVE_STATE, LEAVE_DIRTY
-
-
Constructor Summary
Constructors Constructor Description CompilationUnitChange(String name, ICompilationUnit cunit)Creates a newCompilationUnitChange.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IDocumentacquireDocument(IProgressMonitor pm)protected ChangecreateUndoChange(UndoEdit edit, ContentStamp stampToRestore)<T> TgetAdapter(Class<T> adapter)ICompilationUnitgetCompilationUnit()Returns the compilation unit this change works on.ChangeDescriptorgetDescriptor()ObjectgetModifiedElement()protected voidreleaseDocument(IDocument document, IProgressMonitor pm)voidsetDescriptor(ChangeDescriptor descriptor)Sets the refactoring descriptor for this change.-
Methods inherited from class org.eclipse.ltk.core.refactoring.TextFileChange
commit, createUndoChange, dispose, getAffectedObjects, getFile, getSaveMode, initializeValidationData, isDocumentAcquired, isDocumentModified, isValid, needsSaving, performEdits, setSaveMode
-
Methods inherited from class org.eclipse.ltk.core.refactoring.TextChange
addEdit, addTextEditChangeGroup, addTextEditGroup, getCurrentContent, getCurrentContent, getCurrentDocument, getEdit, getPreviewContent, getPreviewContent, getPreviewContent, getPreviewDocument, getPreviewEdit, getPreviewEdits, getTextEditChangeGroups, perform, setEdit, setKeepPreviewEdits
-
Methods inherited from class org.eclipse.ltk.core.refactoring.TextEditBasedChange
addChangeGroup, getChangeGroups, getKeepPreviewEdits, getName, getTextType, hasOneGroupCategory, setEnabled, setTextType
-
Methods inherited from class org.eclipse.ltk.core.refactoring.Change
getParent, isEnabled, setEnabledShallow
-
-
-
-
Constructor Detail
-
CompilationUnitChange
public CompilationUnitChange(String name, ICompilationUnit cunit)
Creates a newCompilationUnitChange.- Parameters:
name- the change's name, mainly used to render the change in the UIcunit- the compilation unit this change works on
-
-
Method Detail
-
getModifiedElement
public Object getModifiedElement()
- Overrides:
getModifiedElementin classTextFileChange
-
getCompilationUnit
public ICompilationUnit getCompilationUnit()
Returns the compilation unit this change works on.- Returns:
- the compilation unit this change works on
-
acquireDocument
protected IDocument acquireDocument(IProgressMonitor pm) throws CoreException
- Overrides:
acquireDocumentin classTextFileChange- Throws:
CoreException
-
releaseDocument
protected void releaseDocument(IDocument document, IProgressMonitor pm) throws CoreException
- Overrides:
releaseDocumentin classTextFileChange- Throws:
CoreException
-
createUndoChange
protected Change createUndoChange(UndoEdit edit, ContentStamp stampToRestore)
- Overrides:
createUndoChangein classTextFileChange
-
getAdapter
public <T> T getAdapter(Class<T> adapter)
- Specified by:
getAdapterin interfaceIAdaptable- Overrides:
getAdapterin classChange
-
setDescriptor
public void setDescriptor(ChangeDescriptor descriptor)
Sets the refactoring descriptor for this change.- Parameters:
descriptor- the descriptor to set, ornullto set no descriptor
-
getDescriptor
public ChangeDescriptor getDescriptor()
- Overrides:
getDescriptorin classChange
-
-