public void markEditorClean(IDirtyStateEditorSupportClient client) { if (this.currentClient == null || this.currentClient != client) throw new IllegalStateException("Was configured with another client or not configured at all."); //$NON-NLS-1$ dirtyStateManager.discardDirtyState(delegatingClientAwareResource); isDirty = false; IResourceDescription cleanDescription = resourceDescriptions.getResourceDescription(delegatingClientAwareResource.getURI()); if (cleanDescription != null) dirtyResource.copyState(cleanDescription); }
protected void initiallyProcessResource(XtextResource resource) { IResourceServiceProvider serviceProvider = resource.getResourceServiceProvider(); if (serviceProvider != null) { IResourceDescription.Manager descriptionManager = serviceProvider.getResourceDescriptionManager(); if (descriptionManager != null) { final IResourceDescription description = descriptionManager.getResourceDescription(resource); if (description != null) copyState(description); } } }
public void modelChanged(XtextResource resource) { if (resource == null || !dirtyResource.isInitialized()) return; if (isDirty || ((!resource.isTrackingModification() || resource.isModified()) && currentClient.isDirty() && dirtyStateManager.manageDirtyState(delegatingClientAwareResource))) { synchronized (dirtyStateManager) { IResourceDescription.Manager resourceDescriptionManager = resource.getResourceServiceProvider().getResourceDescriptionManager(); final IResourceDescription newDescription = resourceDescriptionManager.getResourceDescription(resource); if (haveEObjectDescriptionsChanged(newDescription, resourceDescriptionManager)) { dirtyResource.copyState(newDescription); dirtyStateManager.announceDirtyStateChanged(delegatingClientAwareResource); } } } }