Class DirtyResource

  • All Implemented Interfaces:
    com.google.inject.Provider<org.eclipse.xtext.resource.IResourceDescription>, javax.inject.Provider<org.eclipse.xtext.resource.IResourceDescription>, org.eclipse.xtext.ui.editor.IDirtyResource

    public class DirtyResource
    extends Object
    implements org.eclipse.xtext.ui.editor.IDirtyResource, com.google.inject.Provider<org.eclipse.xtext.resource.IResourceDescription>
    Dirty resource implementation.

    This implementation holds dirty state by default resource serialization mechanism.

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.eclipse.xtext.ui.editor.IDirtyResource

        org.eclipse.xtext.ui.editor.IDirtyResource.ICurrentStateProvidingExtension, org.eclipse.xtext.ui.editor.IDirtyResource.InitializationAware, org.eclipse.xtext.ui.editor.IDirtyResource.NormalizedURISupportExtension
    • Constructor Summary

      Constructors 
      Constructor Description
      DirtyResource()  
    • Constructor Detail

      • DirtyResource

        public DirtyResource()
    • Method Detail

      • connect

        public void connect​(org.eclipse.emf.ecore.resource.Resource resource)
        Connects given resource. This implementation stores current resource stated (content and resource description).
        Parameters:
        resource - resource (not null).
        Throws:
        IllegalArgumentException - if given resource is null.
      • disconnect

        public void disconnect​(org.eclipse.emf.ecore.resource.Resource resource)
        Clears dirty resource state.
        Parameters:
        resource - resource (not null).
        Throws:
        IllegalArgumentException - if given resource is null.
        IllegalStateException - if given resource not identically equals with resource given in connect(Resource).
      • copyState

        public void copyState​(org.eclipse.xtext.resource.IResourceDescription original)
        Copies resource state.
        Parameters:
        original - IResourceDescription instance (not null).
      • get

        public org.eclipse.xtext.resource.IResourceDescription get()
        Callback method for the copied resource description. Is triggered as soon as somebody is interested in the reference descriptions which shall be up to date all the time. This allows for lazy resolution of proxies instead of eager copying.
        Specified by:
        get in interface com.google.inject.Provider<org.eclipse.xtext.resource.IResourceDescription>
        Specified by:
        get in interface javax.inject.Provider<org.eclipse.xtext.resource.IResourceDescription>
        Returns:
        the current resource description of the associated resource. May be null.
      • getActualContents

        public String getActualContents()
        Specified by:
        getActualContents in interface org.eclipse.xtext.ui.editor.IDirtyResource
      • getContents

        public String getContents()
        Specified by:
        getContents in interface org.eclipse.xtext.ui.editor.IDirtyResource
      • getDescription

        public org.eclipse.xtext.resource.IResourceDescription getDescription()
        Specified by:
        getDescription in interface org.eclipse.xtext.ui.editor.IDirtyResource
      • getURI

        public org.eclipse.emf.common.util.URI getURI()
        Specified by:
        getURI in interface org.eclipse.xtext.ui.editor.IDirtyResource
      • isInitialized

        public boolean isInitialized()
      • initiallyProcessResource

        protected void initiallyProcessResource​(org.eclipse.emf.ecore.resource.Resource resource)