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 Details

  • Constructor Details

  • 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 be null.
      settings - the settings, cannot be null.
      language - the language, cannot be null.
      Returns:
      the file editor of context data, can return null if file format from settings is not supported.
    • isFormatSupported

      public static boolean isFormatSupported(String format)
      Checks if the file format exists and supports in the storage system.
      Parameters:
      format - the format, cannot be null.
      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: ITranslationFileEditorFactory
      Gets the file editing handler.
      Specified by:
      getFileEditor in interface ITranslationFileEditorFactory<ContextTranslationData>
      Parameters:
      file - the file, cannot be null.
      project - the project, cannot be null.
      language - the language, cannot be null.
      Returns:
      the file editor, cannot return null.