Class ResourceChange

    • Field Detail

      • VALIDATE_DEFAULT

        public static final int VALIDATE_DEFAULT
        The default validation method. It tests the modified element for existence and makes sure it has not been modified since the change has been created.
        See Also:
        Constant Field Values
      • VALIDATE_NOT_READ_ONLY

        public static final int VALIDATE_NOT_READ_ONLY
        The 'not read only' validation method performs the default validations (see VALIDATE_DEFAULT) and additionally ensures that the element is not read only.
        See Also:
        Constant Field Values
      • VALIDATE_NOT_DIRTY

        public static final int VALIDATE_NOT_DIRTY
        The 'not dirty' validation method performs the default validations (see VALIDATE_DEFAULT) and additionally ensures that the element does not contain unsaved modifications.
        See Also:
        Constant Field Values
      • SAVE_IF_DIRTY

        public static final int SAVE_IF_DIRTY
        The 'save if dirty' validation method performs the default validations (see VALIDATE_DEFAULT) and will save all unsaved modifications to the resource.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ResourceChange

        public ResourceChange()
        Creates the resource change. The modification state will be
    • Method Detail

      • getModifiedResource

        protected abstract IResource getModifiedResource()
        Returns the resource of this change.
        Returns:
        the resource of this change
      • initializeValidationData

        public void initializeValidationData​(IProgressMonitor pm)
        Description copied from class: Change
        Hook method to initialize some internal state to provide an adequate answer for the isValid method. This method gets called after a change or a whole change tree has been created.

        Typically this method is implemented in one of the following ways:

        • the change hooks up a listener on some delta notification mechanism and marks itself as invalid if it receives a certain delta. Is this the case the implementor must take care of unhooking the listener in dispose.
        • the change remembers some information allowing to decide if a change object is still valid when isValid is called.

        For example, a change object that manipulates the content of an IFile could either listen to resource changes and detect that the file got changed or it could remember some content stamp and compare it with the actual content stamp when isValid is called.

        Specified by:
        initializeValidationData in class Change
        Parameters:
        pm - a progress monitor
      • getModifiedElement

        public Object getModifiedElement()
        Description copied from class: Change
        Returns the element modified by this Change. The method may return null if the change isn't related to an element.
        Specified by:
        getModifiedElement in class Change
        Returns:
        the element modified by this change