Class AbstractPluginInitializationProducer

  • Direct Known Subclasses:
    UserGroupSelectProducer

    public abstract class AbstractPluginInitializationProducer
    extends Object
    This abstraction defines the produce method which provides the HTML code to initialize a plugin on the WEB browser page.
    Author:
    silveryocha
    • Constructor Detail

      • AbstractPluginInitializationProducer

        public AbstractPluginInitializationProducer()
    • Method Detail

      • stringValue

        protected static String stringValue​(String value)
      • booleanValue

        protected String booleanValue​(boolean value)
      • numericValue

        protected String numericValue​(Number value)
      • withUserLanguage

        public <T extends AbstractPluginInitializationProducer> T withUserLanguage​(String language)
        Sets the user language for UI rendered by the plugin.
        Type Parameters:
        T - the type of the producer.
        Parameters:
        language - the user language.
        Returns:
        itself.
      • withJsInstanceVar

        public <T extends AbstractPluginInitializationProducer> T withJsInstanceVar​(String jsInstanceVar)
        Sets the name of the js instance.
        Type Parameters:
        T - the type of the producer.
        Parameters:
        jsInstanceVar - the name of the js instance.
        Returns:
        itself.
      • addOption

        protected <T extends AbstractPluginInitializationProducer> T addOption​(String name,
                                                                               String value)
        Adds given name / value.
        Type Parameters:
        T - the type of the producer.
        Parameters:
        name - the name to add.
        value - the boolean value associated to the key.
        Returns:
        itself.
      • addOption

        protected <T extends AbstractPluginInitializationProducer> T addOption​(String name,
                                                                               Stream<Object> values,
                                                                               boolean valuesAreStrings)
        Adds given name / value which will be an array of values.
        Type Parameters:
        T - the type of the producer.
        Parameters:
        name - the name to add.
        values - the values to set.
        valuesAreStrings - indicates if the values must be registered as string.
        Returns:
        itself.
      • addOption

        public <T extends AbstractPluginInitializationProducer> T addOption​(String name,
                                                                            boolean value)
        Adds given name / value.
        Type Parameters:
        T - the type of the producer.
        Parameters:
        name - the name to add.
        value - the boolean value associated to the key.
        Returns:
        itself.
      • addOption

        public <T extends AbstractPluginInitializationProducer> T addOption​(String name,
                                                                            Number value)
        Adds given name / value.
        Type Parameters:
        T - the type of the producer.
        Parameters:
        name - the name to add.
        value - the number value associated to the key.
        Returns:
        itself.
      • produce

        public String produce()
        Returns:
        the HTML code which initializes the plugin.
      • getUserLanguage

        protected String getUserLanguage()
      • getDependencies

        protected abstract String getDependencies()