Class MsOfficeFileFilter

  • All Implemented Interfaces:
    IFilter

    public class MsOfficeFileFilter
    extends AbstractZipFilter
    Filter for Microsoft Open XML.
    • Constructor Detail

      • MsOfficeFileFilter

        public MsOfficeFileFilter()
    • Method Detail

      • isFileSupported

        public boolean isFileSupported​(java.io.File inFile,
                                       java.util.Map<java.lang.String,​java.lang.String> config,
                                       FilterContext context)
        Description copied from class: AbstractFilter
        Returns whether the file is supported by the filter, given the file and possible file's encoding ( null encoding means autodetect). Default implementation creates a reader and calls AbstractFilter.isFileSupported(BufferedReader). You should override only one of the two.

        For example, DocBook files have .xml extension, as possibly many other XML files, so the filter should check a DTD of the document.

        Specified by:
        isFileSupported in interface IFilter
        Overrides:
        isFileSupported in class AbstractZipFilter
        Parameters:
        inFile - Source file.
        config - filter's configuration options
        context - Filter context.
        Returns:
        Does the filter support the file.
      • getDefaultInstances

        public Instance[] getDefaultInstances()
        Description copied from class: AbstractFilter
        The default list of filter instances that this filter class has. One filter class may have different filter instances, different by source file mask, encoding of the source file etc.

        Note that the user may change the instances freely.

        Specified by:
        getDefaultInstances in interface IFilter
        Specified by:
        getDefaultInstances in class AbstractFilter
        Returns:
        Default filter instances
      • hasOptions

        public boolean hasOptions()
        Description copied from class: AbstractFilter
        OmegaT calls this to see whether the filter has any options. By default returns false, so filter authors should override this to tell OmegaT core that this filter has options.
        Specified by:
        hasOptions in interface IFilter
        Overrides:
        hasOptions in class AbstractFilter
        Returns:
        True if the filter has any options, and false otherwise.
      • 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.