public class CompilationUnitChange extends TextFileChange
TextFileChange
that operates on an ICompilationUnit
in the workspace.FORCE_SAVE, KEEP_SAVE_STATE, LEAVE_DIRTY
Constructor and Description |
---|
CompilationUnitChange(String name,
ICompilationUnit cunit)
Creates a new
CompilationUnitChange . |
Modifier and Type | Method and Description |
---|---|
protected IDocument |
acquireDocument(IProgressMonitor pm) |
protected Change |
createUndoChange(UndoEdit edit,
ContentStamp stampToRestore) |
Object |
getAdapter(Class adapter) |
ICompilationUnit |
getCompilationUnit()
Returns the compilation unit this change works on.
|
ChangeDescriptor |
getDescriptor() |
Object |
getModifiedElement() |
protected void |
releaseDocument(IDocument document,
IProgressMonitor pm) |
void |
setDescriptor(ChangeDescriptor descriptor)
Sets the refactoring descriptor for this change.
|
commit, createUndoChange, dispose, getAffectedObjects, getFile, getSaveMode, initializeValidationData, isDocumentAcquired, isDocumentModified, isValid, needsSaving, performEdits, setSaveMode
addEdit, addTextEditChangeGroup, addTextEditGroup, getCurrentContent, getCurrentContent, getCurrentDocument, getEdit, getPreviewContent, getPreviewContent, getPreviewContent, getPreviewDocument, getPreviewEdit, getPreviewEdits, getTextEditChangeGroups, perform, setEdit, setKeepPreviewEdits
addChangeGroup, getChangeGroups, getKeepPreviewEdits, getName, getTextType, hasOneGroupCategory, setEnabled, setTextType
getParent, isEnabled, setEnabledShallow
public CompilationUnitChange(String name, ICompilationUnit cunit)
CompilationUnitChange
.name
- the change's name, mainly used to render the change in the UIcunit
- the compilation unit this change works onpublic Object getModifiedElement()
getModifiedElement
in class TextFileChange
public ICompilationUnit getCompilationUnit()
protected IDocument acquireDocument(IProgressMonitor pm) throws CoreException
acquireDocument
in class TextFileChange
CoreException
protected void releaseDocument(IDocument document, IProgressMonitor pm) throws CoreException
releaseDocument
in class TextFileChange
CoreException
protected Change createUndoChange(UndoEdit edit, ContentStamp stampToRestore)
createUndoChange
in class TextFileChange
public Object getAdapter(Class adapter)
getAdapter
in interface IAdaptable
getAdapter
in class Change
public void setDescriptor(ChangeDescriptor descriptor)
descriptor
- the descriptor to set, or null
to set no descriptorpublic ChangeDescriptor getDescriptor()
getDescriptor
in class Change
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.