Class ViewFactoryHelper

java.lang.Object
org.omegat.util.gui.ViewFactoryHelper
All Implemented Interfaces:
ViewFactory

public class ViewFactoryHelper extends Object implements ViewFactory
  • Constructor Details

  • Method Details

    • create

      public View create(Element elem)
      Specified by:
      create in interface ViewFactory
    • getDefaultMappings

      public static Map<String,Function<Element,View>> getDefaultMappings(Function<Element,View> contentCreator, Function<Element,View> paragraphCreator)
      Generates a default mapping between element names and their corresponding view creation functions.

      These mappings are used to render the document elements with appropriate view types.

      Parameters:
      contentCreator - a function that creates a view for content elements
      paragraphCreator - a function that creates a view for paragraph elements
      Returns:
      a map associating element names with their corresponding view creation functions