org.eclipse.xtext.ui.editor
Class DocumentBasedDirtyResource
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DocumentBasedDirtyResource
public DocumentBasedDirtyResource()
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
.