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
A
TextFileChange
that operates on an ICompilationUnit
in 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
ConstructorsConstructorDescriptionCompilationUnitChange
(String name, ICompilationUnit cunit) Creates a newCompilationUnitChange
. -
Method Summary
Modifier and TypeMethodDescriptionprotected IDocument
protected Change
createUndoChange
(UndoEdit edit, ContentStamp stampToRestore) <T> T
getAdapter
(Class<T> adapter) Returns the compilation unit this change works on.protected void
releaseDocument
(IDocument document, IProgressMonitor pm) void
setDescriptor
(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 Details
-
CompilationUnitChange
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 Details
-
getModifiedElement
- Overrides:
getModifiedElement
in classTextFileChange
-
getCompilationUnit
Returns the compilation unit this change works on.- Returns:
- the compilation unit this change works on
-
acquireDocument
- Overrides:
acquireDocument
in classTextFileChange
- Throws:
CoreException
-
releaseDocument
- Overrides:
releaseDocument
in classTextFileChange
- Throws:
CoreException
-
createUndoChange
- Overrides:
createUndoChange
in classTextFileChange
-
getAdapter
- Specified by:
getAdapter
in interfaceIAdaptable
- Overrides:
getAdapter
in classChange
-
setDescriptor
Sets the refactoring descriptor for this change.- Parameters:
descriptor
- the descriptor to set, ornull
to set no descriptor
-
getDescriptor
- Overrides:
getDescriptor
in classChange
-