Class InMemoryChangeManagerProxy

java.lang.Object
com.e1c.langtool.internal.sync.change.InMemoryChangeManagerProxy
All Implemented Interfaces:
ChangeManager, EditingChangeManager

public class InMemoryChangeManagerProxy extends Object implements ChangeManager
Change manager stores in memory all path that need to synchronize or remove in translated project.
  • Constructor Summary

    Constructors
    Constructor
    Description
    InMemoryChangeManagerProxy(org.eclipse.core.resources.IProject sourceProject, org.eclipse.core.resources.IProject translatedProject)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds the post change listener.
    protected void
     
    void
    Clear all changes in the manager.
    void
    Dispose change manager.
    protected void
    Notifies any post change listeners that a post change event has been received.
    Collection<org.eclipse.core.runtime.IPath>
    Gets the full path of files to remove.
    Collection<org.eclipse.core.runtime.IPath>
    Gets the full path of files to update.
    void
    initialize(org.eclipse.core.runtime.IProgressMonitor monitor)
    Initialize the change manager to accept changes.
    boolean
    Checks if the change manager is disposed.
    boolean
    Checks if the manager is initialized.
    boolean
    Checks if the change manager is muted of sending event notifications.
    void
    markRemoved(org.eclipse.core.runtime.IPath fullPath)
    Mark the file as removed in target project.
    void
    markSynchronized(org.eclipse.core.runtime.IPath fullPath)
    Mark the file as synchronized with target project.
    void
    markToRemove(org.eclipse.core.resources.IFile file)
    Mark the file to remove in translated project.
    void
    markToRemove(org.eclipse.core.runtime.IPath fullPath)
    Mark the file (its full path) to remove in translated project.
    void
    markToSynchronize(org.eclipse.core.resources.IFile file)
    Mark the file to synchronize to translated project if it exists.
    void
    markToSynchronize(org.eclipse.core.runtime.IPath fullPath)
    Mark the file (its full path) to synchronize to translated project.
    void
    moved(org.eclipse.core.resources.IFile from, org.eclipse.core.resources.IFile to)
    Mark file as moved to enother place.
    void
    Mute event notification.
    void
    Removes the post change listener.
    void
    Unmute the change manager to send event notifications.
    void
    Unmute the change manager to send event notifications and notify an event.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InMemoryChangeManagerProxy

      public InMemoryChangeManagerProxy(org.eclipse.core.resources.IProject sourceProject, org.eclipse.core.resources.IProject translatedProject)
  • Method Details

    • clear

      public void clear()
      Description copied from interface: EditingChangeManager
      Clear all changes in the manager.
      Specified by:
      clear in interface EditingChangeManager
    • markToSynchronize

      public void markToSynchronize(org.eclipse.core.runtime.IPath fullPath)
      Description copied from interface: EditingChangeManager
      Mark the file (its full path) to synchronize to translated project.
      Specified by:
      markToSynchronize in interface EditingChangeManager
      Parameters:
      fullPath - the full path
    • markToRemove

      public void markToRemove(org.eclipse.core.runtime.IPath fullPath)
      Description copied from interface: EditingChangeManager
      Mark the file (its full path) to remove in translated project.
      Specified by:
      markToRemove in interface EditingChangeManager
      Parameters:
      fullPath - the full path
    • getFilesToUpdate

      public Collection<org.eclipse.core.runtime.IPath> getFilesToUpdate()
      Description copied from interface: ChangeManager
      Gets the full path of files to update.
      Specified by:
      getFilesToUpdate in interface ChangeManager
      Returns:
      the collection of full path of files to update
    • getFilesToRemove

      public Collection<org.eclipse.core.runtime.IPath> getFilesToRemove()
      Description copied from interface: ChangeManager
      Gets the full path of files to remove.
      Specified by:
      getFilesToRemove in interface ChangeManager
      Returns:
      the collection of full path of files to remove
    • markToSynchronize

      public void markToSynchronize(org.eclipse.core.resources.IFile file)
      Description copied from interface: EditingChangeManager
      Mark the file to synchronize to translated project if it exists. Call this method equivalent to call:
        if (!file.isAccesseble())
            return;
        markToSynchronize(file.getFullPath());
       
      Specified by:
      markToSynchronize in interface EditingChangeManager
      Parameters:
      file - the file to synchronize
      See Also:
    • moved

      public void moved(org.eclipse.core.resources.IFile from, org.eclipse.core.resources.IFile to)
      Description copied from interface: EditingChangeManager
      Mark file as moved to enother place.
      Specified by:
      moved in interface EditingChangeManager
      Parameters:
      from - the from file
      to - the to file
    • markToRemove

      public void markToRemove(org.eclipse.core.resources.IFile file)
      Description copied from interface: EditingChangeManager
      Mark the file to remove in translated project.
      Specified by:
      markToRemove in interface EditingChangeManager
      Parameters:
      file - the file
    • markSynchronized

      public void markSynchronized(org.eclipse.core.runtime.IPath fullPath)
      Description copied from interface: ChangeManager
      Mark the file as synchronized with target project.
      Specified by:
      markSynchronized in interface ChangeManager
      Parameters:
      fullPath - the full path, cannot be null.
    • markRemoved

      public void markRemoved(org.eclipse.core.runtime.IPath fullPath)
      Description copied from interface: ChangeManager
      Mark the file as removed in target project.
      Specified by:
      markRemoved in interface ChangeManager
      Parameters:
      fullPath - the full path, cannot be null.
    • mute

      public void mute()
      Description copied from interface: EditingChangeManager
      Mute event notification.
      Specified by:
      mute in interface EditingChangeManager
    • isMuted

      public boolean isMuted()
      Description copied from interface: EditingChangeManager
      Checks if the change manager is muted of sending event notifications.
      Specified by:
      isMuted in interface EditingChangeManager
      Returns:
      true, if the change manager is muted
    • unmute

      public void unmute()
      Description copied from interface: EditingChangeManager
      Unmute the change manager to send event notifications.
      Specified by:
      unmute in interface EditingChangeManager
    • unmute

      public void unmute(ChangeEvent event)
      Description copied from interface: EditingChangeManager
      Unmute the change manager to send event notifications and notify an event.
      Specified by:
      unmute in interface EditingChangeManager
      Parameters:
      event - the event
    • addPostChangeListener

      public void addPostChangeListener(PostChangeListener listener)
      Description copied from interface: EditingChangeManager
      Adds the post change listener.
      Specified by:
      addPostChangeListener in interface EditingChangeManager
      Parameters:
      listener - the listener
    • removePostChangeListener

      public void removePostChangeListener(PostChangeListener listener)
      Description copied from interface: EditingChangeManager
      Removes the post change listener.
      Specified by:
      removePostChangeListener in interface EditingChangeManager
      Parameters:
      listener - the listener
    • initialize

      public void initialize(org.eclipse.core.runtime.IProgressMonitor monitor)
      Description copied from interface: ChangeManager
      Initialize the change manager to accept changes. Clients must call this method must explicitly before use this manager in synchronization to get content from ChangeManager.getFilesToUpdate() or from ChangeManager.getFilesToRemove(). Calling this method several times has no effect if it is already initialized.
      Specified by:
      initialize in interface ChangeManager
      Parameters:
      monitor - the monitor
      See Also:
    • isInitialized

      public boolean isInitialized()
      Description copied from interface: ChangeManager
      Checks if the manager is initialized.
      Specified by:
      isInitialized in interface ChangeManager
      Returns:
      true, if the manager is initialized
    • firePostChanged

      protected void firePostChanged(ChangeEvent event)
      Notifies any post change listeners that a post change event has been received. Only listeners registered at the time this method is called are notified.

      Note: if the manager is muted events cannot be sent.

      Parameters:
      event - a selection changed event
      See Also:
    • dispose

      public void dispose()
      Description copied from interface: EditingChangeManager
      Dispose change manager.
      Specified by:
      dispose in interface EditingChangeManager
    • isDisposed

      public boolean isDisposed()
      Description copied from interface: EditingChangeManager
      Checks if the change manager is disposed.
      Specified by:
      isDisposed in interface EditingChangeManager
      Returns:
      true, if the manager is disposed
    • checkAccess

      protected void checkAccess()