public String getActualContents() { return dirtyResource.getActualContents(); }
public String getContents() { return dirtyResource.getContents(); }
public IResourceDescription getDescription() { return dirtyResource.getDescription(); }
public void removeDirtyStateSupport(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$ client.removeVerifyListener(this); stateChangeEventBroker.removeListener(this); if (dirtyResource.isInitialized()) dirtyStateManager.discardDirtyState(delegatingClientAwareResource); IXtextDocument document = client.getDocument(); if (document == null) document = dirtyResource.getUnderlyingDocument(); if (document != null) { dirtyResource.disconnect(document); document.removeModelListener(this); } this.delegatingClientAwareResource = null; this.currentClient = null; }
public void descriptionsChanged(final IResourceDescription.Event event) { if (!getDirtyResource().isInitialized()) return; for(IResourceDescription.Delta delta: event.getDeltas()) { if (delta.getOld() == getDirtyResource().getDescription() || delta.getNew() == getDirtyResource().getDescription()) return; } scheduleUpdateEditorJob(event); }
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); } } } }
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); }
public URI getURI() { return dirtyResource.getURI(); }
public URI getNormalizedURI() { return dirtyResource.getNormalizedURI(); }
protected void initDirtyResource(IXtextDocument document) { dirtyResource.connect(document); delegatingClientAwareResource = new ClientAwareDirtyResource(); }
public void copyState(IResourceDescription original) { StatefulResourceDescription copy = new StatefulResourceDescription(original, this); synchronized(this) { description = copy; content = getUnderlyingDocument().get(); } }
@Override protected void initiallyProcessResource(XtextResource resource) { IResourceDescription description = resourceDesriptions.getResourceDescription(resource.getURI()); if (description != null) { copyState(description); } else { super.initiallyProcessResource(resource); } }
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); } } }
/** * @since 2.3 */ public boolean haveEObjectDescriptionsChanged(final IResourceDescription newDescription, IResourceDescription.Manager resourceDescriptionManager) { return resourceDescriptionManager.createDelta(dirtyResource.getDescription(), newDescription).haveEObjectDescriptionsChanged(); }