public class DirtyStateEditorSupport extends java.lang.Object implements IXtextModelListener, IResourceDescription.Event.Listener, org.eclipse.swt.events.VerifyListener
Modifier and Type | Class and Description |
---|---|
static interface |
DirtyStateEditorSupport.IConcurrentEditingCallback
Allows to mock the user decision in unit tests.
|
static interface |
DirtyStateEditorSupport.IDirtyStateEditorSupportClient
Minimal required interface for clients.
|
static class |
DirtyStateEditorSupport.InteractiveConcurrentEditingQuestion |
protected class |
DirtyStateEditorSupport.UpdateEditorStateJob |
Constructor and Description |
---|
DirtyStateEditorSupport() |
public void initializeDirtyStateSupport(DirtyStateEditorSupport.IDirtyStateEditorSupportClient client)
public void verifyText(org.eclipse.swt.events.VerifyEvent e)
verifyText
in interface org.eclipse.swt.events.VerifyListener
public boolean doVerify()
public boolean isEditingPossible(DirtyStateEditorSupport.IDirtyStateEditorSupportClient client)
protected boolean isConcurrentEditingIgnored()
protected void initDirtyResource(IXtextDocument document)
public void removeDirtyStateSupport(DirtyStateEditorSupport.IDirtyStateEditorSupportClient client)
public void markEditorClean(DirtyStateEditorSupport.IDirtyStateEditorSupportClient client)
public void descriptionsChanged(IResourceDescription.Event event)
IResourceDescription.Event.Listener
The source will invoce this method to announce changed resource. The event will never be
null
. However, it may contain an empty list of deltas.
Listeners are free to remove themselves from the sender of the event or add other listeners. However added listeners will not be informed about the current change.
This event may be fired asynchronously. It is ensured that the changed resources will provide the content as it was when the change has been announced to the sender of the event.
descriptionsChanged
in interface IResourceDescription.Event.Listener
event
- the fired event. Will never be null
.public void scheduleUpdateEditorJob(IResourceDescription.Event event)
protected DirtyStateEditorSupport.UpdateEditorStateJob createUpdateEditorJob()
public void modelChanged(XtextResource resource)
modelChanged
in interface IXtextModelListener
@Deprecated public boolean haveEObjectDescriptionsChanged(IResourceDescription newDescription)
public boolean haveEObjectDescriptionsChanged(IResourceDescription newDescription, IResourceDescription.Manager resourceDescriptionManager)
protected java.util.Collection<org.eclipse.emf.ecore.resource.Resource> collectAffectedResources(XtextResource resource, IResourceDescription.Event event)
protected boolean isReparseRequired(XtextResource resource, IResourceDescription.Event event)
protected boolean isDirty()
protected ChangedResourceDescriptionDelta createDelta(IResourceDescription.Delta delta, IResourceDescription.Delta prev)
public IDirtyStateManager getDirtyStateManager()
public void setDirtyStateManager(IDirtyStateManager dirtyStateManager)
public IStateChangeEventBroker getStateChangeEventBroker()
public void setStateChangeEventBroker(IStateChangeEventBroker stateChangeEventBroker)
public void setConcurrentEditingWarningDialog(DirtyStateEditorSupport.IConcurrentEditingCallback concurrentEditingWarningDialog)
public DirtyStateEditorSupport.IConcurrentEditingCallback getConcurrentEditingWarningDialog()
public void setDirtyResource(DocumentBasedDirtyResource dirtyResource)
public DocumentBasedDirtyResource getDirtyResource()
public void setResourceDescriptions(IResourceDescriptions resourceDescriptions)