Class CustomCompositeChange

  • All Implemented Interfaces:
    IProjectAwareChange, org.eclipse.core.runtime.IAdaptable
    Direct Known Subclasses:
    FullTextSearchCustomCompositeChange

    public class CustomCompositeChange
    extends org.eclipse.ltk.core.refactoring.CompositeChange
    implements IProjectAwareChange
    Special CompositeChange for refactoring. Contains all changes for one file as TextEditBasedChange
    • Constructor Summary

      Constructors 
      Constructor Description
      CustomCompositeChange​(String name, org.eclipse.handly.model.ISourceFile sourceFile, org.eclipse.text.edits.TextEdit edit, boolean changeForbidden)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.ltk.core.refactoring.Change getAllChange()
      Gets Change contains all all changes in file as one block
      String getProjectName()
      Gets name of the affected project
      String getSortedName()
      Special name for sorting.
      boolean isEnabled()  
      boolean isForbidden()
      Gets status of perform opertation
      org.eclipse.ltk.core.refactoring.Change perform​(org.eclipse.core.runtime.IProgressMonitor pm)  
      void setEnabled​(boolean enabled)  
      • Methods inherited from class org.eclipse.ltk.core.refactoring.CompositeChange

        add, addAll, clear, createUndoChange, dispose, getAffectedObjects, getChildren, getDescriptor, getModifiedElement, getName, getUndoUntilException, initializeValidationData, internalContinueOnCancel, internalHandleException, internalProcessOnCancel, isSynthetic, isValid, markAsSynthetic, merge, remove, toString
      • Methods inherited from class org.eclipse.ltk.core.refactoring.Change

        getAdapter, getParent, setEnabledShallow
    • Constructor Detail

      • CustomCompositeChange

        public CustomCompositeChange​(String name,
                                     org.eclipse.handly.model.ISourceFile sourceFile,
                                     org.eclipse.text.edits.TextEdit edit,
                                     boolean changeForbidden)
        Constructor
        Parameters:
        name - name of the refactoring unit, can't be null
        sourceFile - ISourceFile, can't be null
        edit - text edit contains all changes in file, can't be null
        changeForbidden - true if changes is forbidden for perform, false otherwise
    • Method Detail

      • getSortedName

        public String getSortedName()
        Special name for sorting. This name is full path of ISourceFileExtension.getFile() if sourceFile instance of ISourceFileExtension, otherwise it is name of the Change
        Returns:
        name for sorting, never null
      • getAllChange

        public org.eclipse.ltk.core.refactoring.Change getAllChange()
        Gets Change contains all all changes in file as one block
        Returns:
        Change, never null
      • perform

        public org.eclipse.ltk.core.refactoring.Change perform​(org.eclipse.core.runtime.IProgressMonitor pm)
                                                        throws org.eclipse.core.runtime.CoreException
        Overrides:
        perform in class org.eclipse.ltk.core.refactoring.CompositeChange
        Throws:
        org.eclipse.core.runtime.CoreException
      • isForbidden

        public boolean isForbidden()
        Gets status of perform opertation
        Returns:
        true if changes is forbidden for perform, false otherwise
      • isEnabled

        public boolean isEnabled()
        Overrides:
        isEnabled in class org.eclipse.ltk.core.refactoring.Change
      • setEnabled

        public void setEnabled​(boolean enabled)
        Overrides:
        setEnabled in class org.eclipse.ltk.core.refactoring.CompositeChange