Class GlobalEditingContext

java.lang.Object
com.e1c.langtool.storage.GlobalEditingContext
All Implemented Interfaces:
IEditingContext

public class GlobalEditingContext extends Object implements IEditingContext
  • Constructor Details

    • GlobalEditingContext

      public GlobalEditingContext(org.eclipse.core.resources.IProject project, ITranslationStorageManager translationStorageManager)
  • Method Details

    • getTranslation

      public String getTranslation(StorageID storageId, TranslationKey translationKey, TranslateLanguage language)
      Description copied from interface: IEditingContext
      Gets the translation from the storage.
      Specified by:
      getTranslation in interface IEditingContext
      Parameters:
      storageId - the storage id, cannot be null.
      translationKey - the translation key, cannot be null.
      language - the language, cannot be null.
      Returns:
      the translation, may return null.
    • setTranslation

      public void setTranslation(StorageID storageId, TranslationKey translationKey, TranslateLanguage language, String translation)
      Description copied from interface: IEditingContext
      Sets the translation to the editing context.
      Specified by:
      setTranslation in interface IEditingContext
      Parameters:
      storageId - the storage id, cannot be null.
      translationKey - the translation key, cannot be null.
      language - the language, cannot be null.
      translation - the translation, may be null.
    • removeTranslation

      public void removeTranslation(StorageID storageId, TranslationKey translationKey, TranslateLanguage language)
      Description copied from interface: IEditingContext
      Removes the translation by given translation key and language in the storage.
      Specified by:
      removeTranslation in interface IEditingContext
      Parameters:
      storageId - the storage id, cannot be null.
      translationKey - the translation key, cannot be null.
      language - the language, cannot be null.
    • getProject

      public org.eclipse.core.resources.IProject getProject()
      Description copied from interface: IEditingContext
      Gets the project of editing context.
      Specified by:
      getProject in interface IEditingContext
      Returns:
      the project
    • isDirty

      public boolean isDirty()
      Description copied from interface: IEditingContext
      Returns true if the context is dirty, false - otherwise.
      Specified by:
      isDirty in interface IEditingContext
      Returns:
      true if the context is dirty, false - otherwise.
    • save

      public void save()
      Description copied from interface: IEditingContext
      Saves the context.
      Specified by:
      save in interface IEditingContext
    • getUndoContext

      public org.eclipse.core.commands.operations.IUndoContext getUndoContext()
      Description copied from interface: IEditingContext
      Returns the IUndoContext to support the undo/redo operations.
      Specified by:
      getUndoContext in interface IEditingContext
      Returns:
      the IUndoContext to support the undo/redo operations or null if the context is not initialized or already disposed.
    • dispose

      public void dispose()
      Description copied from interface: IEditingContext
      Disposes the context.
      Specified by:
      dispose in interface IEditingContext
    • isDisposed

      public boolean isDisposed()
      Description copied from interface: IEditingContext
      Returns true if the context is disposed, false - otherwise.
      Specified by:
      isDisposed in interface IEditingContext
      Returns:
      true if the context is disposed, false - otherwise.
    • addListener

      public void addListener(IEditingContextListener listener)
      Description copied from interface: IEditingContext
      Adds the specified listener.
      Specified by:
      addListener in interface IEditingContext
      Parameters:
      listener - the listener to add, cannot be null.
    • removeListener

      public void removeListener(IEditingContextListener listener)
      Description copied from interface: IEditingContext
      Removes the specified listener.
      Specified by:
      removeListener in interface IEditingContext
      Parameters:
      listener - the listener to remove, cannot be null.