Class ProjectTranslationReader
java.lang.Object
com.e1c.langtool.internal.storage.ProjectTranslationReader
- All Implemented Interfaces:
IProjectTranslationReader
The reader allows to get translation from storages with order specified in project settings
-
Constructor Summary
ConstructorsConstructorDescriptionProjectTranslationReader(org.eclipse.core.resources.IProject project) Instantiates a new project translation reader. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener for post value changes in all storages of the project.getStoredTranslation(TranslationKey key, TranslateLanguage language, ITranslationStorageProvider.Storage.Type... storageTypes) Gets the stored translation with the project storage settings read order.voidRemoves the given listener for post value changes from all storages of the project.
-
Constructor Details
-
ProjectTranslationReader
public ProjectTranslationReader(org.eclipse.core.resources.IProject project) Instantiates a new project translation reader.- Parameters:
project- the project, cannot benull.
-
-
Method Details
-
getStoredTranslation
public String getStoredTranslation(TranslationKey key, TranslateLanguage language, ITranslationStorageProvider.Storage.Type... storageTypes) Gets the stored translation with the project storage settings read order.- Specified by:
getStoredTranslationin interfaceIProjectTranslationReader- Parameters:
key- the key, cannot benull.language- the language, cannot benull.storageTypes- the storage types, can benullor empty array to get from all types of storages.- Returns:
- the stored translation, can return
nullif not exist.
-
addValueChangedListener
Adds a listener for post value changes in all storages of the project. Has no effect if an identical listener is already registered.- Specified by:
addValueChangedListenerin interfaceIProjectTranslationReader- Parameters:
listener- the listener
-
removeValueChangedListener
Removes the given listener for post value changes from all storages of the project. Has no effect if an identical listener is not registered.- Specified by:
removeValueChangedListenerin interfaceIProjectTranslationReader- Parameters:
listener- the listener
-