Class OpenXMLFilter

  • All Implemented Interfaces:
    IFilter

    public class OpenXMLFilter
    extends AbstractFilter
    Filter for Open XML file format.
    • Constructor Detail

      • OpenXMLFilter

        public OpenXMLFilter()
    • Method Detail

      • isFileSupported

        public boolean isFileSupported​(java.io.File inFile,
                                       java.util.Map<java.lang.String,​java.lang.String> config,
                                       FilterContext fc)
        Returns true if it's an Open XML file.
        Specified by:
        isFileSupported in interface IFilter
        Overrides:
        isFileSupported in class AbstractFilter
        Parameters:
        inFile - Source file.
        config - filter's configuration options
        fc - Filter context.
        Returns:
        Does the filter support the file.
      • processFile

        public void processFile​(java.io.File inFile,
                                java.io.File outFile,
                                FilterContext fc)
                         throws java.io.IOException,
                                TranslationException
        Processes a single OpenXML file, which is actually a ZIP file consisting of many XML files, some of which should be translated.
        Throws:
        java.io.IOException
        TranslationException
      • compareZipEntries

        public int compareZipEntries​(java.util.zip.ZipEntry z1,
                                     java.util.zip.ZipEntry z2)
      • hasOptions

        public boolean hasOptions()
        Returns true to indicate that the OpenXML filter has options.
        Specified by:
        hasOptions in interface IFilter
        Overrides:
        hasOptions in class AbstractFilter
        Returns:
        True, because the OpenXML filter has options.
      • changeOptions

        public java.util.Map<java.lang.String,​java.lang.String> changeOptions​(java.awt.Window parent,
                                                                                    java.util.Map<java.lang.String,​java.lang.String> currentOptions)
        OpenXML Filter shows a modal dialog to edit its own options.
        Parameters:
        currentOptions - Current options to edit.
        parent - parent window
        Returns:
        Updated filter options if user confirmed the changes, and current options otherwise.