public class DirtyStateManager extends AbstractResourceDescriptionChangeEventSource implements IDirtyStateManager, IDirtyStateManagerExtension
IDirtyStateManager.Event
Constructor and Description |
---|
DirtyStateManager() |
Modifier and Type | Method and Description |
---|---|
void |
announceDirtyStateChanged(IDirtyResource dirtyResource)
Announce the dirty state of the given resource.
|
void |
discardDirtyState(IDirtyResource dirtyResource)
Mark the given dirty resource as unmanaged.
|
protected IDirtyResource |
findDirtyResourcebyURIorNormalizedURI(org.eclipse.emf.common.util.URI uri) |
IExternalContentSupport.IExternalContentProvider |
getActualContentProvider()
Some use cases may require the latest and most up to date content - mostly in a secured, transactional
context such as a rename refactoring.
|
java.lang.String |
getContent(org.eclipse.emf.common.util.URI uri)
Get the content that will shadow the persistent state.
|
IDirtyResource |
getDirtyResource(org.eclipse.emf.common.util.URI uri) |
IResourceDescription |
getDirtyResourceDescription(org.eclipse.emf.common.util.URI uri) |
java.util.List<org.eclipse.emf.common.util.URI> |
getDirtyResourceURIs() |
java.lang.Iterable<IEObjectDescription> |
getExportedObjects() |
java.lang.Iterable<IEObjectDescription> |
getExportedObjects(org.eclipse.emf.ecore.EClass type,
QualifiedName name,
boolean ignoreCase) |
java.lang.Iterable<IEObjectDescription> |
getExportedObjectsByObject(org.eclipse.emf.ecore.EObject object) |
java.lang.Iterable<IEObjectDescription> |
getExportedObjectsByType(org.eclipse.emf.ecore.EClass type) |
boolean |
hasContent(org.eclipse.emf.common.util.URI uri) |
boolean |
isEmpty()
Clients may want to check the selectable to skip its processing in case it is empty.
|
boolean |
manageDirtyState(IDirtyResource dirtyResource)
Initially try to manage the given resource and its dirty state.
|
protected void |
notifyListeners(IDirtyResource dirtyResource,
boolean managed) |
addListener, addListeners, notifyListeners, removeListener, removeListeners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener, notifyListeners, removeListener
public void announceDirtyStateChanged(IDirtyResource dirtyResource)
IDirtyStateManager
announceDirtyStateChanged
in interface IDirtyStateManager
public void discardDirtyState(IDirtyResource dirtyResource)
IDirtyStateManager
URI
will not become unmanaged. A call to this method will raise an event.discardDirtyState
in interface IDirtyStateManager
IDirtyStateManager.announceDirtyStateChanged(IDirtyResource)
protected void notifyListeners(IDirtyResource dirtyResource, boolean managed)
public boolean manageDirtyState(IDirtyResource dirtyResource)
IDirtyStateManager
True
will be returned, if the resource with the given URI
was not managed before. However clients are free to call
IDirtyStateManager.announceDirtyStateChanged(IDirtyResource)
even if false
was
returned. A call to IDirtyStateManager.manageDirtyState(IDirtyResource)
does not raise any events.manageDirtyState
in interface IDirtyStateManager
true
if this resource is the first one that has been registered
for its URI
public IDirtyResource getDirtyResource(org.eclipse.emf.common.util.URI uri)
public IResourceDescription getDirtyResourceDescription(org.eclipse.emf.common.util.URI uri)
getDirtyResourceDescription
in interface IDirtyStateManager
public java.lang.String getContent(org.eclipse.emf.common.util.URI uri)
IExternalContentSupport.IExternalContentProvider
getContent
in interface IExternalContentSupport.IExternalContentProvider
protected IDirtyResource findDirtyResourcebyURIorNormalizedURI(org.eclipse.emf.common.util.URI uri)
public IExternalContentSupport.IExternalContentProvider getActualContentProvider()
IExternalContentSupport.IExternalContentProvider
getActualContentProvider
in interface IExternalContentSupport.IExternalContentProvider
public boolean hasContent(org.eclipse.emf.common.util.URI uri)
hasContent
in interface IExternalContentSupport.IExternalContentProvider
true
if and only if external content should be used instead of the persistent one.public boolean isEmpty()
ISelectable
false
if it is too expensive to compute the actual result.isEmpty
in interface ISelectable
true
if the selectable does not provide any descriptions.public java.lang.Iterable<IEObjectDescription> getExportedObjects()
getExportedObjects
in interface ISelectable
null
.public java.lang.Iterable<IEObjectDescription> getExportedObjects(org.eclipse.emf.ecore.EClass type, QualifiedName name, boolean ignoreCase)
getExportedObjects
in interface ISelectable
null
.public java.lang.Iterable<IEObjectDescription> getExportedObjectsByObject(org.eclipse.emf.ecore.EObject object)
getExportedObjectsByObject
in interface ISelectable
null
.public java.lang.Iterable<IEObjectDescription> getExportedObjectsByType(org.eclipse.emf.ecore.EClass type)
getExportedObjectsByType
in interface ISelectable
null
.public java.util.List<org.eclipse.emf.common.util.URI> getDirtyResourceURIs()
getDirtyResourceURIs
in interface IDirtyStateManagerExtension