Class PropertiesDictionaryFileEditor
java.lang.Object
com.e1c.langtool.storage.properties.AbstractPropertiesFileEditor<StringDictionaryData>
com.e1c.langtool.storage.properties.PropertiesDictionaryFileEditor
- All Implemented Interfaces:
IFileEditor<StringDictionaryData>
public class PropertiesDictionaryFileEditor
extends AbstractPropertiesFileEditor<StringDictionaryData>
The properties file editor of
dictionary data model that represents "key=value"
properties file. Where key is source word and value is translation.
Allows to configure case-sensitive of key and value, check unique of translations values.
Also allows to check unique of the value globally by all available to read dictionary storages and replace value
with prefix and/or postfix characters on the read of file content.-
Field Summary
Fields inherited from class com.e1c.langtool.storage.properties.AbstractPropertiesFileEditor
dirty, file, FILE_COMMENT_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionPropertiesDictionaryFileEditor(org.eclipse.core.resources.IFile file, org.eclipse.core.resources.IProject project, DictionaryStorageSettings settings, TranslateLanguage language, ITranslatingProjectManager translatingProjectManager, IStorageSettingsManager storageSettingsManager, ITranslationStorageManager translationStorageManager) Instantiates a new properties dictionary file editor. -
Method Summary
Modifier and TypeMethodDescriptiongetData()Gets file model data.booleanisEmpty()Returnstrueif no translations stored in this file.voidload()Load from the resource file.protected voidloadInternal(com.e1c.langtool.storage.properties.LineReader lr) Load content form line reader.protected voidstoreInternal(BufferedWriter bw, boolean escUnicode) Store data to buffer writer.Methods inherited from class com.e1c.langtool.storage.properties.AbstractPropertiesFileEditor
delete, getFile, isDirty, load, loadConvert, markDirty, save, save, saveConvert, store, store, writeComments
-
Constructor Details
-
PropertiesDictionaryFileEditor
public PropertiesDictionaryFileEditor(org.eclipse.core.resources.IFile file, org.eclipse.core.resources.IProject project, DictionaryStorageSettings settings, TranslateLanguage language, ITranslatingProjectManager translatingProjectManager, IStorageSettingsManager storageSettingsManager, ITranslationStorageManager translationStorageManager) Instantiates a new properties dictionary file editor.- Parameters:
file- the file, cannot benull.project- the translating project, cannot benull.settings- the settings, cannot benull.language- the language, cannot benull.translationStorageManager2-storageSettingsManager2-translatingProjectManager2-
-
-
Method Details
-
isEmpty
public boolean isEmpty()Description copied from interface:IFileEditorReturnstrueif no translations stored in this file.- Returns:
trueif no translations stored in this file,falseotherwise.
-
load
public void load()Description copied from interface:IFileEditorLoad from the resource file.- Specified by:
loadin interfaceIFileEditor<StringDictionaryData>- Overrides:
loadin classAbstractPropertiesFileEditor<StringDictionaryData>
-
getData
Description copied from interface:IFileEditorGets file model data.- Returns:
- the file model data, cannot return
null.
-
storeInternal
Description copied from class:AbstractPropertiesFileEditorStore data to buffer writer.- Specified by:
storeInternalin classAbstractPropertiesFileEditor<StringDictionaryData>- Parameters:
bw- the buffer writerescUnicode- the escape unicode symbols- Throws:
IOException- Signals that an I/O exception has occurred.- See Also:
-
loadInternal
Description copied from class:AbstractPropertiesFileEditorLoad content form line reader.- Specified by:
loadInternalin classAbstractPropertiesFileEditor<StringDictionaryData>- Parameters:
lr- the line reader- Throws:
IOException- Signals that an I/O exception has occurred.- See Also:
-