Class OpenDocFilter

  • All Implemented Interfaces:
    IFilter

    public class OpenDocFilter
    extends AbstractFilter
    Filter for Open Document file format.
    • Constructor Detail

      • OpenDocFilter

        public OpenDocFilter()
    • 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 OpenDocument 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 OpenDocument file, which is actually a ZIP file consisting of many XML files, some of which should be translated.
        Throws:
        java.io.IOException
        TranslationException
      • hasOptions

        public boolean hasOptions()
        Returns true to indicate that the OpenDoc filter has options.
        Specified by:
        hasOptions in interface IFilter
        Overrides:
        hasOptions in class AbstractFilter
        Returns:
        True, because the OpenDoc 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)
        OpenDoc 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.