org.eclipse.xtext.ui.editor
Class DocumentBasedDirtyResource

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.DocumentBasedDirtyResource
All Implemented Interfaces:
javax.inject.Provider<IResourceDescription>, IDirtyResource
Direct Known Subclasses:
PersistentDataAwareDirtyResource

public class DocumentBasedDirtyResource
extends java.lang.Object
implements IDirtyResource, com.google.inject.Provider<IResourceDescription>

Author:
Sebastian Zarnekow - Initial contribution and API

Constructor Summary
DocumentBasedDirtyResource()
           
 
Method Summary
 void connect(IXtextDocument document)
           
 void copyState(IResourceDescription original)
           
 void disconnect(IXtextDocument document)
           
 IResourceDescription get()
          Callback method for the copied resource description.
 java.lang.String getActualContents()
           
 java.lang.String getContents()
           
 IResourceDescription getDescription()
           
 IXtextDocument getUnderlyingDocument()
           
 org.eclipse.emf.common.util.URI getURI()
           
protected  void initiallyProcessResource(XtextResource resource)
           
 boolean isInitialized()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentBasedDirtyResource

public DocumentBasedDirtyResource()
Method Detail

connect

public void connect(IXtextDocument document)

initiallyProcessResource

protected void initiallyProcessResource(XtextResource resource)

disconnect

public void disconnect(IXtextDocument document)

get

public 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 javax.inject.Provider<IResourceDescription>
Returns:
the current resource description of the associated document. May be null.

copyState

public void copyState(IResourceDescription original)

getUnderlyingDocument

public IXtextDocument getUnderlyingDocument()

isInitialized

public boolean isInitialized()

getURI

public org.eclipse.emf.common.util.URI getURI()
Specified by:
getURI in interface IDirtyResource
Returns:
the URI of the resource, never null.

getDescription

public IResourceDescription getDescription()
Specified by:
getDescription in interface IDirtyResource
Returns:
the description of the resource, never null.

getContents

public java.lang.String getContents()
Specified by:
getContents in interface IDirtyResource
Returns:
the content of the resource as text, never null. May be the content of a snapshot.

getActualContents

public java.lang.String getActualContents()
Specified by:
getActualContents in interface IDirtyResource
Returns:
the current content of the underlying document or resource as text, never null.