Class PropertiesContextFileEditor
java.lang.Object
com.e1c.langtool.storage.properties.AbstractPropertiesFileEditor<FeatureKeyContextData>
com.e1c.langtool.storage.properties.PropertiesContextFileEditor
- All Implemented Interfaces:
IFileEditor<FeatureKeyContextData>
public class PropertiesContextFileEditor
extends AbstractPropertiesFileEditor<FeatureKeyContextData>
The properties file editor of
context data model that represents "key=value"
properties file. Where key is some segmented key and value is translation.
Allows to configure case-sensitive of key and value, check unique of translations values.-
Field Summary
Fields inherited from class com.e1c.langtool.storage.properties.AbstractPropertiesFileEditor
dirty, file, FILE_COMMENT_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionPropertiesContextFileEditor(org.eclipse.core.resources.IFile file, org.eclipse.core.resources.IProject project, ContextStorageSettings settings, TranslateLanguage language) Instantiates a new properties context 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
-
PropertiesContextFileEditor
public PropertiesContextFileEditor(org.eclipse.core.resources.IFile file, org.eclipse.core.resources.IProject project, ContextStorageSettings settings, TranslateLanguage language) Instantiates a new properties context file editor.- Parameters:
file- the file, cannot benull.project- the translating project, cannot benull.settings- the settings, cannot benull.language- the language, cannot benull.
-
-
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<FeatureKeyContextData>- Overrides:
loadin classAbstractPropertiesFileEditor<FeatureKeyContextData>
-
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<FeatureKeyContextData>- 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<FeatureKeyContextData>- Parameters:
lr- the line reader- Throws:
IOException- Signals that an I/O exception has occurred.- See Also:
-