Package org.silverpeas.core.html.plugin
Class AbstractPluginInitializationProducer
- java.lang.Object
-
- org.silverpeas.core.html.plugin.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 Summary
Constructors Constructor Description AbstractPluginInitializationProducer()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T extends AbstractPluginInitializationProducer>
TaddOption(String name, boolean value)
Adds given name / value.<T extends AbstractPluginInitializationProducer>
TaddOption(String name, Number value)
Adds given name / value.protected <T extends AbstractPluginInitializationProducer>
TaddOption(String name, String value)
Adds given name / value.protected <T extends AbstractPluginInitializationProducer>
TaddOption(String name, Stream<Object> values, boolean valuesAreStrings)
Adds given name / value which will be an array of values.protected String
booleanValue(boolean value)
protected abstract String
getDependencies()
protected String
getUserLanguage()
protected String
numericValue(Number value)
String
produce()
protected static String
stringValue(String value)
<T extends AbstractPluginInitializationProducer>
TwithJsInstanceVar(String jsInstanceVar)
Sets the name of the js instance.<T extends AbstractPluginInitializationProducer>
TwithUserLanguage(String language)
Sets the user language for UI rendered by the plugin.
-
-
-
Method Detail
-
booleanValue
protected String booleanValue(boolean 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()
-
-