Class DirtyStateEditorSupport

    • Constructor Detail

      • DirtyStateEditorSupport

        public DirtyStateEditorSupport()
    • Method Detail

      • notifyChanged

        public void notifyChanged​(org.eclipse.emf.common.notify.Notification notification)
        Specified by:
        notifyChanged in interface org.eclipse.emf.common.notify.Adapter
        Overrides:
        notifyChanged in class org.eclipse.emf.ecore.util.EContentAdapter
      • descriptionsChanged

        public void descriptionsChanged​(org.eclipse.xtext.resource.IResourceDescription.Event event)
        This method is triggered when there is changes in other resources.

        This method is not intended to call by clients.

        Specified by:
        descriptionsChanged in interface org.eclipse.xtext.resource.IResourceDescription.Event.Listener
        Parameters:
        event - IResourceDescription.Event instance (never null).
      • getDirtyStateManager

        public org.eclipse.xtext.ui.editor.IDirtyStateManager getDirtyStateManager()
      • setDirtyStateManager

        public void setDirtyStateManager​(org.eclipse.xtext.ui.editor.IDirtyStateManager dirtyStateManager)
      • getStateChangeEventBroker

        public org.eclipse.xtext.ui.notification.IStateChangeEventBroker getStateChangeEventBroker()
      • setStateChangeEventBroker

        public void setStateChangeEventBroker​(org.eclipse.xtext.ui.notification.IStateChangeEventBroker stateChangeEventBroker)
      • setDirtyResource

        public void setDirtyResource​(DirtyResource dirtyResource)
      • setResourceDescriptions

        public void setResourceDescriptions​(org.eclipse.xtext.resource.IResourceDescriptions resourceDescriptions)
        Since:
        2.1
      • scheduleUpdateEditorJob

        protected void scheduleUpdateEditorJob​(org.eclipse.xtext.resource.IResourceDescription.Event event)
        Schedules update editor job.
        Parameters:
        event - IResourceDescription.Event instance (never ).
      • collectAffectedResources

        protected Collection<org.eclipse.emf.ecore.resource.Resource> collectAffectedResources​(org.eclipse.emf.ecore.resource.Resource resource,
                                                                                               org.eclipse.xtext.resource.IResourceDescription.Event event)
        Returns resources affected by given resource description change event and managed resource.
        Parameters:
        resource - resource managed by this dirty editor support instance.
        event - IResourceDescription.Event instance (never ).
        Returns:
        affected resources (never null).
      • initDirtyResource

        protected void initDirtyResource​(org.eclipse.emf.ecore.resource.Resource resource)
        Performs dirty resource initialization.
        Parameters:
        resource - managed by dirty state support resource (never null).
      • isDirty

        protected boolean isDirty()
      • isRelinkRequired

        protected boolean isRelinkRequired​(org.eclipse.emf.ecore.resource.Resource resource,
                                           org.eclipse.xtext.resource.IResourceDescription.Event event)
        Checks if given resource needsN to be relinked.
        Parameters:
        resource - resource managed by dirty state editor support (newver null).
        event - IResourceDescription.Event instance (never ).
        Returns:
        true if given resource must be relinked, false otherwise.
      • isAffected

        protected boolean isAffected​(org.eclipse.emf.common.notify.Notification notification)
        Returns if all interested sides should be notified about model changes.

        This implementation returns true for all model changes, clients may override this method to provide more strict checks.

        Parameters:
        notification - model changes notification.
        Returns:
        true if all interested sides should be notified about model changes, false otherwise.
      • isConcurrentEditingIgnored

        protected boolean isConcurrentEditingIgnored()
      • unloadAffectedResourcesAndRelink

        protected void unloadAffectedResourcesAndRelink​(org.eclipse.emf.ecore.resource.Resource resource,
                                                        org.eclipse.xtext.resource.IResourceDescription.Event event)
        Unloads affected resources and performs given resource relinking.
        Parameters:
        resource - current resource.
        event - resource description change event.
      • isResourceRemoveAllowed

        protected boolean isResourceRemoveAllowed​(org.eclipse.emf.ecore.resource.Resource affectedResource,
                                                  org.eclipse.xtext.resource.IResourceDescription.Event event)
        Checks if affected by outer changes resource can be removed from its containing resource set.
        Parameters:
        affectedResource - the affected resource (never null)
        event - (never null)
        Returns:
        true if given resource can be removed, else returns false
      • relinkResource

        protected void relinkResource​(org.eclipse.emf.ecore.resource.Resource resource)
        Performs resource relinking.

        This method is triggered when out chages affected given resource and it is need to be relinked.

        Parameters:
        resource - the resource to relink proxies in