Interface IEditingContext

All Known Implementing Classes:
GlobalEditingContext

public interface IEditingContext
Common interface for objects of editing translation for FeatureValue and language code. The context is responsible for storing translation in ITranslationStorageProvider.Storage according user settings of current editing storage.
See Also:
  • Method Details

    • getTranslation

      String getTranslation(StorageID storageId, TranslationKey translationKey, TranslateLanguage language)
      Gets the translation from the storage.
      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

      void setTranslation(StorageID storageId, TranslationKey translationKey, TranslateLanguage language, String translation)
      Sets the translation to the editing context.
      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

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

      org.eclipse.core.resources.IProject getProject()
      Gets the project of editing context.
      Returns:
      the project
    • isDirty

      boolean isDirty()
      Returns true if the context is dirty, false - otherwise.
      Returns:
      true if the context is dirty, false - otherwise.
    • save

      void save()
      Saves the context.
    • getUndoContext

      org.eclipse.core.commands.operations.IUndoContext getUndoContext()
      Returns the IUndoContext to support the undo/redo operations.
      Returns:
      the IUndoContext to support the undo/redo operations or null if the context is not initialized or already disposed.
    • dispose

      void dispose()
      Disposes the context.
    • isDisposed

      boolean isDisposed()
      Returns true if the context is disposed, false - otherwise.
      Returns:
      true if the context is disposed, false - otherwise.
    • addListener

      void addListener(IEditingContextListener listener)
      Adds the specified listener.
      Parameters:
      listener - the listener to add, cannot be null.
    • removeListener

      void removeListener(IEditingContextListener listener)
      Removes the specified listener.
      Parameters:
      listener - the listener to remove, cannot be null.