Package com.e1c.langtool.storage.context
Class ContextFormatFactory
java.lang.Object
com.e1c.langtool.storage.context.ContextFormatFactory
- All Implemented Interfaces:
ITranslationFileEditorFactory<ContextTranslationData>
public class ContextFormatFactory
extends Object
implements ITranslationFileEditorFactory<ContextTranslationData>
A factory for creating
IFileEditor editor of the ContextTranslationData object by file and the project-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IFileEditor<? extends ContextTranslationData>createEditor(org.eclipse.core.resources.IFile file, org.eclipse.core.resources.IProject project, ContextStorageSettings settings, TranslateLanguage language) Creates a new file editor object of context data from the file.getFileEditor(org.eclipse.core.resources.IFile file, org.eclipse.core.resources.IProject project, TranslateLanguage language) Gets the file editing handler.static booleanisFormatSupported(String format) Checks if the file format exists and supports in the storage system.
-
Field Details
-
FORMAT_PROPERTIES
- See Also:
-
FORMAT_REGEX
- See Also:
-
FORMAT_PO
- See Also:
-
-
Constructor Details
-
ContextFormatFactory
-
-
Method Details
-
createEditor
public static IFileEditor<? extends ContextTranslationData> createEditor(org.eclipse.core.resources.IFile file, org.eclipse.core.resources.IProject project, ContextStorageSettings settings, TranslateLanguage language) Creates a new file editor object of context data from the file.- Parameters:
file- the file that need to load from.project- the translating project, may be different form the project of the file, cannot benull.settings- the settings, cannot benull.language- the language, cannot benull.- Returns:
- the file editor of context data, can return
nullif file format from settings is not supported.
-
isFormatSupported
Checks if the file format exists and supports in the storage system.- Parameters:
format- the format, cannot benull.- Returns:
- true, if the format supported
-
getFileEditor
public IFileEditor<ContextTranslationData> getFileEditor(org.eclipse.core.resources.IFile file, org.eclipse.core.resources.IProject project, TranslateLanguage language) Description copied from interface:ITranslationFileEditorFactoryGets the file editing handler.- Specified by:
getFileEditorin interfaceITranslationFileEditorFactory<ContextTranslationData>- Parameters:
file- the file, cannot benull.project- the project, cannot benull.language- the language, cannot benull.- Returns:
- the file editor, cannot return
null.
-