Interface IStorageSettingsManager

All Superinterfaces:
IManagedService
All Known Implementing Classes:
StorageSettingsManager

public interface IStorageSettingsManager extends IManagedService
The Interface IStorageSettingsManager. Allows to get and to save storage IDs available for the project. Storage id is String of ITranslationStorageProvider id and providers segment.
  • Method Details

    • getSettingsOrDefault

      ProjectStorageSettings getSettingsOrDefault(org.eclipse.core.resources.IProject project)
      Gets the storage settings by the project or default configured settings by the project type.
      Parameters:
      project - the translating project (the project of the source code), cannot be null.
      Returns:
      the settings or default, cannot return null.
    • saveSettings

      void saveSettings(org.eclipse.core.resources.IProject project, ProjectStorageSettings settings, org.eclipse.core.runtime.IProgressMonitor monitor)
      Saves the project storage settings into the file of the project in /.settings/translation_storages.yml
      Parameters:
      project - the translating project to save, cannot be null.
      settings - the settings, cannot be null.
      monitor - the monitor, cannot be null.
    • getReadStorageIds

      List<StorageID> getReadStorageIds(org.eclipse.core.resources.IProject project)
      Gets only available (enabled) settings for the project.
      Parameters:
      project - the project, cannot be null.
      Returns:
      the available storage settings, cannot return null.
    • saveReadSettings

      void saveReadSettings(org.eclipse.core.resources.IProject project, List<StorageSettings> settings)
      Save the list of settings for the project.
      Parameters:
      project - the translating project, cannot be null.
      settings - the list of settings that should use to read with order, cannot be null.
    • saveReadStorageIds

      void saveReadStorageIds(org.eclipse.core.resources.IProject project, List<StorageID> ids)
      Saves the available storage ids for the project.
      Parameters:
      project - the translating project, cannot be null.
      ids - the list of ids that should use to read with order, cannot be null.
    • saveDefaultEditingStorageId

      void saveDefaultEditingStorageId(org.eclipse.core.resources.IProject project, StorageID id)
      Save default editing storage id for the project.
      Parameters:
      project - the translating project, cannot be null.
      id - the storage ID, cannot be null.
    • isStorageAvailable

      boolean isStorageAvailable(org.eclipse.core.resources.IProject project, StorageID storageId)
      Check that storage with given storageId is available for the specified project.
      Parameters:
      project - the translating project, cannot be null.
      storageId - Storage identifier to check, cannot be null.
      Returns:
    • addChangeListener

      void addChangeListener(IStorageSettingsChangeListener listener)
      Adds the settings change listener. Has no effect if an identical listener is already registered.
      Parameters:
      listener - the listener, cannot be null.
    • removeChangeListener

      void removeChangeListener(IStorageSettingsChangeListener listener)
      Removes the settings change listener. Has no effect if an identical listener is not registered.
      Parameters:
      listener - the listener, cannot be null.