Class DbViewTermsStorage
java.lang.Object
com.e1c.langtool.v8.dt.md.storage.DbViewTermsStorage
- All Implemented Interfaces:
ITranslationStorageProvider.DictionaryStorage,ITranslationStorageProvider.Storage
public class DbViewTermsStorage
extends Object
implements ITranslationStorageProvider.DictionaryStorage
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.e1c.langtool.storage.ITranslationStorageProvider.Storage
ITranslationStorageProvider.Storage.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener for post value changes in this storage.voidInform storage about planned batch update.voidEnd storage batch update.getId()Gets the id of storage.The unique segment.getTranslation(TranslationKey key, TranslateLanguage language) Gets the translation from the dictionary storage.getType()Returns the type of translation storage.booleanhasKeyForValue(String value, TranslateLanguage language, TranslationKey skipKey) Checks that dictionary has key for the value except the given skip key.voidinitialize(org.eclipse.core.resources.IProject project) booleanChecks if the storage is read only.voidmoveTranslation(TranslationKey fromKey, TranslationKey toKey, TranslateLanguage language, boolean autoSave) Move translation from one key to another inside this single storage.voidremoveTranslation(TranslationKey key, TranslateLanguage language, boolean autoSave) Removes the translation.voidRemoves the given listener for post value changes from this storage.Map<org.eclipse.core.resources.IFile,byte[]> saveFiles(TranslateLanguage language, com.google.common.hash.HashFunction hashFunction) TODO JavaDocvoidsetTranslation(TranslationKey key, TranslateLanguage language, String translation, boolean autoSave) Sets the translation of dictionary storage.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.e1c.langtool.storage.ITranslationStorageProvider.DictionaryStorage
getComment, getTranslation, moveComment, moveTranslation, removeComment, removeTranslation, setComment, setTranslationMethods inherited from interface com.e1c.langtool.storage.ITranslationStorageProvider.Storage
addBatchUpdateNotification
-
Constructor Details
-
DbViewTermsStorage
public DbViewTermsStorage()
-
-
Method Details
-
getId
Description copied from interface:ITranslationStorageProvider.StorageGets the id of storage.- Specified by:
getIdin interfaceITranslationStorageProvider.Storage- Returns:
- the id. Cannot return
null.
-
getSegment
Description copied from interface:ITranslationStorageProvider.StorageThe unique segment.- Specified by:
getSegmentin interfaceITranslationStorageProvider.Storage- Returns:
- the segment
-
addValueChangedListener
Description copied from interface:ITranslationStorageProvider.StorageAdds a listener for post value changes in this storage. Has no effect if an identical listener is already registered.- Specified by:
addValueChangedListenerin interfaceITranslationStorageProvider.Storage- Parameters:
listener- the listener
-
removeValueChangedListener
Description copied from interface:ITranslationStorageProvider.StorageRemoves the given listener for post value changes from this storage. Has no effect if an identical listener is not registered.- Specified by:
removeValueChangedListenerin interfaceITranslationStorageProvider.Storage- Parameters:
listener- the listener
-
getTranslation
Description copied from interface:ITranslationStorageProvider.DictionaryStorageGets the translation from the dictionary storage.- Specified by:
getTranslationin interfaceITranslationStorageProvider.DictionaryStorage- Parameters:
key- the translation key, cannot benull.language- the language, cannot benull.- Returns:
- the translation, can return
null.
-
setTranslation
public void setTranslation(TranslationKey key, TranslateLanguage language, String translation, boolean autoSave) Description copied from interface:ITranslationStorageProvider.DictionaryStorageSets the translation of dictionary storage.- Specified by:
setTranslationin interfaceITranslationStorageProvider.DictionaryStorage- Parameters:
key- the translation key, cannot benull.language- the language, cannot benull.translation- the translation, can benull.
-
removeTranslation
Description copied from interface:ITranslationStorageProvider.DictionaryStorageRemoves the translation.- Specified by:
removeTranslationin interfaceITranslationStorageProvider.DictionaryStorage- Parameters:
key- the translation key, cannot benull.language- the language, cannot benull.
-
moveTranslation
public void moveTranslation(TranslationKey fromKey, TranslationKey toKey, TranslateLanguage language, boolean autoSave) Description copied from interface:ITranslationStorageProvider.DictionaryStorageMove translation from one key to another inside this single storage. Attantion! Implementation should move the comment of source translation key to new one.- Specified by:
moveTranslationin interfaceITranslationStorageProvider.DictionaryStorage- Parameters:
fromKey- the from translation key, cannot benull.toKey- the to translation key, cannot benull.language- the language, cannot benull.
-
getType
Description copied from interface:ITranslationStorageProvider.StorageReturns the type of translation storage.- Specified by:
getTypein interfaceITranslationStorageProvider.DictionaryStorage- Specified by:
getTypein interfaceITranslationStorageProvider.Storage- Returns:
- the type of storage
- See Also:
-
beginBatchUpdate
public void beginBatchUpdate()Description copied from interface:ITranslationStorageProvider.StorageInform storage about planned batch update. Storage implementation may use this information for work optimization. After batch update doneendUpdate()must be called. Nested updates supported. Update mode end when lastendUpdate()paired to called.- Specified by:
beginBatchUpdatein interfaceITranslationStorageProvider.Storage
-
endBatchUpdate
public void endBatchUpdate()Description copied from interface:ITranslationStorageProvider.StorageEnd storage batch update.- Specified by:
endBatchUpdatein interfaceITranslationStorageProvider.Storage
-
initialize
public void initialize(org.eclipse.core.resources.IProject project) -
isReadOnly
public boolean isReadOnly()Description copied from interface:ITranslationStorageProvider.StorageChecks if the storage is read only.- Specified by:
isReadOnlyin interfaceITranslationStorageProvider.Storage- Returns:
- true, if the storage is read only
-
saveFiles
public Map<org.eclipse.core.resources.IFile,byte[]> saveFiles(TranslateLanguage language, com.google.common.hash.HashFunction hashFunction) Description copied from interface:ITranslationStorageProvider.DictionaryStorageTODO JavaDoc- Specified by:
saveFilesin interfaceITranslationStorageProvider.DictionaryStorage- Returns:
-
hasKeyForValue
Description copied from interface:ITranslationStorageProvider.DictionaryStorageChecks that dictionary has key for the value except the given skip key.- Specified by:
hasKeyForValuein interfaceITranslationStorageProvider.DictionaryStorage- Parameters:
value- the value, cannot benull.language- the translate language, cannot benull.skipKey- the key which need to skip in the check, can benull.- Returns:
- true, if storage has key for the value
-