org.gudy.azureus2.plugins.ui.config
Interface PluginConfigUIFactory


public interface PluginConfigUIFactory

Functions to create various plugin UI Config Parameters.

The label parameter passed to these functions is a lookup name. The UI label's text will be assigned the value looked up in the language file using the label parameter as the key name.

If you wish your configuration option to be displaying in console mode, add the following to your key:

 _b      Boolean Value
 _i      Integer Value
 _s      String Value
 
the above tags must be added before any other "_" characters.

Author:
Olivier
See Also:
PluginInterface.addConfigUIParameters

Method Summary
 EnablerParameter createBooleanParameter(String key, String label, boolean defaultValue)
          Creates a boolean parameter.
The UI component used will be a checkBox.
The parameter can be accessed using the PluginConfig.getPluginBooleanParameter(String key).
The return object, and EnablerParameter, can be used to add dependency to other parameters.
 Parameter createColorParameter(String key, String label, int defaultValueRed, int defaultValueGreen, int defaultValueBlue)
          Creates a Color Parameter.
The UI component will be a button with a Color area.
The parameter is in fact separacted in 3 parameters:
key.red
key.green
key.blue
Each color component is stored as an int parameter and can be accessed using PluginConfig.getPluginIntParameter(String key.(red|green|blue)).
 Parameter createDirectoryParameter(String key, String label, String defaultValue)
          Creates a Directory Parameter.
The UI component will be a Text field with a browse button.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).
 Parameter createFileParameter(String key, String label, String defaultValue)
          Creates a File Parameter.
The UI component will be a Text field with a browse button.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).
 Parameter createIntParameter(String key, String label, int defaultValue)
          Creates an int parameter.
The UI component will be a Text field, but only accepting int values.
The parameter can be accessed using the PluginConfig.getPluginIntParameter(String key).
 Parameter createIntParameter(String key, String label, int defaultValue, int[] values, String[] labels)
          Creates an int parameter.
The UI component will be a List.
The parameter can be accessed using the PluginConfig.getPluginIntParameter(String key).
 Parameter createStringParameter(String key, String label, String defaultValue)
          Creates a String parameter.
The UI Component will be a Text field.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).
 Parameter createStringParameter(String key, String label, String defaultValue, String[] values, String[] labels)
          Creates an String parameter.
The UI component will be a List.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).
 

Method Detail

createBooleanParameter

EnablerParameter createBooleanParameter(String key,
                                        String label,
                                        boolean defaultValue)
Creates a boolean parameter.
The UI component used will be a checkBox.
The parameter can be accessed using the PluginConfig.getPluginBooleanParameter(String key).
The return object, and EnablerParameter, can be used to add dependency to other parameters. For example, you can use a boolean parameter to choose from logging or not, and a file parameter to choose the logging file. You can call the EnablerParameter.addEnabledOnSelection method with the file Parameter in argument, so that the file parameter will only be enabled if the 'logging' (boolean) one is.

Parameters:
key - the parameter key
label - the label for this checkBox (cf. i18n)
defaultValue - the default value of the parameter
Returns:
an EnablerParameter

createIntParameter

Parameter createIntParameter(String key,
                             String label,
                             int defaultValue)
Creates an int parameter.
The UI component will be a Text field, but only accepting int values.
The parameter can be accessed using the PluginConfig.getPluginIntParameter(String key).

Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValue - the default value of the parameter
Returns:
a Parameter

createIntParameter

Parameter createIntParameter(String key,
                             String label,
                             int defaultValue,
                             int[] values,
                             String[] labels)
Creates an int parameter.
The UI component will be a List.
The parameter can be accessed using the PluginConfig.getPluginIntParameter(String key).

Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValue - the default value of the parameter
values - the list of values
labels - the list of labels (no i18n here)
Returns:
a Parameter

createStringParameter

Parameter createStringParameter(String key,
                                String label,
                                String defaultValue)
Creates a String parameter.
The UI Component will be a Text field.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).

Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValue - the default value of the parameter
Returns:
a Parameter

createStringParameter

Parameter createStringParameter(String key,
                                String label,
                                String defaultValue,
                                String[] values,
                                String[] labels)
Creates an String parameter.
The UI component will be a List.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).

Parameters:
key - the parameter key
label - The label for this field (cf. i18n)
defaultValue - the default value of the parameter
values - the list of values
labels - the list of labels (no i18n here)
Returns:
a Parameter

createFileParameter

Parameter createFileParameter(String key,
                              String label,
                              String defaultValue)
Creates a File Parameter.
The UI component will be a Text field with a browse button.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).

Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValue - the default value of the parameter
Returns:
a File Parameter

createDirectoryParameter

Parameter createDirectoryParameter(String key,
                                   String label,
                                   String defaultValue)
Creates a Directory Parameter.
The UI component will be a Text field with a browse button.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).

Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValue - the default value of the parameter
Returns:
a File Parameter

createColorParameter

Parameter createColorParameter(String key,
                               String label,
                               int defaultValueRed,
                               int defaultValueGreen,
                               int defaultValueBlue)
Creates a Color Parameter.
The UI component will be a button with a Color area.
The parameter is in fact separacted in 3 parameters:
key.red
key.green
key.blue
Each color component is stored as an int parameter and can be accessed using PluginConfig.getPluginIntParameter(String key.(red|green|blue)).

Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValueRed - the red component of the default color (0-255)
defaultValueGreen - the green component of the default color (0-255)
defaultValueBlue - the blue component of the default color (0-255)
Returns:
a Color Parameter